Author Topic: Direct contact to infrared receiver from microcontroller  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Direct contact to infrared receiver from microcontroller
« on: February 23, 2020, 02:40:28 pm »
Hello everyone, I have posted this question also on arduino forums https://forum.arduino.cc/index.php?topic=659817 but 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.cc

Heres 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.
 
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3430
  • Country: ua
Re: Direct contact to infrared receiver from microcontroller
« Reply #1 on: February 23, 2020, 04:53:00 pm »
First, try to send packets through simple capacitor. When you done it, you can replace capacitor with IR led and IR photodiode :)
 

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Re: Direct contact to infrared receiver from microcontroller
« Reply #2 on: February 23, 2020, 08:16:28 pm »
First, try to send packets through simple capacitor. When you done it, you can replace capacitor with IR led and IR photodiode :)

Hi, im sorry I didnt quite get your idea, can you explain some more or draw diagram? Thanks
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3430
  • Country: ua
Re: Direct contact to infrared receiver from microcontroller
« Reply #3 on: February 24, 2020, 06:06:56 am »
The idea is to learn what is modulation and how it works :)

Just connect some capacitor (about 1 nF) between two microcontroller pins and try to send data packet through capacitor
« Last Edit: February 24, 2020, 06:17:12 am by radiolistener »
 
The following users thanked this post: Simon_RL

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1615
  • Country: gb
Re: Direct contact to infrared receiver from microcontroller
« Reply #4 on: February 24, 2020, 09:37:30 pm »
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.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Direct contact to infrared receiver from microcontroller
« Reply #5 on: February 25, 2020, 05:12:53 pm »
My Vishay 38KHz receivers likes 100nF across the supply pins , and a 4.7uF elco somewhere wouldn't hurt too

/Bingo
 

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Re: Direct contact to infrared receiver from microcontroller
« Reply #6 on: February 25, 2020, 08:10:06 pm »
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.

" 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!
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Direct contact to infrared receiver from microcontroller
« Reply #7 on: February 25, 2020, 10:00:53 pm »
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...
 

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Re: Direct contact to infrared receiver from microcontroller
« Reply #8 on: February 26, 2020, 09:12:07 am »
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...

Hi, 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
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Direct contact to infrared receiver from microcontroller
« Reply #9 on: February 26, 2020, 12:23:35 pm »
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?
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1615
  • Country: gb
Re: Direct contact to infrared receiver from microcontroller
« Reply #10 on: February 26, 2020, 04:37:58 pm »
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.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1615
  • Country: gb
Re: Direct contact to infrared receiver from microcontroller
« Reply #11 on: February 26, 2020, 04:44:45 pm »

"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?

Sorry, it was a typo :( Strong pull-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.
 

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Re: Direct contact to infrared receiver from microcontroller
« Reply #12 on: February 26, 2020, 07:28:10 pm »
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?

"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 OC

Thank you

 

Offline xonecellTopic starter

  • Newbie
  • Posts: 6
  • Country: lv
Re: Direct contact to infrared receiver from microcontroller
« Reply #13 on: February 26, 2020, 07:41:33 pm »
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.

" 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 --> PC
I will try to use different wires and channel, thank you
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Direct contact to infrared receiver from microcontroller
« Reply #14 on: February 26, 2020, 10:13:52 pm »
I don't understand what you mean by UP's and OC
If you are looking at the junction of the IR receiver output, the pullup resistor and your own transistor/optoisolator
you 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).
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1615
  • Country: gb
Re: Direct contact to infrared receiver from microcontroller
« Reply #15 on: February 27, 2020, 12:43:07 am »
I'm guessing it was just the abbreviation that confused him.  UP - microprocessor (technically microcontroller). OC - open collector.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf