I'm working on a project with 3,220 neopixels. It is a 12V line. I am doing testing and using a S2Mini I have to test the colors. I'm using a level shifter from 3.3V to 5V.
This works for a few lights, but once I try to light the whole board, well, it doesn't work so well. There was some action, some of the LEDs animated but not nearly all of them. I reset the board with 0 and RST while plugged in and all the leds lit up, but were not all animating. Finally, it was not responding at all and it could not be found using mpremote devs or lsusb.
I had another (I have quite a few) so I loaded it with the script (a simple color marching thing) and put that in. It didn't do anything. I was updating the script, but nothing was happening with the lights. I went over to it an touched the top of the board and some lights came on. More touching in different areas caused more lights to come on... but then I noticed it wasn't being found just like the earlier one.
This was working just fine, if slowly, on a string of 300 neopixels with the same power supply. I'm assuming this has to do with the sheer number of LEDs and the current. I'm also pretty sure an S2Mini is the wrong board for the job, but I wanted to check my setup with the forum before I sacrifice better boards to the Neopixel gods...
So I suppose my question is, am I wiring this correctly and what board would be appropriate for this, as a testing measure.
Outside of the level shifting which @LarryD has addressed (i use 74HCT04 and run the signal through 2 of the gates) I see that you have connected to GPIO 3, could you show us the complete code as well to see if there are any accidental conflicts.
If you are addressing them on a single data line, as you are, your maximum refresh rate will be about 10Hz, will that actually be enough ?
Sure, I'll post the code once I get into the office.
I'm not concerned about the refresh rate at the moment, I'm literally just trying to get the whole board to shift color, even at about 10Hz.
I'm not entirely sure what my final approach will be, but generally speaking, I'll have a PC running some interactive graphic software that will then send its pixel array to the microcontroller which will control the lights. I'm anticipating using multiple controllers to manage the refresh rate, probably better ones than the S2Mini.
What is concerning me is mostly the death of two of my microcontrollers. If it is the wiring then I have a problem with a core concept here.
Here is the code. It is in micropython, so forgive my choice of runtime in the arduino forum.
I know it is suuuuper slow, but it was just meant as a test.
import time
import machine, neopixel
import math
led_number = 3200
np = neopixel.NeoPixel(machine.Pin(3), led_number)
def demo(np):
try:
n = np.n
r = 0
g = 0
b = 0
limit = 120
for i in range(500): # run for 500 cycles
for j in range(n): # increment the color values for each led for each loop
r = int(abs(math.sin((i+j)/5))* limit)
g = int(abs(math.sin((i+j)/10))* limit)
b = int(abs(math.sin((i+j)/20))* limit)
np[j] = (r, g, b)
np.write()
time.sleep_ms(6)
for i in range(n): # Clear after loop above completes
np[i] = (0, 0, 0)
np.write()
except KeyboardInterrupt: # Clear LEDs on keyboard interrupt
for i in range(n):
np[i] = (0, 0, 0)
np.write()
if __name__ == '__main__':
demo(np)
Here is the schematic.Some of the components are an exact 1:1, but I think it is reasonably accurate for the explanation. Unfortunately I've already disassembled the old board to use the 74AHTC125, so I don't have photos. Once I get the next board wired up I'll upload a photo.