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).