0
\$\begingroup\$

I'm building a simple circuit to drive an LED status indicator in a project built around a RPi. The circuit takes its power from the same source as the RPi and is connected to one of the RPi GPIO pins. The aim is that the LED should start blinking when the system is powered on and continue to blink until the RPi system has finished booting, at which a process is launched to set the GPIO high, causing the LED to stop blinking and stay latched on.

I started with this circuit

LED flasher http://wild-bohemian.com/electronics/images/t-flash2.gif

Which I modified like so:

enter image description here

I've implemented a few circuits as designed by other people but this is the first I've attempted to design myself (ok, only a tiny part is mine, but hey). It does seem to work but I'm not confident that it is robust and I would appreciate any advice on how to do it better, or more simply.

One thing I've noticed when setting up on a breadboard is that if I just hold the wire that goes to the GPIO pin between my fingers - without attaching it - the LED latches on. I don't understand why. I'm not planning to put the circuit somewhere people can stick their fingers in but I would like to understand why it does this and if it is a symptom of a design flaw.

\$\endgroup\$
  • \$\begingroup\$ What exactly is the supposed purpose of the circuit? \$\endgroup\$ – Majenko Oct 18 '14 at 19:11
  • \$\begingroup\$ @Majenko The purpose is to show system status. LED off means no power. LED blinking means power on, not yet fully booted. LED on (not blinking) means system ready. \$\endgroup\$ – seberoon Oct 18 '14 at 22:24
0
\$\begingroup\$

Aside from the fact, that you could save parts but not money by using something like a ne555, it is an interesting circuit. But as you want some hints: your third transitor will be in saturation, when activated. Depending on the type it may fail to lower the base voltage enough to prevent the right 2n3904 from conducting. If you want to be sure you should use an low VCEsat BJT. NXP and ONSEMI each have a special selection of those types. Then you may increase the resistors of your added voltage divider, but only to save some fractions of miliamperes.

So why does your circuit react to touching in this way? I bet your powersupply is causing this phenomenon. Either your RPi or the laptop connected to via usb or network is powered by a wallwart or brick PSU. Those devices tend to have a Y-capacitor between hot and cold on primary side. the middle pin is connected to ground on secondary side. This leads to the fact, that the ground of your RPi in fact has a voltage of half of your mains voltage relatively to earth. So if your mains voltage is 110V AC, your RPi's ground is at 55V AC. When you touch it, there will flow a small AC current through your body and the capacitance it forms with your environment. this current is now rectified by the base-emitter-diode in your transistor. It apparently is big enough to open up that transistor and stop the astable circuit from being astable.

\$\endgroup\$
  • \$\begingroup\$ Thank you. That is very clear and very helpful. I did think of using a ne555 but I wanted to see if I could figure out how to make this work. I'm just using another 2n3904 but it seems to work fine. And you are spot on about the PSU. I'll keep out any prying fingers. \$\endgroup\$ – seberoon Oct 18 '14 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.