12V as analog input on arduino

Hi everyone,

I am making custom gauge cluster for my car. The problem I am having is that I am trying to measure RPM, which is analog value with max 12v and min 0V. How can I measure it with arduino without damaging the board?

Thank you!

Search on voltage divider.

2 Likes

What do you mean by: which is analog value ?

The RPM are represented by an analog signal with a high of 12 volts and a low of 0 volts.

1 Like

I’ve seen how voltage dividers work, but but this is the value that changes will it work properly?

I mean that the value is changing like pot

The voltage divider will ......divide the voltage

So lets say you choose your two resistors 2K and 1K you get a 3:1 voltage divider.

full rpm is 12V : 3 = 4V
half(?) rpm is 6V : 3 = 2V
no RPM is 0V : 3 = 0V

You would then have to measure which voltage comes out at which RPM, as while the division is linear your 0-12V gauge maybe not.

Arduino can measure that.

2 Likes

This means that you have not actually understood what a voltage divider is.

If you arrange the resistors so that when there is 12V output from your sensor there is 5V on the input to your 5V Arduino, then when there is 6V from your sensor there is 2.5V on your Arduino input. This will give you a half range reading of about 512.

Note if you have a 3V3 Arduino this means your voltage divider needs to provide 3v3 to your Arduino when there is a full scale 12V input from your sensor.

1 Like

0-12V input
.....|
3.48K
....+------- 0-4.8V Output
.....|
2.32K
....|
.GND

The 3.48K and 2.32K are 1% resisters that will give .4 X Vin as an output. Measure the output voltage and multiply by 2.5 to get the input voltage. Assuming a 5 volt reference.

(Does anyone know how to prevent the brain dead editor from removing blanks and screwing up attempts to do a diagram??)

For a sensible answer, we need to know which Arduino or other "compatible" MCU board and the analog reference voltage being used. Also, a minimum R1 value should be used to prevent over current through the input protection diodes in case of circuit fault.

Apart from collapsing blanks, you would need a fixed-pitch font in any editor - use the <CODE> tags

0-12V input
     |
     \
     /
     \   3.48K
     /
     |
     +------- 0-4.8V Output
     |
     \
     /
     \   2.32K
     /
     |
    GND

Or just draw by hand and post a photo or scan:
image

Code tags may help you, but I have no clue what diagram you had in mind.

   0-12V input
      .....|
         3.48K
       ....+------- 0-4.8V Output
      .....|
         2.32K
       ....|
         .GND

Forget the BD editor, use a real text editor.

schem.txt (82 Bytes)

It's not just the editor - you need to post it as <CODE> to preserve the layout

Back in the bad old days we had potentiometers - very handy for something like this.

image

You can stop it trying to syntax-highlight by specifying text after the 3 back-ticks:
image

See post #11

Don't do those ascii dwgs in the text window -- use the code tags area.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.