Hello there
I'm new in the community and Arduino. I do have some knowledge in programming but it just doesn't seem to work...
In the moment I just want to turn ON a strip of 10 LEDs using the Adafruit NeoPixel Library.
I'm using an Arduino Nano RP2040 Connect, the VUSB on the backside is soldered and strip of LEDs WS2813 bought on distrelec. The selected Board is the right one: via Arduino Mbed OS Nano Boards and I don't get any error by uploading the code. I tried with and without resistor.
The LEDs are powered directly by the Arduino. I don't have an oscilloscope aswell as an external power supply for the LEDs.
I checked the output Pin with a "normal" LED by blinking it and it works, it turns ON and OFF. But as soon I try an example Adafruit program like "simple" and connect the RGB Strip it doesn't happen anything.
Neopixel LED (WS2812) required specific impulse sequence to run, it can't be controled just by change HIGH/LOW signal. Did you look to the Neopixel library examples?
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6 // On Trinket or Gemma, suggest changing this to 1
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 10 // Popular NeoPixel ring size
// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter -- see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
// The first NeoPixel in a strand is #0, second is 1, all the way up
// to the count of pixels minus one.
for(int i=0; i<NUMPIXELS; i++) { // For each pixel...
// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
// Here we're using a moderately bright green color:
pixels.setPixelColor(i, pixels.Color(0, 150, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(DELAYVAL); // Pause before next pass through loop
}
}
I powered it from the integrated +5V Pin. The one that only works, if the VUSB is soldered. I checked with a Multimeter and I do have the indicated +5V.
I do not think that this is a power problem, because your code lights leds one by one, so at least one or two should work.
But it would be better to power it with external 5v supply with at least 1A range.
I also don't see any obvious errors in the code ....
This is the code, with which the LED turns on and off. And this works.
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(6, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(6, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(6, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
10 RGB LEDs could in theory be a little more power than USB can supply. However, the strand test example sketch will draw only a fraction of the maximum power the strip could draw if all LEDs were on at full brightness white.
You can further reduce the power by reducing the brightness of the strip by putting
strip.setBrightness(128);
in setup().
Have you tested the strip using another Arduino? Ideally this would be a 5V Arduino like Uno or classic Nano. It's possible the strip is dead?
Have you read the Adafruit tutorial about neopixels? There are some recommended components to use that I don't see in your diagram.
If the strip works with a 5V Arduino, can you test with another 3.3V Arduino, for example an 8MHz Pro Mini or Pro Micro or other compatible such as one based on ESP8266?
If the strip works with 5V Arduino but not 3.3V Arduino, it may be necessary to use a logic level adaptor to convert the 3.3V signal from the Arduino to a 5V signal. Don't buy the bi-directional converter modules designed for use with i²c bus for this purpose, they don't work well. Instead, use something like a 74hc14 or, ideally, 74hct14, although many 7400 series chips may also work.
I don't have another Arduino neither other LEDs. They could indeed be dead, but it would surprise me because they are new.
I did measure the output of the digital PIN and with the anode/cathode LED it gets only up to 3.6V/3.8V instead of 4.5V/5V.
I tried with a resistor but it didn't change anything. I do have some little capacitor which I could try.
Maybe like you said, I should by an Arduino which works on 5V instead of 3.3V. Maybe I will buy the normal Nano. So that the output voltage, should be 5V instead of 3.3V?
1.85V is very low. It should be much closer to 3.3V. But you measured that with an ordinary led? How much current was flowing? How much current can an output pin of rp2040 source or sink? Maybe you overloaded the pin and that pulled down the voltage.
If you measure the voltage on the same pin with no led connected, what voltage do you measure?