Author Topic: Simple question  (Read 912 times)

0 Members and 1 Guest are viewing this topic.

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: gb
  • Electronics Engineer - Hacker - Nerd
Simple question
« on: April 02, 2020, 02:28:22 am »
Hello everyone. I have been busting my head to find a solution to what seems a simple problem to me.
I want to hack a board (thermostat pcb to be precise).

The logic side of the board has 4 tactile button switches.
When pressed tell the mcu to turn down-up the target temperature , turn on/off  the water heater and turn on/off the main heating system (boiler).
I am not interested in the relay side of the board (that signals the boiler).

My goal is to have the buttons as they are but add a pair of wires on both sides of every button in parallel that when shorted act as the button.
The buttons when not pressed send a logic high (5V) to the mcu and a logic low (0V) when pressed.
The circuit that "shorts" the wires will be controlled by an ESP board.
Problem is i could not think of another solution besides mechanical relays.
It seems pretty easy to solve but i can not think of any other solution. I'm stuck.

EDIT : forgot to say thank you.

Any idea would help.If extra information is needed please ask. I know that the description i gave may be lacking some vital info.

Also i am so sorry about the definitions that i used since i have little to no idea how the heating system elements translate. But that should not be a problem here i hope.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Simple question
« Reply #1 on: April 02, 2020, 02:35:00 am »
Hello everyone. I have been busting my head to find a solution to what seems a simple problem to me.
I want to hack a board (thermostat pcb to be precise).

The logic side of the board has 4 tactile button switches.
When pressed tell the mcu to turn down-up the target temperature , turn on/off  the water heater and turn on/off the main heating system (boiler).
I am not interested in the relay side of the board (that signals the boiler).

My goal is to have the buttons as they are but add a pair of wires on both sides of every button in parallel that when shorted act as the button.
The buttons when not pressed send a logic high (5V) to the mcu and a logic low (0V) when pressed.
The circuit that "shorts" the wires will be controlled by an ESP board.
Problem is i could not think of another solution besides mechanical relays.
It seems pretty easy to solve but i can not think of any other solution. I'm stuck.

EDIT : forgot to say thank you.

Any idea would help.If extra information is needed please ask. I know that the description i gave may be lacking some vital info.

Also i am so sorry about the definitions that i used since i have little to no idea how the heating system elements translate. But that should not be a problem here i hope.

I am confused.
Elaborate on this sentence: "My goal is to have the buttons as they are but add a pair of wires on both sides of every button in parallel that when shorted act as the button."

"to the mcu "  What MCU.  Is this a separate MCU or one that is already on the board?
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
Re: Simple question
« Reply #2 on: April 02, 2020, 02:39:09 am »
Chances are the buttons go to a MCU I/O pin with a pullup resistor (perhaps built-in the MCU) so the button shorts the pin to ground. See if one side of the button goes to ground. So all you need is a BJT or FET output (but not a push pull output) to pull the line to ground to simulate a button press.

On the other hand if there are lots of buttons they may be wired in a matrix with column drivers and row inputs. Typically this is combined with digit scanning of a display. If so then you need CMOS transmission gates to simulate button closure.
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: gb
  • Electronics Engineer - Hacker - Nerd
Re: Simple question
« Reply #3 on: April 02, 2020, 02:47:37 am »
Excuse my poor explanation. I do not recall what is the MCU on the thermostat board. This may help.
NOW : Buttons --> Thermostat's Board  MCU
PLAN : External MCU (ESP8266) --> Unknown Circuitry --> Wires in parallel to the buttons --> Buttons --> Thermostat's Board  MCU
That way the ESP8266 would be able to get a command over the network to "press" the buttons.
I want to simulate a button press while having the original buttons in parallel for offline control.

I hope this clears things up a bit.
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: gb
  • Electronics Engineer - Hacker - Nerd
Re: Simple question
« Reply #4 on: April 02, 2020, 02:51:11 am »
I tried doing that with N-Channel FET's but it only seemed to kill my MCU's (i may have messed up something). That is why i thought of using relays.
All the buttons have a common GND pin and the rest goes to the thermostat's mcu (I have no memory of pull down resistors being on the board)
EDIT: Also found a very bad picture (i took that to help with the mains wiring not the pcb).
The traces from the buttons go straight to the MCU.
« Last Edit: April 02, 2020, 02:57:46 am by ChrisGreece52 »
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Simple question
« Reply #5 on: April 02, 2020, 01:52:11 pm »
Excuse my poor explanation. I do not recall what is the MCU on the thermostat board. This may help.
NOW : Buttons --> Thermostat's Board  MCU
PLAN : External MCU (ESP8266) --> Unknown Circuitry --> Wires in parallel to the buttons --> Buttons --> Thermostat's Board  MCU
That way the ESP8266 would be able to get a command over the network to "press" the buttons.
I want to simulate a button press while having the original buttons in parallel for offline control.

I hope this clears things up a bit.

OK, I get it.  First make sure of the polarity of the buttons as they are now.  Most likely, as possum noted, there is a pullup somewhere (either on the MCU or a resistor on the board), and the button is NO.  If that is the case, it looks to me that you can configure the GPIO as input (high impedance) or output.  Therefore, when you want to activate a button, configure the pin as an output and drive a 0.  Then, to release the button, reconfigure the pin as a high-impedance input.

I have never used the ESP8266, but looking at the datasheet(s), it appears that you can do this.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8760
  • Country: fi
Re: Simple question
« Reply #6 on: April 02, 2020, 01:55:54 pm »
An optocoupler is simpler and cheaper than the relay.

Connect the emitter to the negative side of the button, and the collector to the positive side. Driving the optocoupler is just driving an LED: just a series resistor to your IO pin.

This way, you retain the galvanic isolation like you do with the relays, and don't need to combine the grounds of the devices.
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: gb
  • Electronics Engineer - Hacker - Nerd
Re: Simple question
« Reply #7 on: April 02, 2020, 02:48:38 pm »
Thank you very much for your replies. I will try the optocoupler solution first because i would like to keep the circuits isolated from one another. If that turns to be ineffective i will tie the grounds and try driving the button directly from the MCU.
EDIT: Since i am a moron i powered the circuit on my bench not noticing a small piece of solder below the board.... after a good short circuit that fried the on board regulator (LM78L). I replaced the whole thing temporarily with an esp8266, i2c lcd, 2 dht11 temperature/humidity sensors and 2 relays for the burner and the boiler control. Anyway since the smart wifi modules that support boiler and burner control are upwards 100 EUR , i took up the project of designing and building my own thermostat.
« Last Edit: April 04, 2020, 06:41:06 pm by ChrisGreece52 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf