Delaying the start of an LED driver

  • Electrical
  • Thread starter Borek
  • Start date
  • Tags
    Led
In summary,Tom designed a LED driver that will be PWM controlled by Raspberry PI. However, the driver and Raspberry PI 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 his 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).The most reasonable option is to not power the driver till the Raspberry is up. The driver was implemented with a 555 timer circuit and an AND gate. If it is
  • #1
Borek
Mentor
28,949
4,244
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
  • #2
You could pass each GPIO pin through an AND gate with the other input being an enable. The enable could be delayed by some sort of timer?
 
  • #3
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
 
  • #4
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:
  • #5
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
 
  • #6
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 berkeman
  • #7
Use an Arduino or similar gadget. Talk to it using some sort of serial and go fail safe if the pi stops talking.

BoB
 
  • #8
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:
 
  • #9
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
 
  • #10
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.
 

1. What is the purpose of delaying the start of an LED driver?

Delaying the start of an LED driver can help prevent voltage spikes and surges, which can damage the LED and reduce its lifespan. It can also help improve the stability and efficiency of the LED driver.

2. How long should the delay be for an LED driver?

The length of the delay will depend on the specific LED driver and its recommended start-up time. It is important to follow the manufacturer's guidelines to ensure proper functioning and longevity of the LED driver.

3. Can delaying the start of an LED driver affect its performance?

In most cases, delaying the start of an LED driver will not affect its performance, as long as the delay is within the recommended range. However, if the delay is too long, it may cause flickering or dimming of the LED, so it is important to follow the manufacturer's guidelines.

4. Are there any risks associated with delaying the start of an LED driver?

If the delay is too short, it may not provide enough time for the LED driver to stabilize, which can result in voltage spikes and damage to the LED. It is important to carefully follow the manufacturer's guidelines and test the delay time to ensure proper functioning.

5. Can I use a timer to delay the start of an LED driver?

Yes, a timer can be used to delay the start of an LED driver. However, it is important to make sure the timer is compatible with the LED driver and can provide the necessary delay time. It is also important to regularly check and adjust the timer to ensure it is functioning properly.

Similar threads

Replies
19
Views
2K
  • Electrical Engineering
Replies
14
Views
2K
Replies
1
Views
1K
  • Computing and Technology
Replies
25
Views
10K
Replies
1
Views
4K
  • Electrical Engineering
Replies
5
Views
1K
Replies
1
Views
2K
  • Electrical Engineering
Replies
5
Views
1K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Art, Music, History, and Linguistics
Replies
1
Views
1K
Back
Top