Help with Eagle schematic and layout

@sazp96, how long is your neopixel string? Along the lines of what @Jack said, I have driven a string of 120 neopixels (powered by a 5V supply) directly from a Core without using any level shifter.

The 2N2222 and the 2N3904 are very common NPN transistors that will do the job just fine. :smile:

1 Like

Awesome thanks guys!

@Jack, you are absolutely right. In theory the 3.3V logic should totally work with 5V devices. What makes me nervous is the big statement that [Adafruit has about powering the strip] (https://learn.adafruit.com/adafruit-neopixel-uberguide/power#driving-5v-neopixels-from-3-dot-3v-microcontrollers). So, I’m playing it safe.

@peekay123, the Neopixel strip will have 75 LEDs. That should be nothing copare to the 120 that you tested. I have been able to drive 30 LEDs directly from a Core/Photon too. Maybe Adafruit is just being overly careful…

Thanks for the transistor references!

@sazp96, the only caution I have is that the wire length between the Core and my Neopixel string is under 6 inches. If you expect anything longer, this is where I would recommend the level shifter. :smile:

You may have driven 30 LEDs directly from a Core, but I suspect that you meant to phrase that a bit different. Did all 30 LEDs get all their power from the Core? Just to squelch my confusion ?

@Jack, I believe he meant a string of neopixels like I did:

“I have been able to drive 30 LEDs directly from a Core/Photon too.”

:smile:

The core providing all the power to drive them?

Did you drive them, or control them ?

@Jack, as I pointed out, the Neopixels are powered by 5V but the data is un-shifted from the Core (3.3v).

Ok, I think I got it.
The Core is only providing a signal, not the current to drive the LED’s.
The string of neopixels has its own power driver, and its own power supply.
So, it would not matter to the Core, how many LED’s were being driven by the string of neopixels ?
As long as the input of the string of neopixels, can recognise the 3.3V as an ON state?

Thanks, Jack

TTL 5V logic levels are typically < 0.8V = LOW, and > 2.0 = HIGH. CMOS is typically 1/3 and 2/3 VDD. Don't worry about ECL unless you are troubleshooting your Donkey Kong standup arcade game motherboard (i.e., don't worry about it).
REFERENCE (so we are not guessing): Logic level - Wikipedia


That said, @sazp96 you should always look at the datasheet for the device you are trying to control, in this case the NeoPixels datasheet. There are many different types... but the most common and newest version is the WS2812B with 4 pins.

Yes, Neopixels can work fine powered off of 5V and data input 3.3V, generally I've seen this if you don't have a lot of them... or if you get lucky. If you are breadboarding, try it first... if you get a lot of glitching on the pixels then you probably need to level shift up to 5V.

If you are designing a product:

and want it to definitely be reliable and work forever and ever without respinning the PCB... you really should adhere to what the datasheet says (and do a bunch of testing):

WS2812B datasheet suggests a minimum 0.7*VDD data input:

If you run them off of 5.0V, you need a minimum of a (5.0V*0.7 = 3.5V) data input... so this would be a perfect reason to level shift up to 5V with a single tri-state buffer such as this one: NL17SZ125XV5T2G if you making your own design, or this one SN74HCT125N if you are breadboarding.

1 Like

@Jack, @peekay123 is correct. I have an external 5V source powering the Neopixel. Only the logic is connected directly to the Core/Photon. Adafruit recommends to add a level shifter for the logic signal coming from the Core/Photon.

@BDub’s advice is dead on and provides a foolproof, no risk approach - use a level shifter!

Got it.

I :heart: my level shifter!

I definitely agree with everything @BDub said but I have one more thought to offer:

A level shifter is often also an amplifier and in particular it can improve your dV/dt rise-time/fall-time for signals.

This becomes especially critical for long wires or other high capacitance situations. Sometimes it even works too well as an amplifier and can cause ringing, in which case a series resistor at the source can help.

1 Like

@BDub I may have gotten my info from a bad source “So to be safe lets say that for a 5 volt system you should assure an input of greater than 3 volts to get a 1 and less than 2 volts to assure a 0”, http://www.avrfreaks.net/forum/input-pin-voltage-threshold-and-hysteris-statement

@sazp96 , did Adafruit specify the voltage thresholds for its input?
Thanks, Jack

Adafruit recomends two scenarios:

  1. Power the strip with 3.3V and use 3.3V logic

or

  1. Power the strip with 5V and use 5V logic. In this case, given that the Photon/Core runs on 3.3V, you would need a level shifter.

The reason of those two scenarios is what @BDub described here:

The logic voltage = 0.7 * power input

1 Like

Too right @bko! As is with any device, dig in and figure out ALL of the best practices and nuances of working with that device. Adafruit sells a TON of these and has a lot of experience with how to control them. Please do read their tutorial here :smile:

Great info, I learned a lot guys.

Hello folks, I’m having a really strange error and I’m running out of ideas of what could be causing it. I’m trying to build a product and this issue is the single biggest failure point. I need your help!

Problem: Failures on SD.begin() at “random”. Sometimes it initializes well, some time it doesn’t. I’m using the SD library from @BDub. I changed some pointers on Sd2Card.cpp. The rest of the screen functionality (e.g. writing text) works well all the time. It seems that this problem started when I switch from using a Photon (instead of a core).

Mitigation: Most of the time, when the SD.begin fails, if you wait for 3 min, then unplug the wall power adapter, wait for 1 min, and the connected again, most of the time when the system restarts the SD card initializes correctly. Sometimes switching the wall power adapter for another one “fixes” the issue.

Screen: Adafruit 3.5" TFT SPI LCD

Power supply: 5V 2Amps USB wall power adapter

Schematic Close Up Power Supply:

Pinging @mohit as well for help.

Thanks guys!

@sazp96, have you tested the library with just a Photon connected to a microSD breakout or DIY? Are you using software or hardware SPI for the SD? I would start with this testing. I have a version of the library ported but haven’t tested it yet. If I can, I’ll try tonight.

@peekay123, I haven’t tested using the Photon with a stand alone microSD breakout. I have only tested with the microSD that comes with the Adafruit TFT breakout. It used to work well with the core.

I’m using hardware SPI. The CS for SD is A0 (given that A2 is the CS for the LCD).

Would you mind sharing your ported library with me? I’m very pressed for time right now, and I would love to see if I missed stuff in my port.

Finally, given the inconsistent “fix” that doing a power cycle after 3 minutes produces, do you think this is a hardware or a software issue?