I recently bought touch lamp circuits (see below).
https://tinyurl.com/ya4va4ua
These are fantastic. I have installed them on every single lamp I own. All you have to do is touch the metal frame of the lamp and it turns on, no actual physical switch. I have also just last night succesfully attached it to home automation. I installed along side of the touch switch a wemos and a prototyping shield with a bc548 and a 15k resistor on it, Powered by transformer down to 240 to 5v. Works a treat.
When someone touches it, there is a sense wire that gets pulled to ground because the person touching it is ground, which signals the lamp board to turn the light on. the wemos does the same thing with the bc548 by pulsing it to ground and it turns on.
The problem I am having is when a person touches it, the wemos with ESPeasy doesn't know that it is touched so there is no feedback to domoticz. On the domoticz page it still shows as "off" but the light is physically "on"
Do you guys have any suggestions on how to remedy this?
I was thinking of 2 possible solutions. Below is a diagram to give you a graphical representation of how its wired up .
1 ) I need to "sense" if there is AC voltage on the white wire. I dont need to know the current or voltage, all i need to do is tell if its there. But how do i do that? I can't really find anything on aliexpress that would align for my project. Because When I touch the lamp, the circuit opens and allows current to flow through the white wire and back to the black wire. Any suggestions? The few things I did find on ali were only rated up to 24v ac. I need 240v.... I tried dropping the voltage down with a series of 10x10m resistors but that only brought it down to 50v. Plus even if I were to attach more and get it down to 24v ac. I dont think the wemos would like it.
2) since the sense wire (yellow) is being touch, it is being pulled to ground. I could have another transistor in parrallel to the BC548 but flipped to when the base is pulled down via the sense line it would signal back to a GPIO pin on the wemos then I can have espeasy handle it from there. However I am not sure if that would work.
Do any of you have ANY suggestions at all?
Edit: forgot to add power to the wemos diagram. i am not going to fix it, just imagine it is there. its not really part of the problem so its fine missing
