0

My code is designed to play a tone when ever pin 3 is high on my Arduino. When I am examine the pins voltage with a multimeter it is always reading below 1 volt. When I examined the voltage off of a osiliscope it is reading the voltage pretty steady at 0.2 to 0.3.

My multimeter reads at 0.26

:

My code is:

void setup() {
 // put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
 // put your main code here, to run repeatedly:
int input = digitalRead(3);
Serial.println(input);
if(input == 1){
 tone(A5,4000);
 }
}

My board looks like: enter image description here The bottom of the board looks like: enter image description here

asked Aug 13, 2015 at 3:03
1
  • What pin are you measuring exactly? Pin 3 or pin A5? Is there a resistor in series with that LED? Is there a pull-up or pull-down resistor on pin 3? See Switches Tutorial. Commented Aug 13, 2015 at 3:33

1 Answer 1

1

You left pin 3 floating. The multimeter will lower the voltage, resulting the the led lighting. Try enabling the pull-up resistor in pin 3 by adding pinMode(3, INPUT_PULLUP).

PS you might want to add a resistor in series with that led, or it will burn out and/or damage pin 3 on the arduino.

answered Aug 13, 2015 at 8:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.