Delaying the start of an LED driver

  • Context: Electrical 
  • Thread starter Thread starter Borek
  • Start date Start date
  • Tags Tags
    Led
Click For Summary

Discussion Overview

The discussion revolves around designing a LED driver controlled by a Raspberry Pi, specifically addressing the challenge of ensuring the LEDs remain off during the Raspberry Pi's boot process. Participants explore various methods to delay the power to the LED driver until the Raspberry Pi is fully operational, discussing both hardware and circuit design solutions.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a prototype LED driver based on the PT4115 that inadvertently powers the LEDs during the Raspberry Pi boot process due to high GPIO pins.
  • Another suggests using an AND gate with a delayed enable signal to control the power to the LED driver.
  • Some participants propose using a 555 timer circuit to create a delay before powering the LED driver.
  • There is mention of using a MOSFET output opto isolator to manage the power to the LEDs, powered by a GPIO pin.
  • One participant questions whether the GPIO pins are high or floating at boot, suggesting pulldown resistors or a buffer circuit as potential solutions.
  • Concerns are raised about the reliability of delay circuits, with one participant expressing skepticism about their performance.
  • A later reply indicates that the participant successfully implemented a 555 timer delay circuit, but notes issues with LED behavior during reboots.
  • Another participant recommends installing a diode in the 555 timer circuit to prevent the LEDs from turning on during power interruptions.
  • There is a discussion about using a transistor to manage the timing capacitor discharge in the event of a reboot.
  • One participant acknowledges the need for improvements in their hastily assembled circuit design.

Areas of Agreement / Disagreement

Participants express a range of ideas and solutions, with no clear consensus on the best approach. Some methods are proposed and debated, but the discussion remains unresolved regarding the most effective solution to the problem.

Contextual Notes

Participants note potential limitations related to the reliability of GPIO pin states during boot and the behavior of delay circuits, as well as the need for further refinement of the proposed solutions.

Who May Find This Useful

Individuals interested in electronics design, particularly those working with Raspberry Pi and LED drivers, may find the discussion relevant.

Borek
Mentor
Messages
29,203
Reaction score
4,625
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
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?
 
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
 
  • #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.
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
2K
  • · Replies 25 ·
Replies
25
Views
14K
Replies
1
Views
4K
  • · Replies 26 ·
Replies
26
Views
5K