Uno Pins Outputting Different Voltages?

I am working on a project that has 4 different LED outputs on an Arduino Uno. My code works fine, all of the LEDs are properly configured as outputs, but I get different voltages from the pins. Pins 6 and 7 are outputting the usual 5V, but 4 and 5 are much lower. I have tested the wires coming out of the Arduino and switched around LEDs and all of the physical parts work fine. I was hoping someone here has experienced this problem before and could help me out.

We can't see your code.
We can't see your schematic.

Do you see the problem?

#include "nRF24L01.h" // NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include "RF24.h"
#include "SPI.h"

#define TouchLeft 4
#define BellLeft 5
#define BellRight 6
#define TouchRight 7

int ReceivedMessage[1] = {000}; // Used to store value received by the NRF24L01
RF24 radio(9,10); // NRF24L01 SPI pins. Pin 9 and 10 on the Nano

const uint64_t pipe = 0xE6E6E6E6E6E6; // Needs to be the same for communicating between 2 NRF24L01 

void setup(void)
{
  radio.begin(); // Start the NRF24L01
  
  radio.openReadingPipe(1,pipe); // Get NRF24L01 ready to receive
  
  radio.startListening(); // Listen to see if information received
  
  pinMode(TouchRight, OUTPUT);
  pinMode(BellRight, OUTPUT);
  pinMode(BellLeft, OUTPUT);
  pinMode(TouchLeft, OUTPUT);
}

void loop(void)
{
  while (radio.available())
  {
    radio.read(ReceivedMessage, 1); // Read information from the NRF24L01

    if (ReceivedMessage[0] == 110) // Indicates switch is pressed
    {
      digitalWrite(BellLeft, HIGH);
    }
    else if (ReceivedMessage[0] == 111)
    {
      digitalWrite(TouchLeft, HIGH);
    }
    if (ReceivedMessage[0] == 100) // Indicates switch is pressed
    {
      digitalWrite(BellRight, HIGH);
    }
    else if (ReceivedMessage[0] == 011)
    {
      digitalWrite(TouchRight, HIGH);
    }
    else
    
    {
       digitalWrite(TouchLeft, LOW);
       digitalWrite(BellLeft, LOW);
       digitalWrite(BellRight, LOW);
       digitalWrite(TouchRight, LOW);
    }
    delay(2);
   }
}

Why octal?

When I started I wasn't entirely sure how to use the wireless module so I kept it as 3 digits, but I thought it was binary. Does that change anything?

Try it and see with just a Serial.print( 011 ) to see what you get.
What value current limiting resistors (if any) are you using with the leds ?

In C and C++ integer constants are notated like this:

10 is 10
010 is 8 (leading zero means octal)
0b10 is 2 (0b prefix means binary)
0x10 is 16 (0x prefix means hexadecimal).

You have included series resistors for the LEDs I hope - missing those would cause heavy currents and the output voltage to droop.

1 Like

I am using 220 ohm resistors

See reply #2

The LEDs are all wired into the same ground line on a breadboard, but I don't have any more open ground ports on the Arduino. I also tried taking out the 2 LEDs that work, and the other 2 LEDs still had low voltages

Please

Show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.

With the 'else' missing it will turn on a left light if the input is 110 or 111 but immediately turn it off again since the 110 or 111 input is not 100 or 011 (decimal 9).


Tinkercad Schmematic
Sorry for the late response, I ran out of time while I was working and didn't have a chance to finish up the schematic or take a picture. Here is what I have so far, the Piezo buzzer isn't plugged in yet, but I do have a plan to.

What does the code look like now?

#include "nRF24L01.h" // NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include "RF24.h"
#include "SPI.h"

#define TouchLeft 4
#define BellLeft 5
#define BellRight 6
#define TouchRight 7

int ReceivedMessage[1] = {000}; // Used to store value received by the NRF24L01
RF24 radio(9,10); // NRF24L01 SPI pins. Pin 9 and 10 on the Nano

const uint64_t pipe = 0xE6E6E6E6E6E6; // Needs to be the same for communicating between 2 NRF24L01 

void setup(void)
{
  radio.begin(); // Start the NRF24L01
  
  radio.openReadingPipe(1,pipe); // Get NRF24L01 ready to receive
  
  radio.startListening(); // Listen to see if information received
  
  pinMode(TouchRight, OUTPUT);
  pinMode(BellRight, OUTPUT);
  pinMode(BellLeft, OUTPUT);
  pinMode(TouchLeft, OUTPUT);
}

void loop(void)
{
  while (radio.available())
  {
    radio.read(ReceivedMessage, 1); // Read information from the NRF24L01

    if (ReceivedMessage[0] == 110) // Indicates switch is pressed
    {
      digitalWrite(BellLeft, HIGH);
    }
    else if (ReceivedMessage[0] == 111)
    {
      digitalWrite(TouchLeft, HIGH);
    }
    else if (ReceivedMessage[0] == 100) // Indicates switch is pressed
    {
      digitalWrite(BellRight, HIGH);
    }
    else if (ReceivedMessage[0] == 11)
    {
      digitalWrite(TouchRight, HIGH);
    }
    else
    
    {
       digitalWrite(TouchLeft, LOW);
       digitalWrite(BellLeft, LOW);
       digitalWrite(BellRight, LOW);
       digitalWrite(TouchRight, LOW);
    }
    delay(2);
   }
}

NRF24L01
Arduino Uno
Everything else in the circuit is just your standard LED, resistors, and breadboard

I reuploaded the code a couple times and the problem stopped. Also without octal the wireless modules did not work.

Maybe your criteria or observations and expectations were incorrect.
That seems more likely.

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