# Arduino output pin from 5V to 3.3V

I just have a question regarding Arduino output-pins and Voltage divider, because I am getting other results than what my calculations are giving me.

I have measured the output-pin (from the Arduino) at 4.74V, according to my caulculations I will have and output voltage of 3.39V, with R1 = 4k ohm and R2 = 10k ohm, but when I use my multimeter to measure I read a voltage of 0.97V.

I have tested with a 9V battery, measured to 8.72V. With the same resistors, the calculations gives me 6.23V as output, when I use my multimeter I can read a output of 6.21 which I consider as ok.

So my question is, why is my output from the Arduino only 0.97V with the voltage divider?

For information: I am using Arduino OSEPP Uno R3 Plus.

Hope someone can give me helpfull information.

***************************************update********************************************

My code:

``````int echoPin = 7;
int trigPin = 6;

int SignalPin = 10;

void setup(){

pinMode(echoPin, INPUT);
pinMode(trigPin, OUTPUT);

}

void loop(){

float distanceCentimeters;
int pulseLenMicroseconds;

digitalWrite(trigPin, LOW);
delayMicroseconds(20);
digitalWrite(trigPin, HIGH);
delayMicroseconds(100);
digitalWrite(trigPin, LOW);

pulseLenMicroseconds = pulseIn(echoPin, HIGH);

distanceCentimeters = pulseLenMicroseconds / 29.387 / 2;

if(distanceCentimeters <= 35 && distanceCentimeters >= 10){

digitalWrite(SignalPin, HIGH);

} else {

digitalWrite(SignalPin, LOW);

}

delay(400);

}
``````

Image of the setup (not with Raspberry Pi).

• 4kohm is a strange value. Are you sure about it? Oct 2, 2014 at 21:40
• Are you sure the Arduino pin is actually driven as an output, rather than being an input with the internal pull-up active? Your measured .97 V could be a result of your resistive divider being fed through about 35K ohms of internal resistance, which is a quite plausible value for the effective resistance of the "weak" internal pull-up feature. You can tell by measuring the voltage at the high side of R1 - with an output, this should still be close to 5v, but with a pull-up it will may be only slightly higher than the low side of R1. Oct 2, 2014 at 22:02
• I assume you are planning to connect to something using 3.3V. A resistive divider is a poor solution. It may be OK for a high impedance connection, but you would be better to use other solutions e.g. Series resistor and diode clamp. Oct 3, 2014 at 2:10
• Thank you guys for answering and giving useful information! I have updated the post with my code and a picture of the connection. Thought that would be more helpful. I have measured the R1, and its high side is slightly higher than the low side.I am going to connect it to a Raspberry Pi, where the GPIO pins have a tolerance of 3.3V. Oct 3, 2014 at 12:14
• If the high side of R1 is only "slightly" higher than the low side, then you do not have the pin configured as an output. Oct 3, 2014 at 14:49

Your code does not configured SignalPin as an output, but only trigPin.

As already explained in comments, your observed voltage is due not really to the voltage divider you constructed, but rather one formed by the "weak" internal pull-up resistance and your external resistors. From your measurement, it appears the value of the weak internal pull-up is about 35K, which is within the range of expectations. That and your 4K external form the top of the divider (39K) while your 10K forms the lower half, yielding about a fifth of the supply voltage.

In some versions of the Arduino library, writing to an input pin enables and disables the internal pull-up resistor, so you could have observed your program seeming to control the pin - but at minimal drive strength.

To get the desired behavior, you merely need to add

``````pinMode(SignalPin, OUTPUT);
``````
• I got one more question, and I don´t expect an answer since it´s towards the RPi. I have written a program that should write out a text if the GPIO-pin is high or low. I have tested it with a button an the RPi´s own 3.3V output-pin. When I press the button it changes. But when I use the Signalpin from the Arduino it does not change at all. The pin has 3.24V now, same as I get with the RPi 3.3V pin. Do you have any idea what it could be? Oct 3, 2014 at 16:56
• Try putting several seconds of delay after setting the output pin state, to make sure the pi has ample time to see it. Of course that is excessive, but you could see see if you can use an interrupt mode on the pi. Note the existence of raspberrypi.stackexchange.com if your challenges become mostly about the pi; right now it's not clear which end the problem is on. Oct 3, 2014 at 17:40
• `Signalpin from the Arduino` would be 5V. How are you giving it to the 3.3V Pi?
– xyz
Oct 4, 2014 at 16:58
• That's the purpose of the resistive divider. In practice, the 4k series resistance will probably do the job by itself, though slew rate will be limited with this high an impedance. Oct 4, 2014 at 17:02
• Did not have time to test this before, but now I have. Have set the delay for some seconds, but still nothing happens. The program on the Pi is working fin with the button and using its own 3.3V pin (measuring it to 3.24). I measure the Arduino output-pin to 3.26V but the program is not registering any changes. Have also test with placing a object in front of the sensor so the output stays at 3.26V, but nothing happens. Can it be related to the current? Oct 4, 2014 at 18:10