Simple question - Page 1
Forum section: electronics / beginners

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: April 02, 2020, 02:28:22 am
content: 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.

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 02, 2020, 02:35:00 am
content: Quote from: ChrisGreece52 on April 02, 2020, 02:28:22 amI 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?

author: greenpossum
author_rank: Frequent Contributor
timestamp: April 02, 2020, 02:39:09 am
content: 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.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: April 02, 2020, 02:47:37 am
content: Excuse my poor explanation. I do not recall what is the MCU on the thermostat board. This may help.NOW : Buttons --> Thermostat's Board MCUPLAN : External MCU (ESP8266) --> Unknown Circuitry --> Wires in parallel to the buttons --> Buttons --> Thermostat's Board MCUThat 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.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: April 02, 2020, 02:51:11 am
content: 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.

author: Wimberleytech
author_rank: Super Contributor
timestamp: April 02, 2020, 01:52:11 pm
content: Quote from: ChrisGreece52 on April 02, 2020, 02:47:37 amOK, 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: April 02, 2020, 01:55:54 pm
content: 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.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: April 02, 2020, 02:48:38 pm
content: 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.