Digital pin shows 1.5V - 2.5V instead of 5V

Hi everybody,

I have an Arduino Uno and I power it via my laptop's 5v usb, then I use (Analog Voltage Meter) to check the power voltage of digital pin 7
pinMode(7 , OUTPUT)
digitalWrite(7, HIGH);
I expected it to be 5V but it only shows 1.5V - 2.5V? (Other digital pins have the same value as digital pin 7)
I don't know why, can Anyone explain to me? how can i get exactly 5V from the digital pins?


(as shown below) I also want to know, is there a way to set a high (on) or low (off) value for the pin 3.3V pin, Pin 5V , Pin Vin to power an external device similar to the digital pin or not?
s0gj1M3qEo

Anyone can help me, I appreciate your help.

Thank you.

Louis

Please post a minimal but complete sketch which demonstrates this.

EDIT: Also show where, exactly, you attached your meter probes when measuring.

No - they are fixed by the hardware.

1 Like

You cannot control the power pins (3.3V, 5V, Vin) programmatically.

Vin is not a power output.

Those measurements are done with a DMM (Digital MultiMeter)?

So all of the digital pins read 1.5V to 2.5V when the Arduino is powered with the USB port? Are those measurements are made between the pin and a ground pin with a DMM?

What does the 5V pin read (with respect to ground) with your DMM?

2 Likes

@bvn63 - also, what does the 3.3V pin read (with respect to ground) with your DMM?

What do you mean by that? Is it varying between 1.5V and 2.5V?

I am assuming the meter is set for dC. Measure the voltage of a known good battery with your meter and see what the voltage is. If that matches the battery rating your meter is probably ok. If not your Arduino is probably OK.

1 Like

I suggest you give this a read.

Next, taken from the link:

Write a HIGH or a LOW value to a digital pin.

If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.

If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal pullup on the input pin. It is recommended to set the pinMode() to INPUT_PULLUP to enable the internal pull-up resistor. See the Digital Pins tutorial for more information.

If you do not set the pinMode() to OUTPUT, and connect an LED to a pin, when calling digitalWrite(HIGH), the LED may appear dim. Without explicitly setting pinMode(), digitalWrite() will have enabled the internal pull-up resistor, which acts like a large current-limiting resistor.

Finally this would go much better if you posted your code using appropriate code tags. I have no idea what your objective is? Details do matter.

Ron

1 Like

Hi all,

Thanks for your help, here is my basic sketch

int led = 7;
void setup() {
  pinMode(led, OUTPUT);
  Serial.begin(9600);
} 

void loop() {
  digitalWrite(led, HIGH); 
  delay(5000);                      
 digitalWrite(led, LOW);   
 delay(5000);                 

}

After checking again this morning. I discovered that my usb cable does not have enough 5V when connected to a USB HUB (there are many devices connected to it such as mouse, keyboard, printer cable, USB Stick) and I tried connecting to the usb port on the back of PC and I checked the voltage of digital pin 7 again and it showed ~5V as expected.

Thank you again.

Louis.

Is it a powered Hub?

If not, then get one!

Yes, here is its image

Then there must be something seriously wrong!

A USB port should certainly be able to supply sufficient power to a bare Arduino UNO board.

Or do you have some other stuff connected to your board that you haven't told us about...?

EDIT

Did you use the same cable when you plugged it direct into the PC?

Blockquote
A USB port should certainly be able to supply sufficient power to a bare Arduino UNO board.

Or do you have some other stuff connected to your board that you haven't told us about...?

I think this usb hub is too old (I bought it 5--6 years ago) and has hardware related error, sometimes it doesn't recognize usb stick or Cisco USB Console Cable,...

Blockquote

Did you use the same cable when you plugged it direct into the PC? << Yes

Or do you have too much connected to the HUB.
What is its current rating of the hub and the rating of the power supply connected to it.

What is the output voltage of the HUB?

Tom... :grinning: :+1: :coffee: :australia:

1 Like

So things work as advertised. :slight_smile: Any problem was power to the board and not the board.

Glad it is working.

Ron

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.