I'm an enterprise software developer just getting into some home automation stuff for fun using micro controllers. For my most recent project I thought it would be neat to control the space heater in my room with an ESP32. The most direct way, I originally thought, would be to tap into the IR sensor. From here I'd be able to log the inputs from the remote to map them to the commands and output them with the ESP32 in order to make it do stuff.
Right now I'm having a difficult time tapping into the sensor in order to even receive the signals. I have an imgur album with photos of my scope output:
https://imgur.com/a/PAJZVD9#1 is me reading the signal directly off the sensor signal pin. One thing I noticed is that if I hooked my scope up to the ground pin of the sensor the heater stopped responding to remote control commands, though I could still see the signal data on the scope. I assume this has something to do with the scope not being isolated? Scope still works without ground hooked up - not sure what the proper procedure is here. Whether ground of the probe should always be attached to the circuit somewhere or if it's ok to leave it off?
#2 is a photo of the signal after going through an op amp (LM358) just wired up as a buffer to try to isolate the signal so I can read it with the microcontroller.
#3 shows the output of the buffer when not pressing anything on the remote. Seems like the op amp is causing it to regularly drop to ~1v every 15ms or so.
Here are some questions I have about how to proceed:
- If I connect the ground on my probe to ground on the sensor the heater circuit seems to fail to continue to respond to commands by remote. Is this because my scope isn't isolated and shorting something?
- What's the best way to read the signal coming out of the sensor? Is my approach of using an op amp as a buffer the best way to proceed?
- If using the op amp is a good way to go - how do I transform the signal to be 0-5 or 0-3.3v? It seems to be converting it from -5v-0v to 3v-4v. Should I use another op amp to handle transforming the signal to a range the microcontroller can read?
- Any ideas as to why I'm seeing a regular signal drop on my op amp in photo #3? I don't recall seeing that when I was looking at the sensor signal line directly so my inclination is that the op amp is injecting it?
- I attempted to use a photocoupler (PC817) by wiring the signal pin to the anode and ground to the cathode. This also caused the heater to stop responding to remote commands - any advice here would be appreciated.
I'm happy to do my own research and such - mainly looking for some guidance to point me in the right direction of where to go from here. As I said, I'm pretty new to EE type of stuff and am still early on in learning. As it stands I'm just kinda fumbling around trying things to see what works - any and all advice is appreciated!