Neopixel strip with arduino

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Neopixel strip with arduino

Post by jimreilly »

I recently purchased an Adafruit NeoPixel LED Side Light Strip - Black 60 LED PID: 3636 and am working with one of my students to create a circuit and code to drive. We have not had success so far using some of the references we have found on line. I welcome any suggestions or pointers to a sample circuit and code for an arduino uno that we could use to test basic functionality and use as a starting point for programming different functions and colors for the neoPixel strip.
To begin we are trying to get confirmation the neopixel strip is actually working and not damaged.
thank you,
jim

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel strip with arduino

Post by adafruit_support_bill »

This guide is the best place to start. It covers wiring powering and code for the Neopixels:
https://learn.adafruit.com/adafruit-neopixel-uberguide

The Arduino specific coding section starts here:
https://learn.adafruit.com/adafruit-neo ... stallation
The "Strandtest" example included with the library is the best way to determine if the strip is connected properly and functional.

User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Re: Neopixel strip with arduino

Post by jimreilly »

We have tried following the information and strandtest code in the uberguide. Unfortunately we have not gotten any led's to light on our strip. We have tried to verify the circuit and see 5V at the start of the strip and also at the end of the strip. On pin 6 of the arduino which is connected to Din we see voltage vary but only slightly, 8-15mV, whil it settles to ~0 once code completes.

We also tried simplifying the code to only use a single loop to fill all 60 LEDs with green and use the NeoPixel.setPixelColor followed by NeoPixel.show commands from the Adafruit_NeoPixel.h library. Again none of the LEDs light up.

We are novices at this but looking for some basic to confirm how we connect and get code to light up even one LED in our strip.
Welcome any suggestions...
jim

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel strip with arduino

Post by adafruit_support_bill »

Please post some photos showing all of your soldering and connections.

User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Re: Neopixel strip with arduino

Post by jimreilly »

Here are those photos you requested. Ours is a breadboard prototype at this point I have pictures from all angles to help see how things are connected. The resister is 470ohm and cap is 1uF.
Attachments
IMG_4714.jpg
IMG_4714.jpg (538.43 KiB) Viewed 493 times
IMG_4713.jpg
IMG_4713.jpg (474.43 KiB) Viewed 493 times
IMG_4712.jpg
IMG_4712.jpg (502.73 KiB) Viewed 493 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel strip with arduino

Post by adafruit_support_bill »

Looks like you are powering the strip from the Arduino VIN pin. How are you powering the Arduino?

User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Re: Neopixel strip with arduino

Post by jimreilly »

I thought the 5V and 3.3V above GND were outputs from the arduino that provided 5V to the breadboard and other devices. Did I misunderstand the way that pin works?
thanks

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel strip with arduino

Post by adafruit_support_bill »

How are you powering the Arduino? That determines how much power is available at these pins.

And how long of a strip are you trying to run? That determines how much power is needed by the strip.

User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Re: Neopixel strip with arduino

Post by jimreilly »

The strip is the Adafruit NeoPixel LED Side Light Strip - Black 60 LED PID: 3636
I have the arduino connected to the laptop via usb while we try to prototype.
jim

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel strip with arduino

Post by adafruit_support_bill »

Powered by USB, there is up to about 500mA (0.5A) available from the 5v pin. A 60 pixel strip can pull as much as 3.6A if all pixels are at full intensity white. Most patterns use less than that, but you can still easily overwhelm what the 5v pin can supply. For testing, you can specify fewer pixels when you declare the strip in your code. That will only illuminate as many pixels as you specify and reduce your power requirements proportionally.

Other than that, I would simplify your wiring and eliminate the breadboard. Breadboard connections are notoriously flaky and it only takes one bad one to cause a problem.

Your USB supply is safe enough that you don't need the capacitor. And the run is short enough that the resistor is not necessary either. Connect your strip directly to the GND, 5v and pin 6 of the Arduino.

User avatar
jimreilly
 
Posts: 6
Joined: Wed Apr 28, 2021 10:31 am

Re: Neopixel strip with arduino

Post by jimreilly »

Thanks. We will give that a try later today. Here is the simplified code I was looking at using to try and only turn 2-3 LEDs on. I really appreciate the suggestions. If you see any issues in the code please let us know.
jim

Code: Select all

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

#define PIN_NEO_PIXEL   6  // Arduino pin that connects to NeoPixel
#define NUM_PIXELS     60  // The number of LEDs (pixels) on NeoPixel

Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);

void setup() {
  NeoPixel.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  NeoPixel.clear(); // set all pixel colors to 'off'. It only takes effect if pixels.show() is called
}

void loop() {
  
  // turn pixel #1 to green one 
    NeoPixel.setPixelColor(1, NeoPixel.Color(0, 255, 0)); // it only takes effect if pixels.show() is called
    NeoPixel.show();   // send the updated pixel colors to the NeoPixel hardware.

    delay(1000); // pause between each pixel

// turn pixel #3 to red one 
    NeoPixel.setPixelColor(3, NeoPixel.Color(255, 0, 0)); // it only takes effect if pixels.show() is called
    NeoPixel.show();   // send the updated pixel colors to the NeoPixel hardware.

    delay(1000); // pause between each pixel
// turn pixel #5 to blue one 
    NeoPixel.setPixelColor(5, NeoPixel.Color(0, 0, 255)); // it only takes effect if pixels.show() is called
    NeoPixel.show();   // send the updated pixel colors to the NeoPixel hardware.

    delay(1000); // pause between each pixel
}
Last edited by adafruit_support_bill on Fri Mar 03, 2023 2:55 pm, edited 1 time in total.
Reason: Please use [code] tags when posting code to the forums

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”