Can’t get 5.0v from Arduino Output

Hello, I am a high school student trying to use an Arduino in my engineering class. I am running a basic 2 limit switch setup where on a breadboard if one limit switch is triggered, it sends an input signal to the Arduino where it does it’s logic then sends an output back to the board where it triggers LEDs. The same goes for the other limit switch. I’ve ran into a problem with the Arduino output pins however, one of the output pins are only sending 4.6v when triggered, and the other at 0.3v. I’ve been trying to research why and still can’t find a solution along with my engineering teacher not knowing what the problem is.

Here’s a list of things I’ve already tried:

  • Swapping out resistors
  • Swapping out limit switches
  • Trying a new breadboard
  • Trying out a new Arduino Uno
  • Using direct 5.0v input source instead of USB power
  • Pins should be correctly labeled as input/output in Arduino code

Honestly I’m at a complete loss at what to try next and I can’t find much other help online, let me know if you have any ideas to try out.

Logic Levels - learn.sparkfun.com

The takeaway is that with silicon gates, the "high" is not the positive supply voltage but slightly lower and the "low" is not ground but slightly higher.

CMOS - Wikipedia

And that’s fine for what I need, but when I am trying to output a HIGH from one of my Arduino pins I am getting a reading of 0.3v instead of the around 5.0v that I am looking for. So there might be a problem of it outputting a LOW but I don’t see how that’s possible when in the code I should be sending a HIGH signal, I will send my code in a bit to show what I mean better.

Post a schematic, .3V reads like a junction is being forward biased.

Remove the connections to the pin, does it go high?

I will post the code here

‘’’
#include <Servo.h>
Servo motor1;
Servo motor2;

int motorPinYellow = 4;
int motorPinGreen = 2;

int motorMaxForward = 6;
int motorSlowForward = 89;
int motorMaxReverse = 141;
int motorSlowReverse = 97;
int motorStop = 00;

int motor1Speed = 0;
int motor2Speed = 0;

void setup()
{
Serial.begin(9600);

//set up the serial monitor
pinMode(3, INPUT);
pinMode(5, OUTPUT);
digitalWrite(5, LOW);
//First LMS

pinMode(9, INPUT);
pinMode(11, OUTPUT);
digitalWrite(11, LOW);
//Second LMS

pinMode(motorPinYellow, OUTPUT);
pinMode(motorPinGreen, OUTPUT);
motor1.attach(motorPinGreen);
motor2.attach(motorPinYellow);
//Speed Controller Pins

Serial.println("Test");
}

void loop()
{
// motor.write(motorSlowForward);
motor1.write(motor1Speed);
motor2.write(motor2Speed);
if (digitalRead(3) == LOW) {
digitalWrite(5, HIGH);
motor2Speed = 0;
motor1Speed = 75;
}
if (digitalRead(9) == LOW) {
digitalWrite(11, HIGH);
motor1Speed = 0;
motor2Speed = 75;
}
else {
digitalWrite(5, LOW);
digitalWrite(11, LOW);
motor1Speed = 0;
motor2Speed = 0;
}
}
‘’’

There is some motor stuff involving a speed controller that (should be) unrelated to the problem as all the testing is without it, for the first limit switch that applies to the second I am digitalReading off of the pin that is connected to the limit switch which I know works, then does it’s logic and then should be writing to the board with digitalWrite(5, HIGH). I just came back to the lab and am about to go on spring break, but with the tests I did I found that taking the limit switch signal wire and testing the voltage of that with the written wire coming out of the Arduino on my limit switch labeled “Second LMS” is giving me the full 5.0v I need, meaning it’s not a problem with the board there. But on the second one, I am using the exact same setup but this time when I am triggering the switch I am getting 0.03v this time instead of the 0.3v and I can see the LED I hooked up to it barely turning on. What should be attached is a map of the second limit switch and the board.

It is possible if you are trying to draw too much current out of the pin. The pin can only supply so much current and when it is asked to supply more the output voltage simply drops. But a real engineering teacher should know this.

What we need is a proper schematic of what you have, hand drawn is fine Fritzing is not.

Your wordsalad is confusing.
And I don't see anything connected to pin 2 and 4.
Leo..

Hello
How do you are supply the servos with power?

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