Author Topic: DIY FPGA/Microcontroller Air/Fuel Gauge?  (Read 7468 times)

0 Members and 1 Guest are viewing this topic.

Offline KernelTopic starter

  • Contributor
  • Posts: 18
DIY FPGA/Microcontroller Air/Fuel Gauge?
« on: July 22, 2013, 02:09:08 am »
Hi guys,
I'm completely new to FPGAs and electronics in general.

After watching Dave's "What is an FPGA?" video, I think an FPGA would be ideal for the application.

I want to make my own program to make an FPGA either display the air/fuel ratio (not lambda) as a number on an LCD display or display it visually over different colored LEDs. Actually, I'd love it to do both since I want to read it out of the corner of my eye while riding my motorcycle (safety/coolness concerns).

Since I'm brand new to this, I know I should just buy the Jay Car kit and assemble it but I don't want to do that because it would be far too easy, also I reckon I could buy a bunch of $2 FPGAs and use just one or two of them to do the job, and use the rest for various other projects I will come up with. I'm a tight arse and the Jay Car kit costs around twenty bucks for half the functionality I want.

Should I just buy a micro controller and make my own PCB layout? Which micro controller would be best? Keep in mind I want a visual dynamic color LED read out as well as a digital number read out.

Can I just hook up a multimeter to the oxygen sensor on my motorcycle's exhaust pipe and get a digital air/fuel read out that way?
« Last Edit: July 22, 2013, 01:41:29 pm by Kernel »
 

Offline Spunky

  • Regular Contributor
  • *
  • Posts: 63
  • Country: wales
Re: DIY FPGA Air/Fuel Gauge?
« Reply #1 on: July 22, 2013, 03:12:14 am »
I'd use a pic chip for this. I think these sensors work by resistance which is easy, you can put 0-5v straight into the pic (at low current), and it's already configured for this sort of thing.
 

Offline jebcom

  • Regular Contributor
  • *
  • Posts: 81
  • Country: us
Re: DIY FPGA Air/Fuel Gauge?
« Reply #2 on: July 22, 2013, 03:16:07 am »
I guess you could use an FPGA, but you would still need an A/D converter. A microcontroller with A/D would be more commonly used in this type of application.

You'll have to find out what kind of oxygen sensor your motorcycle uses. If it happens to have a wideband sensor, (not likely because they are expensive) you might be able to tap into it. You'll need to get documentation on the sensor and understand how to use it. If it's not a wideband sensor, the output will not be useful for determining air-fuel ratio. Those sensors don't have a reliable output at the stoichiometric point; in use, they flop back and forth between lean and rich, and the engine controller adjusts to drive it the other direction. So with these devices, the system is oscillating between slightly lean and slightly rich to get a stoichiometric mix on average, but the sensor never actually gives a direct indication of the stoichiometric point.

 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13745
  • Country: gb
    • Mike's Electric Stuff
Re: DIY FPGA Air/Fuel Gauge?
« Reply #3 on: July 22, 2013, 08:32:41 am »
No reason to use an FPGA for something like this - microcontroller would be cheaper and easier.
Use the right tool for the job.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline KernelTopic starter

  • Contributor
  • Posts: 18
Re: DIY FPGA Air/Fuel Gauge?
« Reply #4 on: July 22, 2013, 01:40:57 pm »
Wow, hi there Mike, enjoy your videos.

Thanks guys, I was thinking about it the other day and determined that while of course it COULD be done, there probably wouldn't be much point to using an FPGA other than for bragging rights (which I'm gonna get anyway, right??) and a microcontroller/processor will be better suited for the application.

jebcom, My motorcycle, a 2010 Suzuki DR650SE. came out of the factory with a Mikuni BST40 carburetor installed. For purposes of throttle response, more power with minimal fuel economy drop, better fuel delivery, better running condition and no bog, I have installed a Keihin FCR-MX 39 carburetor, an extremely popular upgrade. While the engine runs adequately enough at revs, picks them up more quickly and accelerates more freely and with less hesitation, the running condition of the engine is far from perfect due to tuning issues inherent with a non-standard fueling system installed and idling issues due to an air leak *somewhere*.
Now, there is a decent-sized thread on the DR650 discussion forums about tuning the DR650 with an Innovate air/fuel meter (for some reason the Australian delivered DR650s require different jetting than the USA ones and the USA ones seem to benefit from the needle we're using besides). So there are stoich-scale numbers provided for each level of throttle opening/revs or something. I'm aiming to get within each of the numbers specified by the guy who runs the biggest DR650 parts, accessories and servicing business in the industry but obviously I will require a digital read out to tune the carburetor to give the best compromise of more power at large throttle openings and less fuel at cruising throttle openings. I refuse to pissfart around with 'seat-of-the-pants' style tuning.

So in a nutshell, my motorcycle is carburetted so it does not have an o2 sensor. I am going to buy a wideband o2 sensor which I will have my friend who is a boilermaker weld in a bung in the header pipe for, and make a fancy air/fuel gauge to go with it so that I can tune my carburetor DIY. So yes, my motorcycle will have a wideband oxygen sensor installed. It will bring me lots of satisfaction, nobody else will have the gauge that I will have (since I'm making it custom) and I will impress my friends.

What I would really love to know guys is, which low-cost budget microcontroller will be best suited for the application? I've heard the terms pic chip and A/D converter used (I know what an analog to digital converter is). So will any old relatively powerful (how much power do I need?) pic chip with an A/D converter work? Again, has to be a cheap one cause I'm a young tight-arse and I would like to brag about how little this will end up costing me to make. However, I want real time updating, durability (don't forget, this is going onto a 647cc single cylinder motorcycle!), and enough functionality/flexibility for me to be able to do this relatively easily.

I'd like to again point out that I am very new to all of this so I wouldn't know where to begin with comparing various microcontrollers to decide which microcontroller will be the cheapest one I can get with enough power for real time updating and enough durability to withstand vibrations over a long period of time. Mike, the main advantage to using an FPGA is that I could get like 50 of them for $100 or so and be able to do this and use the other 49 to make a few air/fuel gauges for friends and use in other projects. Since microcontrollers have more specific functionality, I will probably only get about 5 or so and make a few of these air/fuel gauges to sell to my mates or whoever wants one. Don't get me wrong - I'm not saying FPGAs are cheaper than microcontrollers because they're not, it's just that I want lots of chips to do lots of projects. Or should I get 10 or 20 of the same microcontroller and do a few projects with those? Am I more likely to be able to do 10 or 20 A/D PIC chip microcontroller projects than I am 50 FPGA projects as a beginner? I don't know, inform me! What should I spend my money on! :P
« Last Edit: July 22, 2013, 01:59:50 pm by Kernel »
 

Offline Spunky

  • Regular Contributor
  • *
  • Posts: 63
  • Country: wales
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #5 on: July 23, 2013, 02:39:20 am »
Even the biggest pic microcontrollers are only a few pounds / dollars / whatever, and they will have plenty of I/O for most control applications. The 18F4685 is hugely versatile with enough IO to run an 8bit LCD, several switched inputs, and I think 4 ADCs/DACs. Also has 96kb of program memory, which for simple control functions is huge. There are cheaper versions, but if you're buying for as yet unknown projects then who knows what you need.

If you need lots of menu driven stuff then that can eat a lot of memory, and if you're starting out then your code won't be as tight as it could be either.

You also need to decide whether to learn C, or one of the Basic languages. If you've already done one or the other on a PC then the choice is already made.

I work everyday with these chips and writing and debugging the code is hugely immersive at times.
 

Offline KernelTopic starter

  • Contributor
  • Posts: 18
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #6 on: July 23, 2013, 10:01:47 am »
Don't know C or BASIC, but I've seen a simple C program for a microcontroller and it looks easy enough to do.
There will be no menus. This thing will consist of either an LCD display or 3x 7 segment display (this will need floating point), and probably 12 or so LEDs of 3 different colours for indicating the air-fuel ratio. When it receives power the digital display will display dashes across itself and the LEDs will be unilluminated. When it starts getting an analog signal from the wideband o2 sensor, it will display the air-fuel ratio on the digital display (likely high 13s or low 14s when idling) and the LED display will be yellow for rich, green for optimal range, red for lean.
 

Offline Cozzmo

  • Regular Contributor
  • *
  • Posts: 67
  • Country: au
DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #7 on: July 23, 2013, 11:04:49 pm »
Driving / operating the sensor is going to be an issue you need to consider too. Feedback and driving of the heating element, free air calibration routines, detection of a faulty reading etc etc.

I would highly recommend getting an off the shelf product and customizing the display side of things. LC-1 innovate units are small, light weight, sealed and have configurable analog and serial outputs.

Anything you make in a DIY domain without costing you a lot more money isn't going go give you the end result. Plus, the innovate is a proven product and a market leader in accuracy and response. I don't work for them BTW, but I use one everyday on my car. 
 

Offline Vernon

  • Newbie
  • Posts: 7
  • Country: us
    • Engineer LLC "Where imagination (flying Monkey) takes flight"
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #8 on: July 24, 2013, 12:42:20 am »
Here's a somewhat detailed discussion on the subject of the wide band O2 sensor and what it takes to get a reliable reading out of them.

http://www.megamanual.com/PWC/LSU4.htm

Now if this is to be an in-depth learning experience then it will be a great one.  If you're just looking to save a few bucks, maybe not.
"Pie are not square!  Pie are round!  They ain't teached you nuthin' at that there Uni Versa Tee."
 

Offline JohnnyP

  • Regular Contributor
  • *
  • Posts: 66
  • Country: us
    • J&S Electronics
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #9 on: July 24, 2013, 08:17:12 am »
http://www.14point7.com/

Based on a Cypress PSOC.
Thinking is hard work
 

Offline KernelTopic starter

  • Contributor
  • Posts: 18
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #10 on: July 26, 2013, 06:18:25 am »
Driving / operating the sensor is going to be an issue you need to consider too. Feedback and driving of the heating element, free air calibration routines, detection of a faulty reading etc etc.

I would highly recommend getting an off the shelf product and customizing the display side of things. LC-1 innovate units are small, light weight, sealed and have configurable analog and serial outputs.

Anything you make in a DIY domain without costing you a lot more money isn't going go give you the end result. Plus, the innovate is a proven product and a market leader in accuracy and response. I don't work for them BTW, but I use one everyday on my car.

Here's a somewhat detailed discussion on the subject of the wide band O2 sensor and what it takes to get a reliable reading out of them.

http://www.megamanual.com/PWC/LSU4.htm

Now if this is to be an in-depth learning experience then it will be a great one.  If you're just looking to save a few bucks, maybe not.

With these points in mind I think I'll buy the Innovate (which I already knew about anyway) and I'll save this for a future project after I have some experience. Might buy a few ones of that  aforementioned pic microcontroller and see what fun and learning can be had.

http://www.14point7.com/

Based on a Cypress PSOC.

Those look pretty good especially for a more beginner type of project, guess I'll get the DIY version and see if I can source a wide band sensor locally for cheap from someone wrecking a car/motorcycle - anyone know if that can be done?
« Last Edit: July 26, 2013, 06:21:43 am by Kernel »
 

Offline toalan

  • Newbie
  • Posts: 1
Re: DIY FPGA/Microcontroller Air/Fuel Gauge?
« Reply #11 on: February 27, 2014, 10:04:07 pm »
Hi,

My name is Alan To, I am guy who runs 14Point7.com. Would anyone know if David the host of EEVBlog is into tinkering with cars? I would like to send him my open source SLC Free wideband controller kit and maybe have him spend a few minutes tearing it apart on his show.

Regards,

Alan To
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf