Delaying the start of an LED driver

  • Context: Electrical 
  • Thread starter Thread starter Borek
  • Start date Start date
  • Tags Tags
    Led
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
9 replies · 3K views
Messages
29,210
Reaction score
4,635
I am trying to design a LED driver that will be PWM controlled by Raspberry PI. Actually I already have a prototype (based on PT4115) and it works - kind of. I need to start with LEDs being off and switch them on only when they are needed. Unfortunately, both driver and Raspberry are powered at the same time (separate PSUs, but same mains cable in a difficult to reach place). Raspberry PI GPIO pins are initially high and LEDS are on till the Raspbian boots up and my script can dim them out (they will be used rarely and for short periods of time). Just inverting the pins is not guaranteed to work (and will make controlling difficult and clumsy on the code side).

So it looks like the most reasonable option is too not power the driver till the Raspberry is up. That means delaying the moment power is supplied to the driver (for at least 60 seconds). I can imagine trying to implement it with a resistor, capacitor and MOSFET, but I wonder if there are no some "standard" solutions for such situations.
 
Physics news on Phys.org
Borek said:
So it looks like the most reasonable option is too not power the driver till the Raspberry is up.
If all the GPIO pins do the same thing, use a Raspberry output to {turn on the power to the driver} OR {short the driver inputs to Off} .
Use a 555 timer circuit to...
Purchase an overpriced Time Delay relay to...

Or probably best, get a CPU that properly recognizes and documents a hardware RESET signal.

Cheers,
Tom
 
Borek said:
So it looks like the most reasonable option is too not power the driver till the Raspberry is up.
Maybe a MOSFET output opto isolator to switch the power of the LED part, powered by an output pin and Vcc?

Ps.: I'm not a big believer of delay circuits, they too often goes weird o_O
 
Last edited:
Borek said:
Raspberry PI GPIO pins are initially high
High or floating? If floating, just put pulldown resistors on the ones you want to be low until you drive them. Otherwise use a buffer circuit with some sort of fail-safe enable as suggested by @CWatters
 
I'm no expert on the Pi but Google suggests they power up as inputs, and there might be pull up resistors as well (on some of them), but one or two references say you can't rely on the OS leaving them like that before your own code starts. Seems like a bit of a software design flaw?

Edited to add this link..

https://www.raspberrypi.org/forums/viewtopic.php?t=24491
 
  • Like
Likes   Reactions: berkeman
Use an Arduino or similar gadget. Talk to it using some sort of serial and go fail safe if the pi stops talking.

BoB
 
Sorry guys for being quiet - real life got me and I had no time for the project. Doesn't mean I ignored your posts and advice. Finally today I was able to build the prototype. I went for the 555 based delay timer (RC = 47 μF × 1 MΩ, giving surprisingly accurate 48 seconds) and 74x08 to AND it with the GPIO output. It works as expected (that is, unless I reboot the system, then it doesn't and the LED goes on for a moment - but I can live with that).

Thank you for your suggestions :smile:
 
Borek said:
unless I reboot the system, then it doesn't and the LED goes on for a moment
Install a diode in the 555 timer circuit, Anode to the 47uF and Cathode to the +supply. When the power goes down the timing cap will be quickly discharged.

If it is a problem after a reboot without power interruption, you could use a transistor across the cap with the base driven by one of those spare GPIO pins that goes high at boot time.

Cheers,
Tom
 
Tom.G said:
Install a diode in the 555 timer circuit, Anode to the 47uF and Cathode to the +supply. When the power goes down the timing cap will be quickly discharged.

I was afraid short power interruptions could be a problem, but to my surprise they are not. Pi and my circuit (not the LED part, that will run from additional 12 V PSU) are powered by an USB charger, pulling it out and plugging it back (2 or 3 seconds without power) is enough to avoid LED going on. Not sure why it discharges so fast. I will probably install the diode just in case, that was already one of the things I considered.

If it is a problem after a reboot without power interruption, you could use a transistor across the cap with the base driven by one of those spare GPIO pins that goes high at boot time.

Yes, that's the case. Transistor will do the trick, thanks for the idea. In general reboot is not an important problem, rather mild inconvenience. What I want to avoid is LED going on after power interruption. Once the system is set up chances are I will never need to reboot it again, but even if, I can always first shut it down and switch power off/on.

I admit I was in a bit of hurry so I just put together some things that I found with quick googling, without trying to understand how and why they work. That most likely means plenty of room for improvements.