DIY Ethanol Content Gauge

Discussion in 'Mazdaspeed 3/6 E85/CornFed' started by alexwlwsn, Aug 1, 2017.

Watchers:
21 users.
  1. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Let me start off and say I've never done a project like this before, so I'm essentially making this thread as I figure things out. Basically what I'm looking to make is an ethanol content gauge and be in under $100. Since the next cheapest Innovate gauge is upwards of $240 with the gauge, we can save some money here.

    So according to my research, the Chevy style ethanol content sensors are rather simple - just two wires for power and one for signal. This signal wire we're concerned with just essentially returns a certain frequency which tells the % of alcohol in your fuel. See below for pinout and ethanol content frequency info:

    gmethsensorwiringpinout.png

    It's nice that table on there contains the conversion formula and everything for changing the hertz to a %.

    So, now we need something to read this frequency and display it to us in a format we can read. I have already purchased an Arduino Uno (link) and plan to use this to process the ethanol sensor's output and make it into a format that I can display onto a small screen (link). I can likely keep the Arduino in a little box in my glove box and then I was thinking keeping the screen in my center console ash tray section so I can just open it and look whenever I fill my tank.

    Thankfully my car already runs PI and it'll be decently easy to find a place in my fuel system to tap into in order to add the sensor.

    So far:
    Arduino Uno = $10
    4 digit display = $2.99
    Flex fuel sensor = ~$30
    Misc wires = $cheap
    Fuel line quick connect fittings = $20-$30

    I know @SharksInSpace was interested... I feel @Maisonvi may like this because he like making things, and of course @Enki can hop in and add information if he wants since he's just a genius.

    I know there's also tiny Arduino controllers that are maybe 1/4 of the size of the normal Arduino Uno that I have and may be able to do this processing, but that's maybe a project for someone else interested or in the future for me.

    Relevant links:
    Arduino on eBay: Link
    Fuel line push fittings: Link
    Flex fuel sensor: Link
    Arduino input/output how to: Link
    16x2 LCD display: Link
    Setup for above display: Link
     
    Last edited: Aug 4, 2017
    • Like Like x 8
  2. SharksInSpace

    SharksInSpace Planets and shit. Silver Member

    Joined:
    Apr 5, 2016
    Posts:
    1,739
    Trophy Points:
    113
    Location:
    Middle Coast
    Ratings:
    +2,149 / -14
    Following f'sho!
     
  3. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    I forgot to add: Link

    I found an article that goes over making a shift light of sorts by taking RPM input from a coil pack and converting that to light up sequential LEDs. At the very least I can steal the code taking input of a frequency and change that to my flex fuel calculation.

    This also gives me the idea to program something to light up with a green light when you're within +/- 2% of your target ethanol content and maybe have an orange light and then a red light on either side implying too much or too little ethanol in your system. Just food for thought.
     
    • Like Like x 1
  4. Maisonvi

    Maisonvi Platinum Member

    Joined:
    Feb 10, 2016
    Posts:
    1,397
    Trophy Points:
    113
    Location:
    South Haven, MI
    Ratings:
    +1,992 / -0
    Let's make shit! Cool idea man

    Sent from my SM-G900V using Tapatalk
     
    Maisonvi, via a mobile device, Aug 1, 2017
    #4
    • Like Like x 3
  5. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Me being a bad employee and all, I think I have a good draft of code to calculate % from a signal input. I based it off of this link. This writes to a 16x2 LCD screen though which is a little fancier than I was planning. I will probably mess around with it and try to simplify it. With a 16x2 screen though you can write more words and whatnot so that may be appealing to some.

    Presently the screen will show:
    [Ethanol Content:]
    [XX.X% ]

    I can also make a start up screen too I'm sure displaying "MazdaSpeed" or something corny like that too.
     

    Attached Files:

    • Like Like x 1
  6. SharksInSpace

    SharksInSpace Planets and shit. Silver Member

    Joined:
    Apr 5, 2016
    Posts:
    1,739
    Trophy Points:
    113
    Location:
    Middle Coast
    Ratings:
    +2,149 / -14
    @JohnnyTightlips has a hard-on for arduino stuff, too; he may be able to offer some insight for this project.
     
    • Like Like x 1
  7. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    I added in what I assume will work as a start-up screen into my code.

    I need to order at least a screen tonight so I can start actually testing my ideas
     

    Attached Files:

  8. jsmith

    jsmith Silver Member

    Joined:
    Aug 12, 2016
    Posts:
    569
    Trophy Points:
    63
    Location:
    FL
    Ratings:
    +476 / -0
  9. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    The GM sensor at least purely measures ethanol content. It's for flex fuel cars and if I understand properly returns a frequency based on $ of alcohol. I can't really comment on what would happen if you tried to measure the alcohol percentage of something like vodka though...

    [doublepost=1501616426][/doublepost]Small update:

    I found you can get a 4 pin LCD screen which obviously is easier to wire than a 16-pin. It's basically through the use of some serial adapter. Updated code attached.

    To use this, you'll need to add the latest liquid crystal data into your Arduino library folder: Link

    And I ordered a screen, power supply, and some wires to try and make this thing light up. Just gotta wait on the mail man to come and we'll see if this actually does anything. I also found someone selling an actual ash tray insert that I've purchased to cut up hopefully mount my gauge into. Likely I'll order the sensor after I get paid this weekend.
     

    Attached Files:

    Last edited: Aug 1, 2017
  10. JohnnyTightlips

    JohnnyTightlips Motorhead Silver Member

    Joined:
    May 12, 2016
    Posts:
    1,556
    Trophy Points:
    113
    Location:
    Iowa
    Ratings:
    +2,452 / -3
    I need this in my life. You could def use the audrino for more as well. Very cool project.
     
    JohnnyTightlips, via a HTC device, Aug 1, 2017
    #10
  11. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    I was thinking the exact same thing. There aren't too many things you need to know that aren't reported by the Accessport but I'm sure we could figure something out.

    We could probably trigger an audible alarm if someone runs low on meth or if meth flow is affected in some way. (Good idea?) I did also have the idea of giving the Arduino an RPM input and then having it power some sequential shift lights similar to the new BMW M cars actually, I feel like that would be pretty neat.
    [doublepost=1501686746][/doublepost]Regarding fuel fittings - factory MazdaSpeed push fittings are 5/16" and the GM flex fuel sensor is 3/8" push fit. We'll have to do some searching and see if there's a simple female-female and female-male adapter. If there was, all you'd have to do was pop off a fuel line and put the sensor right in.
     
    Last edited: Aug 2, 2017
  12. JohnnyTightlips

    JohnnyTightlips Motorhead Silver Member

    Joined:
    May 12, 2016
    Posts:
    1,556
    Trophy Points:
    113
    Location:
    Iowa
    Ratings:
    +2,452 / -3
  13. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Flex fuel sensor, pigtail harness ordered! Hopefully by mid next week I'll have my screen, sensor, and wiring and I just need to figure out how to mount the flex fuel sensor into my fuel line. I'm mostly looking forward to the screen though since I'm curious to see if my little Arduino program does anything at all.
     
    • Like Like x 2
  14. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Stole this from another website but I just want to have all information easily available here:
    I will use 4 colored jumper wires to make it easy.
    • There are 4 pins on the UART labeled GND, VCC, SDA and SCL.
    • Use the red wire to connect the VCC from the UART to the VCC on the Arduino
    • Use the black wire to connect the GND from the UART to the GND on the Arduino
    • Use the green Wire to connect the SDA from the UART to the SDA on the Arduino
    • And finally use the yellow wire to connect the SCL from the UART to the SCL on the Arduino
    FGFUVM1IDR7WXOF.MEDIUM.jpg

    And then the signal input from the flex fuel sensor to the Arduino is port 12.

    On another note, the signal from the flex fuel sensor also includes fuel temperature... Can anyone think of a reason for me to add in the option to read fuel temp on my screen?
     
  15. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Since not everyone has a -10AN fuel system w/ return line this post may only help a few.... but at least for the SP63 fuel system these AN fittings should just let you toss the flex fuel sensor right in your return fitting at the tank top hat:

    2x 3/8 x -8AN quick connect fittings: Link
    1x female to male -8AN x -10AN expander: Link
    1x straight female to female swivel -8AN x -10AN: Link
    Total = ~$44

    I'll update this tonight after looking under my seat to see if it makes more sense to have a 90* adapter in there somewhere. Here's a general idea of what we're looking at:

    20773353_10209842853731432_1758936387_o.jpg

    Note: diagram is to perfect scale.

    If you want to tap into a stock fueling system and you've already made it this far, I'm confident you can figure it out. Hint: you'll need 2x more female quick release fittings that'll connect to a 5/16 line rather than the left and right most fittings in my "diagram".
     
    Last edited: Aug 10, 2017
    • Like Like x 3
  16. Maisonvi

    Maisonvi Platinum Member

    Joined:
    Feb 10, 2016
    Posts:
    1,397
    Trophy Points:
    113
    Location:
    South Haven, MI
    Ratings:
    +1,992 / -0
    Woo! I have a -10an fuel system, make this work and we will see if I decide to make up one too

    Sent from my SM-G900V using Tapatalk
     
    Maisonvi, via a mobile device, Aug 10, 2017
    #16
    • Like Like x 2
  17. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Things are happening! I guess the screen I ordered is 20x4, not 16x2 but that's not the end of the world.. That just gives me more room for activities!

    IMG_20170815_121833.jpg

    IMG_20170815_121837.jpg

    And it says 10.XX% whenever it's sitting on the table so I might have to insulate the pins on the back of the Arduino for when it goes in my car. Wouldn't want false readings or else this is entirely useless. I may also make the % bar on the bottom range from 25%-75% also since I will generally will be right around 48%. Thatl'll give me a little more "resolution" as to my ethanol status.
    [doublepost=1502827383][/doublepost]Here's a lil video:

     
    Last edited: Aug 15, 2017
    • Like Like x 5
  18. JohnnyTightlips

    JohnnyTightlips Motorhead Silver Member

    Joined:
    May 12, 2016
    Posts:
    1,556
    Trophy Points:
    113
    Location:
    Iowa
    Ratings:
    +2,452 / -3
    Looking great, this was a video that came up after yours, would be cool to implement more stuff eventually.

    Here
     
    • Like Like x 1
  19. alexwlwsn

    alexwlwsn Greenie Member

    Joined:
    Feb 10, 2016
    Posts:
    697
    Trophy Points:
    93
    Location:
    Harco MD
    Ratings:
    +1,038 / -0
    Man I need to find a neat screen like that! I was looking around my cabin last night and it seems like the screen I have is going to be difficult to mount in a clean way.
     
  20. JohnnyTightlips

    JohnnyTightlips Motorhead Silver Member

    Joined:
    May 12, 2016
    Posts:
    1,556
    Trophy Points:
    113
    Location:
    Iowa
    Ratings:
    +2,452 / -3
    Yeah that would be cool. You could also just hide it in the glove box or center console if it was only doing fuel info.
     
Loading...

Share This Page

Users Viewing Thread (Users: 0, Guests: 0)