Go Down

Topic: I need help converting Frequency and Pulse width to Voltage. (Read 1 time) previous topic - next topic


May 30, 2013, 07:28 pm Last Edit: May 30, 2013, 07:30 pm by TheBoz Reason: 1
I need to take a single signal and convert it into two 0-5v outputs that I can use to drive some other devices.  For now I am going to dump them into the A0 and A1 ports and drive some LED number segments just to validate that everything is working.  Currently I am using an LM2917-8 for the frequency conversion which still is not working but I am getting close.  The next part converting the pulse width to voltage I have no clue how to do.

0-12v DC
Pull Up 10k ohm to 12v DC
Square Wave
50Hz-150Hz Frequency
1ms-5ms Pulse width

The frequency will adjust as well as the pulse width.

A little background on me, I am super new to this.  I have had my Arduino now for 2 months, and have completed the basics.  Temp sensor, Shift Register, basic PWM of a RC Car motor, LED Number Segments, Web Server using the Ethernet Shield, and a few other odds and ends.  I have zero training in electronics and just started this as a fun play time thing.  So just assume that I am handicapped when it comes to electronics.

Thanks for any help.


I need to take a single signal and convert it into two 0-5v outputs that I can use to drive some other devices.  For now I am going to dump them into the A0 and A1 ports
I'm confused by these sentences.
Why does a single signal need to be converted to two?
What is the nature of the signal - digital or analogue?
What is the bandwidth?
Why are you involving analogue input pins?
What does "dump" mean?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


Quote from another site about the Flex Fuel Sensor.

The frequency of the signal indicates the ethanol percentage. The output frequency is linear with respect to the percentage of ethanol content in the fuel.  The normal range of operating frequency is between 50 and 150 Hertz:
        50 Hertz indicates 0% ethanol, and
        150 Hertz indicates 100% ethanol.

The pulse width indicates the fuel temperature. The normal pulse width is between 1 and 5 milliseconds:
        1 millisecond indicates -40°C (-40°F), and
        5 milliseconds indicates 125°C (257°F)

To answer your questions.

1) I want to use the ethanol percentage, and fuel temp, for car ecu modifications, however the ecu only takes 0-5v inputs.
2) Digital, -- remember I am new so not fully up to speed on the naming of things.
3) Not sure what you mean by bandwidth, but here is what the sensor outputs 50-150hz
4) Analog pins are to be used for LED number segment display of the data
5) Dump means using it somewhere for now, and maybe use it somewhere else later.

Did you ever get anywhere with writing the code for this?  I saw on YouTube a vid of a arduino displaying percentages from. A flex fuel sensor.  I asked to see the code for it but got no reply from the guy who posted the video.

Seriously interested in making this work.


Nothing to do with a fuel sensor but attached is a simple sketch I wrote to measure frequency & duty cycle that may adapt to your needs.

Thx much.  I just figured out the math to calculate the alcohol percentage and also the fuel temp based upon frequency and pulse width measurements.  Need to build a prototype with a 16x2 display and test it further. Looks like it can be done for less than $10 not including the e85 sensor.  I can get those for free at the local u wrench it.  Progress, whoo-hoo!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131