6hearts
Posts: 16
Joined: Sat Dec 26, 2015 1:25 pm

Sensing leds, 7-segment displays...

Sat Jan 30, 2016 10:07 pm

I have a primitive heat pump for my house heating and I want to automate it a bit with my pi.
It has a few buttons, a few led light (compressor on/off,...) and a 4 digit 7-segment display showing the temperature.

I am wondering how will I read all the data (leds, 7-segment display) and simulate button-pressing through the GPIO pins. Here are my thoughts:

- I can simulate the button presses using relays.
- I can read the leds by a parallel connection to the GPIO pins
- I can read the 7-segment display by a parallel connection to the GPIO pins (I know how display signals work)

Are these methods good? Should I use serial connection instead of parallel?

Can I connect the ground of my pi to the ground of the heat pump electronics? Is this safe? It probably does not make sense to read voltage through the GPIO pins if I do not have the grounds (zeros) at the same potential?
In this case I could perhaps also simulate the button presses by outputting on the GPIO pins and there would not be a need for relays? I am not concerned about damaging my pi (since i can just order a new one), but am quite concerned about damaging my heat pump electronics.

I am sorry, I never studied electronics, I am more of a programmer. Please advise (the main questions are in bold :)

User avatar
hansotten
Posts: 341
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 10:41 am

Hi,

You can indeed read these signals. Only possible problem you may encounter that the 7 segments led are multiplexed and not staticallly illuminated.

Hans
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 12:10 pm

6hearts wrote:Can I connect the ground of my pi to the ground of the heat pump electronics? Is this safe? It probably does not make sense to read voltage through the GPIO pins if I do not have the grounds (zeros) at the same potential?
Without detailed knowledge of the system you want to connect to, it's impossible to say whether or not it's safe.

Yes, in general, the Pi's GPIOs measure voltage differences from "ground" - the reference being the negative side of the power supply.
So there needs to be a connection between the Pi's ground and somewhere on the heat-pump system.
But whether the system's ground is safe to connect to, and whether the system's LEDs, displays, or buttons are at a safe voltage with respect to that ground, is unknown.

So, for example, if the LEDs are connected to 24v (with respect to the system's ground), with resistors to transistors to the system's ground, then the voltages on the LEDs will only change from 24v to 22.5v (with respect to the system's ground) and not be safe for the Pi.

Opto-isolators would be one direction to go for your interface.
One side of the opto-isolator - the input side (which is just an LED) - is happy at whatever voltage the LEDs are at, while the output side (a photo-transistor) is connected to the Pi's ground.

6hearts
Posts: 16
Joined: Sat Dec 26, 2015 1:25 pm

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 5:38 pm

Thanks! I'll take a look into opto-isolators.

OK, lets say that that the leds voltage is 24v to 22.5v. and lets say that the pi's ground is about the same as the heat pumps ground (although not connected). Couldn't I just connect the - (minus) pin of the leds to the ground pin of the Pi so the leds voltage would now be from 0 to 1.5 from Pi's perspective?

Probably there is a big chance that the leds minus and the displays ground conicide? I can measure the voltage between them..

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 6:06 pm

hansotten wrote:Hi,

You can indeed read these signals. Only possible problem you may encounter that the 7 segments led are multiplexed and not staticallly illuminated.

Hans
Possibly use OCR?

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 7:42 pm

[quote="6hearts"... and lets say that the pi's ground is about the same as the heat pumps ground (although not connected).[/quote]
Unless you take some steps to ensure that, since (normally) the Pi's power supply is floating - not connected to Earth - there could be any voltage between them, depending on whether or not there's a thunder-storm nearby, among other things.
Couldn't I just connect the - (minus) pin of the leds to the ground pin of the Pi so the leds voltage would now be from 0 to 1.5 from Pi's perspective?
Which of the few LEDs?
Whichever you choose, when it's off, if one of the others is on, that one's cathode will be negative wrt the Pi's ground
Probably there is a big chance that the leds minus and the displays ground conicide? I can measure the voltage between them..
Possibly, not probably.

If I were designing it, some years ago, I would have connected all the LED anodes to the positive rail of a 15v supply, and driven them from a CMOS 4000-series chip.
I would have driven the display from a separate 5v supply.
In fact, that's exactly what I did on my HiFi amp, 20 years ago!

6hearts
Posts: 16
Joined: Sat Dec 26, 2015 1:25 pm

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 9:12 pm

I've took a picture of the controller, the leds, display and buttons are visibe.

One possibility would be to glue a bunch of photoresistors to the display on it and read the data through them. possibly through a multiplexor...


heat-pump-front2.jpg
FRONT
heat-pump-front2.jpg (61.53 KiB) Viewed 1912 times


heat-pump-back1.jpg
BACK
heat-pump-back1.jpg (61.76 KiB) Viewed 1912 times

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 9:32 pm

6hearts wrote:I've took a picture of the controller, the leds, display and buttons are visibe.

One possibility would be to glue a bunch of photoresistors to the display on it and read the data through them. possibly through a multiplexor...


heat-pump-front2.jpg


heat-pump-back1.jpg
Might be cheaper / easier / quicker to attach a camera and use OCR

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: Sensing leds, 7-segment displays...

Sun Jan 31, 2016 11:04 pm

asandford wrote:
6hearts wrote:I've took a picture of the controller, the leds, display and buttons are visibe.

One possibility would be to glue a bunch of photoresistors to the display on it and read the data through them. possibly through a multiplexor...


heat-pump-front2.jpg


heat-pump-back1.jpg
Might be cheaper / easier / quicker to attach a camera and use OCR
Ugh.
Talk about "barnacle engineering.”

I would just de-mux the LEDs myself.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Sensing leds, 7-segment displays...

Mon Feb 01, 2016 12:30 am

rzusman wrote:
asandford wrote:Might be cheaper / easier / quicker to attach a camera and use OCR
Ugh.
Talk about "barnacle engineering.”
I would just de-mux the LEDs myself.
This is the controller to his heat pump. If he screws up the controller to his heat pump, he won't have heat. It is currently winter. I would absolutely recommend non-invasive means of reading the LED values.

User avatar
hansotten
Posts: 341
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Sensing leds, 7-segment displays...

Mon Feb 01, 2016 7:43 am

Seeing the lcd display, thats a multiplexed display indeed.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

User avatar
karrika
Posts: 1124
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Sensing leds, 7-segment displays...

Mon Feb 01, 2016 8:06 am

I am currently facing a similar problem with controlling a hot plate. Reading a 7-segment display with a camera is a bit more attractive than soldering your own electronics in a device with strong currents and high temperatures.

If the camera is in a fixed position you just need to take a snapshot of the 7-segment display. Then you read the pixel value from the middle of every segment and decide if the segment is on or off.

A small script can then map the segment vector to a digit. If no sensible digit is found you can always take a new snapshot. To get rid of multiplexing effects you can take a lot of pictures and calculate the average.

Perhaps you can use small solenoids to press the physical buttons? Relay cards and solenoids are cheap on ebay.

You may also consider what the possible hazards could be. And how does your insurance company react to modification of the heater electronics. Sorry for taking up this point. But it may be worth to analyze this aspect too.

Return to “Automation, sensing and robotics”