Electronic – How to calculate series resistor to provide a certain voltage to a pin

resistorsvoltage

I (theoretical physicist, all the basic theory, no further electrical engineering background) am just diving into Arduino and I have a very basic question:

I am playing with a Zilog ePIR motion detector (https://www.sparkfun.com/products/9587) in hardware mode. I would like to use a fixed resistor to supply a voltage of, say 0.2V to Pin 3 (DLY), to set a delay for the motion detection switch-off (the whole thing runs on 3.3V).
From Kirchhoff's voltage law I would think that I need the internal resistance of the module to calculate a ratio with the series resistor. I am getting R = R_Module*(3.3V-0.2V)/0.2V.
However: I don't know any internal resistance, nor can I measure any between GND and DLY.
How do I calculate the needed resistor? Am I thinking totally wrong?

I am using the circuit from http://macherzin.net/article17-Arduino-Sensoren-Infrarot-ePIR
Bonus question: How did the author know that he needs an 80 Ohm resistor if he connects the module to 5V?

Best Answer

If you read the section regarding DLY in the datasheet for your sensor you'll see that it suggests using a simple resistive divider to set the delay. Normally, you want to drive your ADC with a low output impedance compared to your ADC's input impedance. Your resistive dividers output impedance would be R1 || R2 (assuming your voltage source is perfect with no output impedance) - so approximately 580 Ω for the circuit below - this should be OK.

But let's suppose you want to set the delay to 15 min - which corresponds to 1.8V from the datasheet. To drop 1.8 V with the divider, R2 would have to be around 5.6 kΩ. The output impedance would then be 3.5 kΩ. This might cause problems if your ADC's input impedance is just 10 kΩ.

But since the datasheet suggests a resistive divider is OK and also states that the input impedance is high, I think you'll be OK with the following (don't quote me on this, though!)

This means something like this: enter image description here

R2 will drop a voltage of 0.2 V across it. Rest of the voltage (3.3 - 0.2) will be dropped on R1. If your input voltage is 5V instead of 3.3, R2 will have to be around 400 Ohms.

If you do have issues due to the output impedance you can buffer the output of the voltage divider with a unity gain buffer. A unity gain buffer has a very low output impedance and should drive your ADC very well.