Simple Potential Divider Question

All I need to know is if a circuit has power or not its a brake switch in a car when brakes are applied the circuit has 12vish on it. I just need to know when brakes are applied. My plan was to use a potential divider to drop it down to 3.3v as I am using a 3.3v board and read if pin is high or low but I have noticed potential dividers are a little complicated. I don't know what resistors to use two high resistors or two low resistors. If someone could give me some pointers that would be much appreciated. Thanks

Go no go monitoring can be done with opto couplers.

1 Like

There are lots of voltage divider calculators on the net to help you.

Like this one.

Use a value like 10K for R1, 12V for the input voltage and 3.3V for the output voltage. Then, R2 = 3.6K is about the nearest standard 5% value that will give less than 3.3V out.

What would be the difference then doing 680ohm and a 220ohm?

Whether you use a divider or optocoupler you should add a 0.1µF ceramic capacitor very close to the Arduino input pins. This will protect the arduino from the very electrically noisy automotive system.

What would be the difference then doing 680ohm and a 220ohm?

680 Ohm and 220 ohm will work but will needlessly draw more current that needed.

Perfect sounds good

What a mania all of you computer scientists have for using two resistors and eating your heads with unnecessary calculations.
If you were more electronic you would use a trimmer adjusting its output to 3.3v before connecting it to the input pin.
Cheers.
Pd: trimmer value between 10k to 40k.

That 12vish can range from about 8 to 18. Probably using a transistor would be a better solution. Or if you are not comfortable with transistors, you could use something in the range of 27K (not critical) from the brake to the anode of a diode which has the cathode connected to +3V3. Then connect the anode of the diode to the input with a 10K resistor (not critical). A 75V transit would push just under 3mA through the diode. 1/4 watt resistors would be fine.

1 Like

This is what one would call a design decision.

Personally for such a crude need I would use resistors. A pot has the tendency of being noise and perhaps not as stable as two simple resistors.

With just a trimpot it would not be hard to accidentally put over 5.5V (up to the 12V) on an input.

5 Likes

I would use an opto isolator - given the signal may be very noisy too . A relay is another option

Not sure what sort of head you have but if you think calculating two resistors is hard, then my advice to you would be to avoid doing anything with graphics.

2 Likes

Nope.


For 3.3 V, R2 becomes 12k 15k.

for the diodes I have some 1n4001 and 1n914 diodes laying around would one of those work in place of the 1n4148?

1N914's are virtually identical to 1N4148.

Or with cars, for that matter.


Will that work?

FWIW, "The Art of Electronics" strongly advises against this, so I doubt it is appropriate to imply people who want to avoid it just aren't "electronic enough".

Do the math. Max voltage is 15V. Subtract the D2 junction drop, 14.3V. Divide by series resistance (47k + 10k) = 2.51 mA. Voltage in R2 is now IR = 10,000 x 0.00251 = 2.51V.

For a 12V input, it's near 2V. This seems too low to me. Check VthHIGH for the inputs on your device.

Corrected the math in my post #13 to match 14 V input. :grin: