Arduino Forum

Using Arduino => General Electronics => Topic started by: Qdeathstar on Jul 11, 2015, 11:55 pm

Title: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 11, 2015, 11:55 pm
I apologize ahead of time if we are only supposed to talk about Arduinos. But, the Teensy is super small and has more ram than the mega.


My issue is that I want to control LED strips using the teensy, but it seems the logic level outputs are only 3.3v which wont work, so I need a buffer to increase the voltage.

What do you recommend. Ideally, id like something easy to solder (through pin)


Also, I need 5v for the teensy and a 433mhz receiver from a 12v supply (the leds run on 12v) so could I use a voltage divider here? Thanks!
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 12, 2015, 12:00 am
Quote
What do you recommend.
It depends on the current that the LED strip takes. If < 500mA use a transistor, a TIP120 or similar. If >500mA then use a logic level FET.

Quote
so could I use a voltage divider here?
No use a voltage regulator to drop the supply voltage. You can only use a divider to cut down signals.

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: CrossRoads on Jul 12, 2015, 01:42 am
Can use a low voltage level gate like this one
http://www.digikey.com/product-search/en?pv959=13&pv69=80&FV=fff40015%2Cfff8007d&k=n-channel+mosfet&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25
for the teensy to turn on to connect cathode of LED strip to GND to turn the LEDs on.
LED strips are typically 3 LEDs in series with a current limit resistor, drawing about 20mA.
So this MOSFET is good for ~ 15 LEDs worth of strip.

5V regulator to as GM says for the 12V to 5V supply.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 12, 2015, 01:57 am
I should have been more clear,

The leds are LPD8806's and have a clock and data line....
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: CrossRoads on Jul 12, 2015, 02:12 am
Ah, so addressable LED strips then, such as
http://www.adafruit.com/product/306 (http://www.adafruit.com/product/306)
3.3V to 5V adapter would be good - could be a simple 74HCxx gate, such as
http://www.digikey.com/product-detail/en/SN74HC08N/296-1570-5-ND/277216 (http://www.digikey.com/product-detail/en/SN74HC08N/296-1570-5-ND/277216)
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 12, 2015, 07:24 am
I have used a 74LS14 to step up from 3V3 to the 5V system. You need to use a 510R seriese resistor on the signal and a hefty capacitor on the output.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: CrossRoads on Jul 12, 2015, 07:34 am
Seems a bit overkill Mike. How much current does the control line into a CMOS-based LDP8806 need?
https://frack.nl/w/images/3/33/LPD8806_datasheet.pdf (https://frack.nl/w/images/3/33/LPD8806_datasheet.pdf)
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 12, 2015, 07:53 am
Not sure what is overkill? The resistor is there to stop reflections on the line. The capacitor is for the led supply.
You need two non inverted signals so a 74LS14 will provide six inverters but you only need four.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: CrossRoads on Jul 12, 2015, 08:28 am
I was thinking running the Clock and Data lines thru 2 gates to get them from 3.3V out of the Teensy to 5V into the first LPD8806 on the LED strip.
Not sure reflections would be a big problem there if the strip is connected with decent wiring to whatever the 3.3 to 5V buffer is. Couldn't hurt I suppose.  I could see a cap on the supply line if the LED strip didn't have that already.

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 13, 2015, 01:57 am
Thanks for your comments guys.

After reading the comments, it seems like the 74LS14 is the "best" option


I was trying to get this set up in eagle, and I think I found the chip, but when I add it to my schematic, it only adds a pair of "pins" at a time...  but the vcc and gnd pin don't show up?

Also, VCC in this case would be 5v correct? And I'm taking the signal from the eagle, to an input pin on the 74LS14, then taking the output and putting it back to another input pin? To invert the signal twice so it becomes "uninverted"?

Lastly, the datasheet
http://www.futurlec.com/74LS/74LS14.shtml
is limited... how do you know where the capacitor and resistors need to be, and the correct value?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: jack wp on Jul 13, 2015, 02:36 am
Just a question about level shifters from 3.3 to 5v.
Would a 74LS14 really be much better than a pullup resistor to 5v, and a diode from the 3.3v output, allowing the output to only pull the signal low?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: CrossRoads on Jul 13, 2015, 02:57 am
In Eagle, right click and select Invoke to grab the power pins.

Diode with pullup - that won't keep 5V off the 3.3V output pins.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 13, 2015, 03:24 am
It seems that these chips have internal pull-up resistors.

Try a 2N7000.
Gate to teensy port, source to ground, drain to LED data pin.
No other parts.

Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 13, 2015, 04:51 am
How would that boost the logic voltage?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 13, 2015, 05:36 am
The pull-up resistors inside the first LED driver IC should pull-up the data/clock lines to it's own 5volt supply.
The mosfet just pulls that pin to ground when data is flowing.

Data/clock goes only to the first IC in the LED string.
The first chip passes things on to the next one.

NO long lines between teensy and LED strip....
Too much wiring capacitance, and data will be corrupted.

You could try a transistor (and 1k base resistor) if you haven't got a small mosfet.
But transistors could get saturated, and have slow switching speeds.
A schottky diode across B/C (baker clamp) could help.
Leo..


Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 13, 2015, 05:37 am
It seems that these chips have internal pull-up resistors.
No.

How would that boost the logic voltage?
You would need a pull up resistor on the drain. The signal would then be inverted.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 13, 2015, 05:48 am
Well. A lot to consider.

I worked on a schematic based on what we had talked about with the 74LC14... I think I have it right, but i'm not sure about the resistor values or capacitor values, what type of capacitor, ect....

I tried looking at this... but it is a different chip..

http://www.adafruit.com/product/1779


It looks like a ceramic capacitor and from what I can read, 100ohm resistors... why 100 ohm?

Here is the schematic I have so far:

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 13, 2015, 06:04 am
The 74HCT245 is an octal non inverting buffer, so you would only need two out of the eight buffers in the chip. It can also be a switched bi directional buffer but you don't need that. It is a more modern chip but otherwise offers no particular advantage.

Connect the unused inputs of the 74LS14 to ground for stability.


Quote
It looks like a ceramic capacitor
What does? It is normal to use a ceramic capacitor for decoupling and you should put one across the power pins of the 74LS14.

Quote
why 100 ohm
It is not too critical. It is there to soak up reflected signals and damp down any standing wave that could build up. Those two things are actually the same thing.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 13, 2015, 06:17 am
The 74HCT245 is an octal non inverting buffer, so you would only need two out of the eight buffers in the chip. It can also be a switched bi directional buffer but you don't need that. It is a more modern chip but otherwise offers no particular advantage.

Connect the unused inputs of the 74LS14 to ground for stability.
Ok

Quote
What does? It is normal to use a ceramic capacitor for decoupling and you should put one across the power pins of the 74LS14.
In the picture of the octoWS2811 I was using as a reference, there is a ceramic capacitor there tooo, I just wanted to make sure I should a ceramic one. Should I use a 100uf capacitor?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 13, 2015, 06:34 am
Quote
Should I use a 100uf capacitor?
Well you can't buy a 100uF ceramic capacitor.
It needs to be 0.1uF or 100nF ( they are the same thing )
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 14, 2015, 01:08 am
Can the decoupling capacitors be connected to the ground plane? I can't see a way to route them like this:

https://cdn.sparkfun.com/assets/2/6/7/7/e/51965e31ce395f412a000000.png

(just an example)

I can route the power, but the grounds just connect to my ground plane... Is that oK?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 14, 2015, 02:38 am
It seems that these chips have internal pull-up resistors.
No.
Why would I say that without reading the datasheet first...
https://frack.nl/w/images/3/33/LPD8806_datasheet.pdf
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 14, 2015, 06:19 am
I am using a 1.5amp voltage regulator to step down from 12v to 5v... I think that my current draw is at most around 100ma (35ma for the teensy, 6ma for the Heterdyne 433mhz rx, and I think I read a max of 20ma for the 74ls14? (Icch?). So that adds up to 61ma, so 100ma should be plently..

On adafruit, it says that the voltage regulator can drop 2w without a heat sink.  I found this formula for wattage drop:

(InputVoltage - 5V) * AverageCurrentInAmps  (12 - 5) * . 1 = .7

So I shouldn't need a heat sink.



Please take a look at my schematic and let me know what you think...
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 14, 2015, 07:21 am
I'm lost.
Why termination resistors. What is the clock speed.
Are you planning to go twice around the block with Cat-5.
Will there also be 150ohm termination resistors at the end of the cable.
And an amplifier, because your signal would have dropped to 2volt.
Are you planning to drive one strip, multiple strips, series, in a star.
??
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 14, 2015, 01:42 pm
I'm lost.
Why termination resistors. What is the clock speed.
Are you planning to go twice around the block with Cat-5.
Will there also be 150ohm termination resistors at the end of the cable.
And an amplifier, because your signal would have dropped to 2volt.
Are you planning to drive one strip, multiple strips, series, in a star.
??
Leo..
uhh..,  this is the third board I have designed and the first two where just moving Arduino pins around.. I only know what I interpreted from Google searches and these forums...

I'm not sure what you mean by termination resistors, but I assume you mean the ones for data and clock. I thought grump said I needd the for the 74s14. Clock speed, I don't know.. I think I read that lpd806 is 400hz, but I won't be updating them more than 10 times a second....

I plan to have <1ft leads between the screw termina and the strip.

should there be 150 ohm termination resistors at the end of the strip? Im not sure, but I don't think I need an amp.. I think the 6808chips boost the signal.. in testing I was able to connect three 5 meter strips together no problem straight from an arduino... 

I was hoping to connect 6~8 strips together in series... around 40 meters max
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 14, 2015, 02:40 pm
Termination resistors are used when cable reflections are expected.
High switch frequencies and long cables.

If your teensy is 30cm away from the first IC, there is no need for that.

And the LED chips are not boosting the signal, they are buffering the signal.
You only drive the first IC. That IC buffers the data, and passes it on to the next one.

Try two small mosfets or two NPN transistors with 1k base resistors.
Takes 10 minutes to hook that up on a breadboard.
Make sure you reverse your output pin code.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 12:03 am
Are you using the mosfets instead of the 74ls14 to get from 3.3v to 5v or in addition to it?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 12:17 am
Connect a 5volt supply to the LED strip. Nothing else.
Measure the clock and data voltages in respect to LED strip ground.
You might find 5volt on the pins, because the LED IC is already pulling those pins up to it's own supply.

If so, all you have to do is switch those lines to ground, with a transistor.

Mesure that first, and report back.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 12:40 am
The strips I'm using are 12v.


I measured from ground to data in and ground to clock in with just the 12v power supply connected and got 0 volts dc.

I verified 12v between ground and positive.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 12:54 am
So you're NOT using the LED strips with the LPD8806 drive chip, mentioned in previous posts.

That chip has a maximum rating of 5.5volt, and would blow up on 12 volts.

??

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 01:25 am
http://www.aliexpress.com/item/2015-Hot-sales-High-quanlity-addressable-digital-led-strip-LPD8806-5m-led-digital-strip-36LEDs-M/32275782496.html
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 01:34 am
The LPD8806 datasheet states "supporting LED lighting voltage upto 12volt" and "Absolute max of 5.5volt ".
There must be a voltage regulator for the IC on the strip.
The datasheet has a 5.1volt zener diode from VCC to ground.

Here is the Adafruit version. It needs a 5volt supply.
http://www.adafruit.com/product/306

Better post a picture of one section of your LED strip.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 01:54 am
Here is a picture of the IC
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 01:56 am
HOWEVER,

What if I want to change later to APAs? DO I really have to design another pcb for those? They also require level shifting.  What happens you apply 5v to a 12v-5v regulator?

This seems like it would be easy...

http://www.adafruit.com/products/1787

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 02:25 am
Educated guess..
That strip shows a 510ohm resistor feeding a 5.1volt zener diode.
~5volt for the IC.

You could try this before you venture into level shifting:

If you run the first IC on 3.3volt, it should be happy with the Teensy data, and it might pass it on to the next IC. Or maybe run the first chip on ~4volt.

Tack a 3.9volt zener across the zener on the LED strip (measure the voltage !).
Leo..



Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 02:37 am
Ok,

but will grumpy mike's idea not work? He was on today but didn't give me all his attention :D

Whats wrong with the 74ls14? 
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 02:51 am
Nothing wrong with his idea.

Just seems silly to use an axe to crack an egg.

Why not use a 5volt Arduino.
it will run on the same 12volt as the strip.
And has a 5volt out for your RF receiver.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 02:54 am
I think I can understand the 74ls14 easier, plus, I don't want to run the strips at 5 volts.. im using these where the power runs will be around 100ft... I won't have to worry about voltage drop as much if i'm using 12v instead of 5v... plus its easier to find high-amperage 12v transformers.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 03:07 am
I don't want to run the strips at 5 volts..
?? I did not say to run the strip on 5volt.
I said run the first IC only on a lower voltage by changing the zener.
It will still drive the 12volt LEDs.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 03:16 am
oh, I misunderstood...

I don't have a Zener.... next time I order something ill through a few in the cart...

can you tell me, is the 74ls14 hooked up correctly in my schematic?

And can the decoupling capacitors be hooked up to the ground plane on the negative side?

And do I need a heatsink on my power regulator?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 03:20 am
Improvise.
Two normal 1.8volt LEDs in series is a perfect 3.6volt zener.

Don't know if it's wise to use the LS family.
Last time I used one was in the eighties.
I use mostly HCTs now.
http://www.adafruit.com/products/1787
Runs on fumes, and is not inverting (no library tweaks).

Maybe make provisions on your board to use TWO strip outputs.
You have enough Teensy outputs and level translater ports...
Two the same patterns, or two different ones.

I don't think a TO220 7805 will need a heatsink.
I calculate, with the known parts, ~350mW.
Maybe better to use the 7111-5volt (smd) regulator, and use the ground plane as heatsink.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 04:22 am
I was looking at that chip earlier, but there doesn't appear to be eagle files for the chip...

I found 74Axxx125, and a couple of options under that.. but none of them are 74AHCT125.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 04:34 am
74xx-eu.lbr
74*125

Standard in the library.
Ignore the letters.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 05:38 am
I have edited the schematic with the newer chip..

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 06:50 am
Unused Cmos inputs (NOT outputs) have to be grounded.
Search for *1117 in the parts.
You find a common/cheap 5volt SMD regulator
Leo..

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 06:54 am
should the outputs be grouned too, or just floating?
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 09:51 am
Floating.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 15, 2015, 11:50 am
http://www.aliexpress.com/item/2015-Hot-sales-High-quanlity-addressable-digital-led-strip-LPD8806-5m-led-digital-strip-36LEDs-M/32275782496.html
The strip may be high quality but their data is not. If you put 12V into that strip you will probably blow it up. It needs 5V according to Adafruit. I can not see any 5V regulator or zener on that photograph, but you have the real thing so check that the power connector on the chip is connected directly to the power at the joins between sections. If it is then it is not a 12V system. I would strongly advise against running the first section at a different voltage than the rest of the chip.

You need a library to drive this chip, the Adafruit mentions an Arduino one, down load it and check that it is compatible with the Teensy.

Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 01:13 pm
Mike, the circuit seems to follow the datasheet's recommendation, third page.
https://frack.nl/w/images/3/33/LPD8806_datasheet.pdf

Only the LED rail is connected to 12volts. (3x 3.3volt LED in series?)
And every single chip is supplied from a resistor and 5v1 zener to ground.
The IC's supply pin is roughly in the middle, left hand side.
You can just see the connection to the resistor and melf (zener?) diode.

I think this strip uses six 5050 LEDs per IC. Each package containing three LED chips of the same colour.
And the Adafruit strip uses two RGB 5050 LEDs per IC.
Single LED explains the 5volt LED rail.
Adafruit's strip can mix colours (RGB LEDs). This strip can't.
But I could be wrong...
Maybe the owner can confirm this.
Leo..


Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 15, 2015, 01:38 pm
the two strips work the same, with the exception that the one I linked too has a lower resolution.

that is, on this strip every three leds can be independently controlled to get to any color.

I'm using the fastLED library and drive them with no problem using the default lpd8806 library on an arduino... the reason I want to use a teensy though, is the added sram and smaller footprint.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Wawa on Jul 15, 2015, 11:17 pm
Ahh, got that part wrong. So three RGB 5050s in series, running from 12volt.
One IC can drive two of these sets.
Leo..
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Grumpy_Mike on Jul 15, 2015, 11:27 pm
While the 74LS14 is an old chip it is not obsolete in the accepted electronic sense of the word of no longer being manufactured.

This one is even ROSH certified so the changes to that must have been done in the last eight years.
74LS14 (http://uk.farnell.com/texas-instruments/sn74ls14n/ic-hex-inverter-schmitt-14dip/dp/1470827?searchRef=SearchLookAhead)
Showing that development of the chip is still ongoing.
Title: Re: Boosting Logic Voltage (LED Strips on Teensy)
Post by: Qdeathstar on Jul 16, 2015, 01:13 am
Thanks Grumpy and Wawa... Though, i think the non-inverting chip is more practical...