How to connect a 5v device to the Imp?

I am trying to use the Neopixel class with the Imp, but I’m not sure how to connect them?
My Neopixel strip (8 pixels) needs 5V but the imp supplies 3.3V.
Thanks!
Erik.

You need to step up the signal voltage - you can use a FET fairly simply, or just use one of these $3 widgets from SparkFun.

  1. Put 3.3V into LV
  2. Put 5V into HV
  3. Attached the imp’s + neopixel’s ground to GND pins
  4. Patch your imp’s signal wire -> LV1
  5. Patch HV1 -> DI on the NeoPixels

Thanks! So I do need a separate 5V supply? The signal voltage converter is needed to convert the “data” wire that goes from the Imp to the Neopixel?

The April (and I believe all of the @MakeDeck breakout boards) can accept anywhere between about 2.7V and 17V on Vin, and step it down appropriately. So you would do this:

5V Powersource -> 5V (NeoPixel)
5V Powersource -> Vin (imp)
5V Powersource -> HV (translator)

3v3 (imp) -> LV (translator)

Pin7 (imp) -> LV1 (translator)
HV1 (translator) -> Din (NeoPixels)

And then tie all the grounds together.

Would the whole thing look something like this? (Sorry, still a bit in the dark about how to connect the power - can it go from the power source to both the converter board and the neopixel…?)

You’re really close, but right now the imp isn’t getting any power. You need another set of wires going from the batteries / powersource to your imp’s Vin and GND pins.

Side note: If you’re running NeoPixels + an Imp, you’re probably going to want to have wall power rather than batteries as NeoPixels are quite power hungry!

Thanks for clarifying! So how about this sketch? I must say it looks rather complicated :slight_smile:

I’ve never used a translator with Neopixels… and I’ve powered them with everything from 3.3V - 5V. Is there a new version that the Imp can’t directly control?

Here is a 16 Pixel ring powered by an Aria, LiPo and using the 3.3V line.

The Adafruit site states :

“NeoPixels powered by 5v require a 5V data signal. If using a 3.3V microcontroller you must use a logic level shifter such as a 74HCT245. (If you are powering your NeoPixels with 3.7v, a 3.3v data signal is OK)”

I thought this meant that you always need a converter, but now that I’m re-reading it actually says that you CAN use a 3.3V data line, if the power is also 3.3V ?

The adafruit uberguide is actually pretty confusing!

I’ve powered them with 5V and controlled them with 3.3V signals… your results may vary…but you can try it. I don’t think you can hurt anything, you just might get sketchy control.

Here’s a super quick lesson on digital electronics and why you can sometimes get away with running 5v NeoPixels with a 3.3v logic level:

Digital electronics have two states: HIGH (1), and LOW (0).

People who are new to digital electronics often assume that HIGH is 5v and LOW is 0v (in the case of a 5V system) - but this isn’t true. HIGH and LOW logic levels are defined by voltage thresholds, not absolute voltages… and the thresholds are actually somewhat forgiving:

LOW is defined as (GND/0V) to (1/3 * Vdd)
HIGH is defined as (2/3 * Vdd) to (Vdd)

(where Vdd is the supply voltage)

So… in the case of NeoPixels, where Vdd is 5V:

HIGH threshold = 5V * 2/3 = 3.3V
LOW threshold = 5V * 1/3 = 1.67V

So the imp, being a 3.3V device is right on the threshold of being able to produce the necessary voltage for a HIGH logic level in a 5V device… but the imp’s upper limit is the NeoPixels lower limit.

All of this is to say… your results may vary

Lots of people have had good success running the NeoPixels off the imp with no logic level translator, but lots of people have had an awful time and really glitchy pixels that they can’t debug - so we recommend adding a logic level translator for the best results!

As I now understand the neopixel guide, the problem of the 3.3V data signal being interpreted as LOW can be solved by also powering the Neopixels with 3.3V instead of 5V. The pixels may be dimmer because of the lower voltage.

Edit: just connected a 8-pixel strip straight to the imp, power and data at 3.3V. It works!
Edit2: the pixels are dimmer than usual, so using 5V for power is preferable.

@beardedinventor . What about the current limit to the IMP at Vin from the 5V source?
Does IMP have any input current limitation above which it will get damaged?

Sorry if the question is very basic, i am a beginner in electronics