Pages: [1]   Go Down
Author Topic: Arduino uno I/O pins output are 4.2v not 5v  (Read 1279 times)
0 Members and 1 Guest are viewing this topic.
Sulaymaniyah-Kurdistan-Iraq
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
stay foolish - stay hungry
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi there
i have a problem with arduino when i checked output of digital pin it gave me 4.2v instead of 5v, and i need 5v,any solution?
i don't know what is wrong, thanks for helping!
best regards
Logged

Offline Offline
Faraday Member
**
Karma: 67
Posts: 2691
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To help us help, we need to see the sketch you are using and a schematic of your project.
Do all the digital pins have the same problem?
Logged

The way you have it in your schematic isn't the same as how you have it wired up!

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 626
Posts: 34152
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Normally people forget to set them to be outputs when they complain of this.
Logged

Sulaymaniyah-Kurdistan-Iraq
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
stay foolish - stay hungry
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, all pins have the same problem and here the sketch:
Code:
int pin1= 11;
int pin2= 12;
int pin3= 13;
int counter = 0;
void setup(){
 Serial.begin(9600);
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT); 
  pinMode(pin3, OUTPUT);
 
}
 void loop() {
   int input = Serial.read();
   
   if (input == '3') {
      if (counter == 0) {
      Serial.print("on");
    analogWrite(pin3, 255);
     delay(5000);
      counter++;
      input = 0;
      }
   }
    if (input == '4') {
      if (counter == 0) {
     digitalWrite(pin3, LOW);
     Serial.print("low");
     counter++;
     input = 0;
      }
   }
    if (input == '1') {
       if (counter == 0) {
      Serial.print("1");
     digitalWrite(pin1, HIGH);
     
     delay(150);
      digitalWrite(pin1, LOW);
       counter++;
       input = 0;
       }
   }
    if (input == '2') {
       if (counter == 0) {
      Serial.print("2");
     digitalWrite(pin2, HIGH);
     delay(50);
      digitalWrite(pin2, LOW);
      delay(50);
      digitalWrite(pin2, HIGH);
     delay(50);
      digitalWrite(pin2, LOW);
       counter++;
       input = 0;
       
       }
       
   }
   counter = 0;
   }
   
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, all pins have the same problem and here the sketch:
Code:
int pin1= 11;
int pin2= 12;
int pin3= 13;
int counter = 0;
void setup(){
 Serial.begin(9600);
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT); 
  pinMode(pin3, OUTPUT);
 
}
 void loop() {
   int input = Serial.read();
   
   if (input == '3') {
      if (counter == 0) {
      Serial.print("on");
    analogWrite(pin3, 255);
     delay(5000);
      counter++;
      input = 0;
      }
   }
    if (input == '4') {
      if (counter == 0) {
     digitalWrite(pin3, LOW);
     Serial.print("low");
     counter++;
     input = 0;
      }
   }
    if (input == '1') {
       if (counter == 0) {
      Serial.print("1");
     digitalWrite(pin1, HIGH);
     
     delay(150);
      digitalWrite(pin1, LOW);
       counter++;
       input = 0;
       }
   }
    if (input == '2') {
       if (counter == 0) {
      Serial.print("2");
     digitalWrite(pin2, HIGH);
     delay(50);
      digitalWrite(pin2, LOW);
      delay(50);
      digitalWrite(pin2, HIGH);
     delay(50);
      digitalWrite(pin2, LOW);
       counter++;
       input = 0;
       
       }
       
   }
   counter = 0;
   }
   

Ok a few questions:

How are you trying to measure the output voltage of the pins in question. As your turning them on and off a pretty quickly a digital volt meter is sure to not give an accurate measurement.

Do you have anything wired to the output pins in question? If so what?

Have you measured the arduino 5V shield pin with a good voltmeter? If so what does it measure at.


Lefty
Logged

Sulaymaniyah-Kurdistan-Iraq
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
stay foolish - stay hungry
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i make one pin output and take out by a jumper wire then measure it by mutlimeter.
i connect them relay and they can't swith the relay but when i connect directly the relay to 5+ it switch.
before i did this and there was no problem//
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i make one pin output and take out by a jumper wire then measure it by mutlimeter.
i connect them relay and they can't swith the relay but when i connect directly the relay to 5+ it switch.
before i did this and there was no problem//

Can you just answer my questions, one at a time that I listed below?

Lefty
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

4.2 is within spec:
See Section 29
VOH Output High Voltage(3),  IOH = -20 mA, VCC = 5V:  4.2V

Note (3):
Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
ATmega48A/PA/88A/PA/168A/PA/328/P:
1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
greater than the listed test condition.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3018
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You would be pushing your luck to have an arduino digital output drive a relay,  unless it
is some kind of special relay with a very low input requirement.

Make a circuit with a transistor to drive the relay.
Logged

Pages: [1]   Go Up
Jump to: