Voltage divider 5v to 3.3v

Hi all, hopefully a quick one...

I have a number of 5v sensors in a car that I wish to read using my teensy 3.2. It can withstand a 5v input but only reads to 3.3, so my plan is to use a voltage divider with a 1k and 2k resistor like this (input on the top, output on the bottom):

voltage div.JPG

My question is, is it worth increasing the resistance to limit the current coming into the arduino, or with 1 and 2k be enough? I was recommended previously to use an inline 30k resistor for other inputs to limit an damage potential in an auto environment.

The other question is, is it worth using a small cap (0.1uF to smooth the signal coming in without so much code...? If so, where would one connect it?

voltage div.JPG

1 Like

There's no exact answer to this but my rule of thumb would be to use 10k as the bottom resistor and make the top resistor whatever it needs to be for the input voltage.

That said, I don't think you'll have a problem with the resistor values you are thinking of using.

he other question is, is it worth using a small cap (0.1uF to smooth the signal coming in without so much code...? If so, where would one connect it?

Yes connect it between the input pin and ground. Make sure it is a ceramic type.

I tend to use lower resistor values in the order of 1K to increase the speed of the signal it can pass.

to limit the current coming into the arduino

The input current into an input pin of the Arduino is what engineers call "bugger all", this is not affected by the potential divider values.

I was recommended previously to use an inline 30k resistor for other inputs to limit an damage potential in an auto environment.

This is a bit unscientific but the thinking is that if you get over voltage spikes on your signal due to interferance pickups mainly from spark plugs even after the potential divider then this might limit the current as the ESD protection diodes start to conduct. However the current on these is not specified as they are not designed to do this job. Therefore there is no way to work out a "safe" value. The capacitors should mop up these spikes anyway.

You didn't say if the sensors are analog or digital, and if digital what speed you need them to work at.

For a digital signal the divider resistor values will affect the maximum speed, lower is faster (within reason).

For analog using a capacitor to filter noise is often valuable, also for slower digital signals a small amount of
capacitance is useful (too much will cause problems though, digital signals should slew rapidly).

1k:2k would be suitable for fast digital signals, for analog 10k:20k is normally adequate, with capacitor of 10nF or so typically.

Very large resistor values will reduce analog accuracy unless the capacitor is large (100nF or more)

Thank you guys, I think I will go with 1 and 2k and since I'm already using them on my BOM, 100nF caps (ceramic). My sensors I think will all be analog (thermistors mainly)

Grumpy_Mike:
Yes connect it between the input pin and ground. Make sure it is a ceramic type.

So I connect it between input and ground, prior to the resistor like this (input top, arduino pin bottom)

voltage div.JPG

voltage div.JPG

Can’t see from that bit of a picture but it should be from the actual input pin to ground.

My sensors I think will all be analog (thermistors mainly)

You have to be careful that the low resistance the sensor sees in this case just 3K will not overload the sensor.
As MarkT says for those 10K 20k are more normal for those sorts of signals as they don’t change very quickly at all.

Does the thermistor have to run at 5V? If so is anything else reading its output?

Thank you chaps - really appreciate the explanation. I will go then with 10/20k. I will probably just be driving the arduino with these sensors but I want the ability to also plug in other devices if necessary so I'd like to keep them running at 5v.

I'm not 100% clear on which pin the cap goes so I've made 2 drawings to avoid all doubt.

Ex1.png

or 2.
Ex2.png

I think you mean 2 - is this correct?

Ex1.png

Ex2.png

Number 2 is correct, but the way you drew it is so unconventional at first sight I thought it was wrong.

Draw the 10k vertically above the 20K, and draw the wire to the Arduino from the junction of the two resistors. Then draw the capacitor vertically from this wire down to ground.

Like this....

Volt Div.png

Volt Div.png

Yes, but have the wire to the Arduino horizontal and take the kink out of the input signal wire.

I know it sounds a bit nit picky but a good layout does make a schematic much easier to comprehend. Follow the general rules

Positive at the top negative towards the bottom.
Signals come in from the left and go out to the right.
Have as few wire crossings as possible. One way to do this is not to have the pins on an IC follow the physical order of the pins but put the pin number so as to make the wiring easy. Label all the pins with the PIN number and the function like the data sheet.
For examples look at the diagrams for my projects here on this site:-
http://www.thebox.myzen.co.uk/Hardware/Dice_Game.html

More conventionally like this:
InputAttenuator.png

InputAttenuator.png

1 Like

450nick:
1.
Ex1.png

or 2.
Ex2.png

I think you mean 2 - is this correct?

Oh guys, I wil have to go to the chiropractor, my neck is completely wrenched trying to read your schematic... :o