Direct contact to infrared receiver from microcontroller - Page 1
Forum section: electronics / beginners

author: xonecell
author_rank: Newbie
timestamp: February 23, 2020, 02:40:28 pm
content: Hello everyone, I have posted this question also on arduino forumshttps://forum.arduino.cc/index.php?topic=659817but I think that i'm stuck now and need to get help here.So basically I have an old DVD player that has an IR (infra red) receiver and I would like to automate it with a NodeMCU micro controller. I can do it the easy way: record IR receiver signal and then replay it from IR transmitter using MCU. However, I don't want to do it this way, maybe because I want a different, more difficult solution or i'm just dumb. I would like to drive the IR receiver without using IR transmitter, using some sort of direct connection from MCO to IR receiver.What has been done so far:Original plan was to use transistor that would control the signal that the DVD player receives like this:However I got a lot of noise and so another user suggested that I use optocoupler like this:And I still got noise, I was suggested that MCU probably can't output enough miliamps (MCU gave 10mA) to optocoupler (max operating with 60mA) so I changed the scheme to use external power that controls the optocoupler:Credits to 6v6gt from forum.arduino.ccHeres the result using transistor together with optocoupler:You can see that it sort of looks like IR NEC protocol.This now ALMOST gives what I wish to achieve, but still has a lot of noise. I don't have the right equipment or knowledge to understand what is causing it and would really appreciate suggestions and help.Thank you for reading this.

author: radiolistener
author_rank: Super Contributor
timestamp: February 23, 2020, 04:53:00 pm
content: First, try to send packets through simple capacitor. When you done it, you can replace capacitor with IR led and IR photodiode

author: xonecell
author_rank: Newbie
timestamp: February 23, 2020, 08:16:28 pm
content: Quote from: radiolistener on February 23, 2020, 04:53:00 pmHi, im sorry I didnt quite get your idea, can you explain some more or draw diagram? Thanks

author: radiolistener
author_rank: Super Contributor
timestamp: February 24, 2020, 06:06:56 am
content: The idea is to learn what ismodulationand how it worksJust connect some capacitor (about 1 nF) between two microcontroller pins and try to send data packet through capacitor

author: Buriedcode
author_rank: Super Contributor
timestamp: February 24, 2020, 09:37:30 pm
content: You will probably get a fair bit of noise from the IR receiver itself - it'll have internal filters and AGC to only respond to 36-40Khz signals, but even with heavy filtering on its power line it'll still output almost random pulses. Is the noise present without your modifications? ie: on the data line without anything else connected.As you're using an optocoupler, I'm assuming the MCU is running off a completely different supply to the DVD player (no common ground). You could disconnect the optocoupler from the DVD player completely, add a pull-up resistor and check the collector output to see if the noise is coming from your MCU.You have the right idea using an optocoupler (for isolation) or an NPN (for when the unit has common ground) but the IR receiver will have a built-in pull-up on its output (which is open collector) so it shouldn't just pick up noise on that line. It could even be interference in your logic analyzer, that a string pull-up or double checking solid probe connections would sort out.

author: bingo600
author_rank: Super Contributor
timestamp: February 25, 2020, 05:12:53 pm
content: My Vishay 38KHz receivers likes 100nF across the supply pins , and a 4.7uF elco somewhere wouldn't hurt too/Bingo

author: xonecell
author_rank: Newbie
timestamp: February 25, 2020, 08:10:06 pm
content: Quote from: Buriedcode on February 24, 2020, 09:37:30 pm" Is the noise present without your modifications? ie: on the data line without anything else connected."No, that's the thing, I don't get any noise, I have what seems to me a clean HIGH signal, I am measuring it with a cheap logic analyzer like this:But it is pretty precise to me."As you're using an optocoupler, I'm assuming the MCU is running off a completely different supply to the DVD player (no common ground)."Yes i am running MCU with my PC usb power suppy, maybe there noise is because logic analyzer and MCU both are from the same PC?DVD player uses power from 200V socket."You could disconnect the optocoupler from the DVD player completely, add a pull-up resistor and check the collector output to see if the noise is coming from your MCU. "I tried to read MCU output directly from pins with logic analyzer and the output was also clean, will try with resistor, thanks." but the IR receiver will have a built-in pull-up on its output (which is open collector) "the IR receiver is a typical one, I bought a random one from aliexpress and it worked."It could even be interference in your logic analyzer, that a string pull-up or double checking solid probe connections would sort out."It could be, its a cheap device, I will try to get into my schools lab, they have osciloscopes. Sorry, I didn't understand what you meant by string pull-up or double checking solid probe connections, could you explain?Huge thank you for spending time to give some help, I really appreciate it, will not give up on this project. Thank you!

author: Renate
author_rank: Super Contributor
timestamp: February 25, 2020, 10:00:53 pm
content: Huh? Am I missing something here?Are you trying to inject 38kHz stuff into the OC input?The IR receiver does demod, you need to inject the baseband signal.I don't know what the protocol is, but it should be something like low for 4 mS, then high for .5 mS then low for 1 mS...

author: xonecell
author_rank: Newbie
timestamp: February 26, 2020, 09:12:07 am
content: Quote from: Renate on February 25, 2020, 10:00:53 pmHi, my goal is to inject unmodulated data from MCU to DVD player. So that the DVD player thinks its getting data from IR receiver but it is actually MCU. I want to be able to control DVD player with remote and MCU. My idea is to manipulate what voltage the DVD player receives using transistor and optocoupler Thanks

author: Renate
author_rank: Super Contributor
timestamp: February 26, 2020, 12:23:35 pm
content: Well, I'm clear on what you're trying to achieve.I was just confused by all your logic analyzer snapshots.I couldn't see the time scale and all the S's are clipped.Also, there doesn't seem to be any indication of the logic analyzer's sample rate.Things can look mighty strange when it's too low.Why don't you look directly at the uP's output (and not on the OC) to see if that is clean?

author: Buriedcode
author_rank: Super Contributor
timestamp: February 26, 2020, 04:37:58 pm
content: I have one of those logic analyzers. They are quite handy and work well, but often the dupont cables they come with (as are many of the same female-female cables available these days) can be pretty unreliable. Given the input impedance of these LA's, you could select all channels, but only connect one to a signal, and all the channels can show the input waveform, because the unconnected inputs can be coupled through noise. It also looks a lot like those waveforms - random very short spikes/dips in the signal.So, whilst it may seem simple, use a different female-female cable, and a different channel on the LA.In terms of ground loops, your LA is powered via USB from the PC, and the MCU is powered by... the PC as well? I don't really see how their common ground could cause noise large enough to be picked up by a logic analyzer.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 26, 2020, 04:44:45 pm
content: Quote from: xonecell on February 25, 2020, 08:10:06 pmSorry, it was a typoStrongpull-up. What that means is, the Logic analyzer has such a high impedance, noise can couple to the inputs if they aren't connected, or are connected to a relatively high impedance output. Adding a pull-up (or pull-down, but pull-up would be better for the IR module data output) resistor of say, 10k would keep the input at a known level in case of poor connections.I made a small adapter that plugs into that logic analyzer with DIP switches, that just adds a pull down or up (selectable) to each channel, purely for this purpose.

author: xonecell
author_rank: Newbie
timestamp: February 26, 2020, 07:28:10 pm
content: Quote from: Renate on February 26, 2020, 12:23:35 pm"I was just confused by all your logic analyzer snapshots"Well, it's not easy for me to draw them so that its easy to understand haha."I couldn't see the time scale and all the S's are clipped."its in miliseconds if it helps, this is unmodulated signal. Can you explain what S's is?"Also, there doesn't seem to be any indication of the logic analyzer's sample rate."sample rate is quite high I think, 4 MS/s which i think is way more than needed."Why don't you look directly at the uP's output (and not on the OC) to see if that is clean?"Again, sorry for asking, but I don't understand what you mean by UP's and OCThank you

author: xonecell
author_rank: Newbie
timestamp: February 26, 2020, 07:41:33 pm
content: Quote from: Buriedcode on February 26, 2020, 04:37:58 pm" but often the dupont cables they come with (as are many of the same female-female cables available these days) can be pretty unreliable"yes this is a possibility, but I recorded the signal with LA without any modifications to scheme, to record the original signal, recorded it 4 different times and they were all pretty much identical."In terms of ground loops, your LA is powered via USB from the PC, and the MCU is powered by... the PC as well? I"Yes you are correct, LA --> PC and MCU --> PCI will try to use different wires and channel, thank you

author: Renate
author_rank: Super Contributor
timestamp: February 26, 2020, 10:13:52 pm
content: Quote from: xonecell on February 26, 2020, 07:28:10 pmIf you are looking at the junction of the IR receiver output, the pullup resistor and your own transistor/optoisolatoryou are looking at the logical NOR of the IR receiver and your circuit.First we have to see that your circuit is putting out a clean signal.Look directly at the pin out of the uP (that's feeding a transistor base or opto).

author: Buriedcode
author_rank: Super Contributor
timestamp: February 27, 2020, 12:43:07 am
content: I'm guessing it was just the abbreviation that confused him. UP - microprocessor (technically microcontroller). OC - open collector.