Advice for tapping into existing circuits with a microcontroller - Page 1
Forum section: electronics / beginners

author: Fapiko
author_rank: Newbie
timestamp: February 25, 2020, 04:59:22 am
content: 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!

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 25, 2020, 05:16:30 am
content: Be careful, the low side of your IR receiver is not necessarily ground. Find the real ground.Seehttps://youtu.be/xaELqAo4kkQ

author: Fapiko
author_rank: Newbie
timestamp: February 25, 2020, 05:22:46 am
content: Yep I watched that video a couple times while waiting for my scope to get here. Any advice for finding actual ground in the circuit? As well as difference between ground and low side? Don't recall seeing that in the video but it's been a few days since I watched it.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 25, 2020, 06:02:32 am
content: Use a multimeter. Probe the device unplugged with the meter in voltage mode. Look for zero volts. (Don't use continuity mode because there could be a charge somewhere.)This is kind of hard to answer beyond that. There are a few ways the controller board may be hooked up. My main concern is that if you are causing you IR circuit to fail with the scope attached, you might shorting something out. If you got more or less the same reading without your probe's ground you were most likely grounding the test through the AC of your house.Sorry I'm no expert.Also, you don't want to isolate your AC powered test equipment. You want to isolate your device under test (DUT). Even if you broke off your ground pin on your scope's the scope will still be connected to ground through your neutral AC wire. Earth and Netural are bonded in the service panel.