DigitalWrite example

Hi All,

I tried the digitalwrite example

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
}

thanks, Sean

You should see either 0V or 5V (or if its a 3.3V board, 0V or 3.3V).

Most multimeters cannot react fast enough, change the delays to 5000.

You should see the pin 13 led blink. It should be bright even through the on-board resistor. Voltage you measure will be affected by that circuit.

Voltage you measure will be affected by that circuit.

With Uno Rev 3, D13 is buffered before driving the LED - so D13 output should be close to 0/5V.

Hii !

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 ?

void setup() {

pinMode(8, OUTPUT);
}

void loop() {

digitalWrite(8, HIGH);
delay(3000);
digitalWrite(8, LOW);
delay(1000);
}

Thank you.

nardinou:
Hii !

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 ?

void setup() {

pinMode(8, OUTPUT);
}

void loop() {

digitalWrite(8, HIGH);
delay(3000);
digitalWrite(8, LOW);
delay(1000);
}

Thank you.

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.