tofergregg
Posts: 3
Joined: Wed May 07, 2014 12:24 pm

Determining if an external LED is on or off

Wed May 07, 2014 12:33 pm

I have connected my Raspberry Pi to the controller of an external device (an espresso machine) with a couple of solder connections to the power button (so the RasPi can turn it on and off via a software timer). This works great. However, I can't sense whether the machine is actually on or off already.

The same controller has LEDs that indicate whether it is on or off. Is there a circuit I can connect to the LED terminals to determine whether or not the LED is on or off? If I put a simple transistor switch in parallel with the LED, will I be able to tap a small enough current to turn on the switch and still light the LED? I'd rather not try to desolder the LED for something inline.

Thanks!

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Determining if an external LED is on or off

Wed May 07, 2014 2:54 pm

I think a transistor could work if you tie the devices' grounds together.
You might be better off running an opto-isolator in parallel with the LED though. That would allow you to keep the two devices completely electrically isolated.

tofergregg
Posts: 3
Joined: Wed May 07, 2014 12:24 pm

Re: Determining if an external LED is on or off

Wed May 07, 2014 3:18 pm

Sounds good -- I was thinking about an optoisolator, but the LED is on the outside of the machine, and I want the electronics to be inside. I'll try the transistor first.

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Determining if an external LED is on or off

Wed May 07, 2014 7:58 pm

See my blog post
http://raspberrypihobbyist.blogspot.com ... ensor.html

I do what you are looking to do.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: Determining if an external LED is on or off

Wed May 07, 2014 8:41 pm

Hi

"Connect the grounds together" is OK advice if you are absolutely sure that the coffee-maker has a ground. Many appliances have control electronics which are connected to the live circuit. Make sure that your coffee-maker has an isolating supply.

A conventional mains transformer will generally provide isolation as will **some** switch-mode supplies.

Does the device have an earth(ground) wire in the plug? Can you see where it goes?

Please do not connect if you cannot confirm the isolation.

On the other hand an opto-isolator, correctly connected, provides the galvanic isolation needed as has been said already.

I assume that the "solder connections" to the go button are from a relay. The relay probably provides isolation.

Connecting to a.c. devices can be dangerous.

tofergregg
Posts: 3
Joined: Wed May 07, 2014 12:24 pm

Re: Determining if an external LED is on or off

Wed May 07, 2014 9:14 pm

Re: "Connect the grounds together" is OK advice if you are absolutely sure that the coffee-maker has a ground. Many appliances have control electronics which are connected to the live circuit. Make sure that your coffee-maker has an isolating supply."

I'm good here -- the controller unit is isolated from the rest of the machine's electronics.

Re: Blog post -- awesome, thanks for the info!

Return to “Automation, sensing and robotics”