voltage drop on h-bridge enabling

Thread Starter

Imstevil

Joined Oct 23, 2020
6
Hi,

First off, apologies if this is being posted in the wrong place. Happy to delete and re-post if required.

Basically I'm very new to electronics and been playing with a design to control fairy lights using a few h-bridges and a ESP8266. This project is purely educational / fun to play with during lock down. Not for other people, or to sell, just something for me to play around with and teach myself as I go.

So the idea behind it is you connect up to 5 sets of xmas lights (just fairy lights) they each have a LM317 and a variable resistor so you can adjust the voltage to suit that set of lights (I'm sure this would be better using a buck converter, but this was cheaper and xmas lights are very low amp) this then goes to a h-bridge which controls which strand of lights are on (they reverse polarity to swap colours illuminated) these h-bridges are controlled by a ESP8266. I could use it to make sure strands stay in sync, or make patterns across different strings, or anything I wanted really.

I tested all this on a breadboard and things generally worked fine, thought I'd put it on a PCB and now things aren't working correctly (it's worth noting I've had to use different parts so I could have SMD components). I've attached the EASY EDA design that I used. I did realise AFTER the fact that each h-bridge should have had ISEN connected directly to ground, I have since hard wired this.

So the problem I'm having is for starters the variable resistor seems to be having no effect on the voltage really. I get a small voltage drop on the output from the LM317 (36v goes in 30v comes out) but not mater my adjustment the voltage stays the same. I'm not ENTIRELY fussed about this, I could just make sure all the string I use are the same voltage but this could be a factor as to what my main problem is which is I'm getting a random voltage drop when I enable the h-bridge. So if I enable either input on the first h-bridge the output is only 17V, I checked and the output from the LM317 has actually dropped to 17V as well (this value also isn't affected by the variable resistor). So enabling the bridge is affecting the voltage BEFORE it actually goes into the bridge. This also makes the voltage go UP on the bridges which aren't enabled, they all go up to 33V which is appears to be where the extra voltage goes to causing the drop on bridge 1.

I'm unsure what the h-bridge being enabled would cause this but I'm guessing I need to separate them all somehow to prevent this happening (in my breadboard tests I will admit I used a l298n so even though there was different channels it was still all one input into the bridge. So that's one mistake I'll learn from for next time! )

Any advice on how to work around this would be greatly appreciated. Even if you can point me in the right direction of what to research would be great, as I said this is a learning project.

Some notes about my schematics, P1 - P5 are where the xmas lights are plugged in. P6 and P7 are female headers on the PCB that I plug the ESP into.

Here is a link to the data sheet for the hbridge used as well
https://datasheet.lcsc.com/lcsc/1809050151_Texas-Instruments-DRV8870DDAR_C86590.pdf

Thanks in advance!
Stevil
 

Attachments

dl324

Joined Mar 30, 2015
13,527
Why are you using H-Bridge motor drivers for LEDs?

What is the current in the strings of fairy lights?

EDIT: add driver schematic:
1634418174136.png
 
Last edited:

Thread Starter

Imstevil

Joined Oct 23, 2020
6
Fairy lights work by swapping voltages the same way motors change directions. A bridge just makes it easier to swap back and forth between the 2 channels, there is also a 3 wire option which would work with my setup as well but can only have one set of lights illuminated at a time
bi-lights.png


I was able to figure out what was wrong though (with a great deal of help from others) I had made a few silly mistakes. The reason for the sudden voltage drop is because a lm317 does not regulate until you're drawing a current. when the bridge isn't enabled there is no current flowing through it so doesn't regulate. So as soon as I turned it was enabled there would be current draw on the lm317 and it would start to regulate the voltage then. The reason why the variable voltage wasn't working was because I forgot to connect the center wire on the variable resistor... Rookie mistake and I just didn;t notice it when I drew it up in EasyEDA. So it was always coming out at the same voltage which is what the problem was there.

I also didn't have the href pin connected on the hbridge, another very rookie mistake. After hardwiring all those missing things it appears to work. I'm not very good at doing fine soldering so have only tested it on one of the h-bridges. In realising the issue with the lm317 I am rethinking the design though, in testing I found that the initial voltage passed was always the maximum voltage as it hadn't been regulated yet and the capacitor was charged at that voltage, so as soon as you enable a hbridge it'll blow any lights that can't handle that voltage. I've been told to use a 240ohm resistor with the lm317 but that'll end up wasting a fair bit of power. I may end up looking at either just using the correct power supply for the lights connected, or look buck converters...
 

dl324

Joined Mar 30, 2015
13,527
Fairy lights work by swapping voltages the same way motors change directions.
I did not know that...
I had made a few silly mistakes. The reason for the sudden voltage drop is because a lm317 does not regulate until you're drawing a current.
Datasheets usually show a 120 ohm resistor for those who are prone to forget the minimum current requirement or don't read the datasheet in the first place.
I've been told to use a 240ohm resistor with the lm317 but that'll end up wasting a fair bit of power.
6.5mW is considered a fair bit of power?
 

Thread Starter

Imstevil

Joined Oct 23, 2020
6
I didn't know that about lights either, seeing that is what made me want to play with. I always liked the idea of playing with ws8211s but it's just to costly for project that I might not be good enough to complete, and the house I live in is about 70m, the power and costs would just be insane. Fairy lights are a cheaper and easier option for someone trying to learn by trial an error.

When I did my testing on the breadboard I didn't have any issues with the minimum draw. I used an off the shelf hbridge which had leds on it so guessing it was drawing enough current that I didn't have to worry about it. Moving to a PCB without that is obviously something I missed.

The power consumption is because all 5 will be running 24/7 then have the extra power dissipation when actually running the lights, I did the math and it dissipation would have been okay for the lights but still is a creating a fair bit of heat on the board, and will have 5 of them running. Whilst the 6.5mw isn't a great deal, I was already on the edge of thinking it might be a bit to much. From memory it was just over 1w of power to dissipate for the worst case with the lights I had here to test.

The buck converter itself is a similar price to the LM317 but still need to get the inductor, diode, and some additional capacitors. It'll add roughly $1 per bridge so about $5 per board. It worries me though as I know buck converters make a fair bit of noise, having 6 of them in close proximity isn't something I can really test on a breadboard. Not sure how that would effect an esp8266 if I do want to use it's Wi-Fi for controlling things. Both have their pluses and minuses that I'll need to research. Happy for suggestions if people have them though!
 
Top