I'm working on a project to add smart home functionality a set of 5 cheapo RC outlets. I'm using an ESP-01 with the fauxmoESP and rc-switch libraries. I've got the code and hardware all figured out and it's working. However, I'm stuck on the final integration with the circuitry in the outlet. The idea is to just add the ESP-01 as a secondary input to the (unmarked) control chip in the outlet so that it can be used as a smart home device as well as with the existing remote transmitter. So I've got the digital output from the RC module in the outlet as well as the digital output from the ESP-01. My thought was to just put a diode in-line with each output to prevent any reverse current flow. I'm not worried about both outputs firing at the same time since that would be a very rare occurrence - unless that could potentially do some damage. Is that a workable solution? All my research about multiplexing pointed to more complex circuits, so I feel like there is something I'm not understanding. Or that I'm not technically trying to multiplex.
Also, when I did test putting a 1N4148 diode inline with the output of the ESP-01, it stopped triggering the circuit. I assume this is because the ESP is running at 3.3v and the voltage drop through the diode was enough so that it didn't work with the 5v circuit in the plug. Or am I not understanding something here as well? It works fine without the diode when I'm feeding the circuit in the outlet with my 3.3v supply.
And yes, I could save myself some trouble by pairing an ESP-01 with the remote transmitter or an RC transmitter module to controller all the outlets via RC, but I already started down this road.
Photos, diagrams of how you connected parts, measurements of the voltages inside the devices, measurements of the control signal inside, frequencies of the existing remote control and so on.
Also, when I did test putting a 1N4148 diode inline with the output of the ESP-01, it stopped triggering the circuit. I assume this is because the ESP is running at 3.3v and the voltage drop through the diode was enough so that it didn't work with the 5v circuit in the plug. Or am I not understanding something here as well?
Yep you are not.
A diode in series with a logic signal will pass through a logic HIGH but the diode will prevent the logic input from ever seeing a logic LOW. Remember the opposite of not getting a HIGH is to have the logic input float and floating is not a logic lever.
If you want to do this then you have to have a pull down resistor on the logic input. Then you might run into the voltage issue.
By the way this is nothing to do with multiplexing, which is fully called time division multiplexing. There is a frequency division multiplexing but it is nothing to do with they either. What you are trying to do is to make a logic OR gate with diodes.
So I hear what I need is a logic OR gate. Does this look like what I need?
How would I go about determining what component values I need? And for learning's sake, what would be the consequence of just directly bridging the 2 outputs? Would the reverse voltage destroy the non-active circuit or would it only be a problem if they both activated at once? Thanks again!
How would I go about determining what component values I need?
You don’t need any resistor in the transistor’s base because you have the transistors in an emitter follower mode. And R2 is a standard pull down resistor so 10K should do.
But you are in the same situation regarding voltage drop as diodes. Using an emitter follower you can only get the voltage on the emitter to be 0.7V lower than the voltage on the base. So you might run into the same voltage problems.
What I tested was a diode only OR gate and was able to get it to work with a 2.2k pull down resistor with only the ESP-01 input. Higher resistor values would only turn the circuit on, but not off. Next test will be the fully integrated circuit with the outlet powered up (so far I've only powered the logic circuit in the outlet from my 3.3v power supply). Thanks for the help!
Thanks. I will give that a try. However, it looks like the current needed by the ESP-01 is too much for the built-in 24v supply (or 5v - tried both). It's able to power up the ESP-01 and it connects to wifi. But when I send the on signal, the relay clicks on then off, the 24v volts drops to 3v and the ESP-01 shuts down. So I assume some overcurrent protection kicks in when the relay and ESP-01 are powered at the same time. I'm going to switch my effort to controlling a transmitter rather than the receivers. I just liked the idea of each outlet having it's own wifi, but only having to build one circuit for the transmitter will be a lot easier. Here is the final schematic I was testing.
I didn't want to try and diagram out the whole circuit on the outlet, but I have labelled some of the components on the picture. It does appear that there is a reverse biased diode just below the left pin on the relay coil. There is an MPX capacitor and large resistor on the line feeding the bridge rectifier. I first tried to power the ESP-01 from the 5v supply via a 12-5v to 3.3v regulator, but that shut down as soon as I connected the ESP-01. That's when I went to the variable 24v regulator (set to about 3.8v as I couldn't get the ESP-01 to function when set to 3.3v). That's the circuit that shut down once the relay was activated. If there are any creative ideas on how to pull the required current out of the existing outlet circuit, I'm all ears. Thanks again!
I didn't want to try and diagram out the whole circuit on the outlet
When posting a schematic you need to supply ALL the information. What you posted was very misleading.
What you have put is a block that is simply labelled "RC outlet PCB1". How is anyone supposed to know what that is?
Now how do you know what the data format coming from that outlet is?
Have you a data sheet for this device?
Being a mains device you hacked how do you know that what you marked on that photograph as the Data Gnd and 5V are isolated from the mains. I would worry about that and do some earth leakage measurements, if I could borrow the equipment for PAT testing.
Grumpy_Mike:
Being a mains device you hacked how do you know that what you marked on that photograph as the Data Gnd and 5V are isolated from the mains?