It says that I should see either 3.3V or 5V but instead I am seeing 500mV on an Arduino Uno. Any ideas where I have gone wrong?
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}
I got exactly the same problem : I made a very simple circuit with a buzzer, a 100ohms resistor and my Arduino Uno connected by USB to my laptop.
I tried first to use the tone() function, a really low sound was produced by the buzzer (almost impossible to ear). I analised the signal and i get a 500mv voltage. So i tried to send a digitalWrite(pin_buzzer,high) to the buzzer, still have a 500mv voltage. What goes wrong ?
I got exactly the same problem : I made a very simple circuit with a buzzer, a 100ohms resistor and my Arduino Uno connected by USB to my laptop.
I tried first to use the tone() function, a really low sound was produced by the buzzer (almost impossible to ear). I analised the signal and i get a 500mv voltage. So i tried to send a digitalWrite(pin_buzzer,high) to the buzzer, still have a 500mv voltage. What goes wrong ?
What buzzer are you using? Try measuring the voltage at the pin with the buzzer removed/disconnected.
You can only get so much current out of a port pin If you ask for too much, the voltage at the pin will drop. This is why things like current-limiting resistors are needed for LEDs -- not only to protect the LED but in cases where you're drving it right from a port pin to "protect" the pin too.
If you find the buzzer is drawing too much current and causing the pin voltage to sag, you need to use a different method to drive the buzzer, such as putting a transistor between the port pin and the buzzer.