#Question about wiring and how it impacts power supply.

22 messages · Page 1 of 1 (latest)

ocean basalt
#

Hi All. I have made the circuit in the screenshot from tinkercad attached. It is part of an Iron Man Torso and face plate "Wall art" peice I am making.

Clearly there are a lot of cables needed and instead of trying to make multiple GND cables and Power cables go to the arduino I thought I could do one cable for GND and one for Power from the arduino to a PCB board and then all the Neopixels and the PIR sensor could go to the same PCB board. (You can see what I was thinking from the photo).

But when I did that the Neopixels didnt light up white and instead would only light up red before some of them started to go off. So I then decided to join all the appropriate cables off the PCB, despite the cable jungle it caused. When I connected to the power bank the neopixels behaved as they should do.

So does using a PCB the way I did hinder the power flow? Or is it an indication of poor soldering? I am very very much new to all of this so apologies if I am not using the correct terms.

Thanks for any help.

Josh

pine vaultBOT
#

Hey @ocean basalt, thank you for contributing to this forum.
Please provide as much information (images, video, description) as you can. This will increase the chance that someone can help you with your issue.
Use the Close button when your issue is resolved.

lament ember
#

There are a few considerations to take into account here. Tinkercad is a great tool for "simulation" , however it does not account for things link:

  • Wire gauge
  • Distance / path of connections
  • Differences in components, not all manufacturers have the same "specs" for their parts. For example the neo-pixel type LEDs
  • Type of power source being used (it assumes your power source is "perfect and in spec")

With all that being said, it is a good tool to get the concept of the circuit, design, and point you in the right direction.

For your particular design, to try and answer some of your questions:

  • Yes, you can wire up a "test" PCB as a "distribution" type setup. Where you connect 1 set of power in wires "Positive + / Negative -" and then feed your other components from it , instead of tying everything back at the Arduino. However based on the number of components you plan to attach -or- the amount of power they need, it requires configuring the PCB a certain way.

  • The 3v & 5v ports on the Arduino Uno / Nano itself are not really designed to power components. They are used for low power sensors and things that don't draw a high current. So the PIR sensor "may" be ok to power from the Arduino. **The Neo-pixels definitely need to be powered direct from the Power bank and not the Arduino 5v pin ** They use a considerable amount of current when in use and based on the brightness and colors selected. Attempting to power them from the 5v Pin can have several negative impacts such as: Not-working, partial functionality, or worst case damaging the Arduino itself.

#
  • For programming the Arduino , and simple testing with nothing that needs a lot of current / power. It is ok to use the USB Port on the Arduino. However, once the programming / testing is done, you should power the Arduino using the USB port, doing this "bypasses" the voltage regulator on the Arduino and can damage the microcontroller if anything connected to the Arduino tries to draw/use a large amount of current. What you should use is your power source connected to the "vin" and " Gnd" connections on the Arduino, this utilizes the on-board voltage regulator.
#
  • So your circuit would operate something like this:

5v USB power bank Positive (Red Wire) and Negative (Black Wire) will connect to you Arduino "Vin" (Red wire) and "Gnd" (Black Wire).

The Neo-Pixel "Positve" wire should connect directly to the same "Positive /Vin" as the Arduino" As long as you are using a 5v Power source, the GND / negative wire from the neo-pixels can attach to GNd (black wire) coming from the power bank. So to summarize the USB powerbank will provide +5v & Gnd to the Arduino and Neo-pixels.

The Signal Wire "D" from the Neo-Pixels connect to your Arduino.

The LED's (as long as you don't use more than about 2 per pin on the Arduino) should be ok the way you have them.

The PIR sensor should be ok the way you have it, as long as it operates at 3v (40mA) Max. Not sure what the requirements are for the PIR sensor you are using, you should be able to find a spec sheet for it or some documentation. If it is a 5V PIR, again it should be ok to use on the 5v PIN as long as it's current requirement is not more than 40mA (.04A)

Basically the 3v port can safely handle about .12 Watts of power , and the 5v port can safely handle .20 Watts of power

#

Here is a spec / diagram sheet of an Arduino Nano for example. Review it carefully it specifies the amount of current the board can handle total and per pin. Since both the Nano and the Uno use an ATMEGA328p processor the information is generally the same. You can also search online and find the same diagam for an Arduino UNO.

ocean basalt
ocean basalt
#

Hi. So I have completed the wiring as per the guidance. Thanks again. Four of the five neopixels light up but the last one in the chain wont. It is connected to the 5v and GND of the Neopixel before it in the chain and also there is a wire from the data out of that neopixel to the data in of the final non working neo pixel. I have checked and resoldered all the wires. I have even swapped out the neopixel that didnt light for a new one. But still won't work. I am using a Portable Power battery pack. See below. Can anyone point me in the right direction to get this last one in the chain working? thanks
Input: 5V 1000mA
Output: 5V 1000mA
powered by Veho
Battery type: Polymer Li-lon
Capacity: 3700mAh@3.7V

tender pecan
#

Are you using zero based indexing in your code?

ocean basalt
#

Hi. this is the code that works on tinkercad for all five neopixel jewels and it is working for the first 4 in real life. posted in 2 parts. part 1 #include <Adafruit_NeoPixel.h>

#define PIN 6 // Pin where the first NeoPixel Jewel is connected
#define JEWEL_PIXELS 7 // Number of pixels per NeoPixel Jewel
#define NUMPIXELS (5 * JEWEL_PIXELS) // Total number of NeoPixels (5 Jewels with 7 pixels each)

#define PIR_PIN 2 // Pin where PIR sensor is connected
#define LED_PIN12 12 // Pin where the single LED is connected

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
pixels.begin(); // Initialize the NeoPixels
pinMode(LED_PIN12, OUTPUT); // Initialize the LED pin as output
pinMode(PIR_PIN, INPUT); // Initialize the PIR sensor pin as input
}

#

Part 2. void loop() {
if (digitalRead(PIR_PIN) == HIGH) { // Check if PIR sensor detects motion
// Define flicker durations
int durations[3] = {100, 120, 144}; // Initial duration and 20% longer for each set

// Flicker the NeoPixels 3 times in 3 sets with increasing durations
for (int set = 0; set < 3; set++) {
  for (int i = 0; i < 3; i++) {
    for (int p = 0; p < NUMPIXELS; p++) {
      pixels.setPixelColor(p, pixels.Color(255, 255, 255));  // Set color to white
    }
    pixels.show();
    delay(durations[set]);
    for (int p = 0; p < NUMPIXELS; p++) {
      pixels.setPixelColor(p, pixels.Color(0, 0, 0));  // Turn off
    }
    pixels.show();
    delay(durations[set]);
  }
}

// Gradually increase NeoPixel brightness over 7 seconds
for (int brightness = 0; brightness <= 255; brightness++) {
  for (int p = 0; p < NUMPIXELS; p++) {
    pixels.setPixelColor(p, pixels.Color(brightness, brightness, brightness));  // White with increasing brightness
  }
  pixels.show();
  delay(27);  // 7000 milliseconds / 256 steps ≈ 27 milliseconds per step
}

// Turn on the single LED permanently
digitalWrite(LED_PIN12, HIGH);

// Wait for 3 minutes
delay(180000);  // 180000 milliseconds = 3 minutes

// Turn off the NeoPixels and LED
for (int p = 0; p < NUMPIXELS; p++) {
  pixels.setPixelColor(p, pixels.Color(0, 0, 0));  // Turn off
}
pixels.show();
digitalWrite(LED_PIN12, LOW);

// Wait for PIR sensor to reset
while (digitalRead(PIR_PIN) == HIGH) {
  delay(50);  // Small delay to prevent rapid looping
}

}
}

tender pecan
#

Maybe try a simple test function like the following just to see if all the pixels light up?

void pixelsTest() {
  pixels.begin();
  for (int i = 0; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(255, 0, 0)); // Set each pixel to red
    pixels.show();
    delay(500); // Wait for 500 milliseconds
    pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Turn off each pixel
  }
}
#

Also, double check what model of pixels you have. For example there are WS2812 and WS2812B

ocean basalt
#

Thanks. so the neopixels on each jewel lit up 1 by 1 before moving the the next jewel. all worked apart from the last one . checking model numbers now. thanks

tender pecan
#

Depending on what model you have, you'll want to change this line of code:
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

ocean basalt
tender pecan
#

The enums NEO_GRB and NEO_GRBW are used in Adafruit NeoPixel library to specify the color order of the LEDs in a strip or array. Here's a detailed explanation of the differences between the two:

NEO_GRB (Green-Red-Blue):

  • This enum specifies that each LED in the strip has three color components: Green, Red, and Blue.
  • The data for each LED is sent in the order of Green first, then Red, and finally Blue.
  • This is a common color order for RGB LED strips.
  • Usage: Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

NEO_GRBW (Green-Red-Blue-White):

  • This enum specifies that each LED in the strip has four color components: Green, Red, Blue, and White.
  • The data for each LED is sent in the order of Green first, then Red, Blue, and finally White.
  • This type of LED strip includes an additional white LED for improved color rendering and brightness control. It allows for a broader range of color mixing and more natural white light.
  • Usage: Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);

Key Differences:

  • Color Components: NEO_GRB has three color components (G, R, B), while NEO_GRBW has four (G, R, B, W).
  • Color Order: Both enums specify the order in which color data should be sent to the LEDs.
  • White LED: NEO_GRBW includes a separate white LED component, which allows for better white light and color mixing, whereas NEO_GRB does not have a separate white LED.

In summary, use NEO_GRB for standard RGB LED strips and NEO_GRBW for RGBW LED strips where you need an additional white LED for better color control and brightness.

ocean basalt
#

Thanks again. Much appreciated.

lament ember
#

Yeah.. what he said.

ocean basalt
#

Thanks to both of you this is now working. Built from spare peices I had printed. The motion sensor activates the ARC and body lights first and then the eyes. Next steps are to mount it on a frame and then see if I can get it on the wall in the house without my wife rugby tackling me to the ground first. ironman2