Generating non-Sony Infra Red signals

slimplynth

Senior Member
Hello all

Was hoping to get some advice on generating non sirc signals.

I've breadboarded IR transmitter and receiver circuits, using Virtins sound card oscilloscope to capture infra red signals from my Daewoo telly remote.

Capturing the signals was the easy part, generating them was slightly more taxing - getting the TV set to respond is proving impossible.

Using the code below to capture then measure then tweak each variable for timing until the profile for the picaxe generated IR sequence is almost identical to the 'volume-up' signal given by the remote control.

Is this method doomed to fail?

I knew that timing would be critical so I used a 20X2 set to warp speed Setfreq M64. I make the max difference on the 'Squelch high time' (for the header section to be 0.0319 ms

The next thing I was going to try was take more readings from the remote, make more measurements then aim for the average... any thoughts?

The sound card oscilloscope was very easy to use; tried to do this a couple of years ago without an SCOsc and the code would never have done what it needed to do.

It's nice to see on screen what is actually (using that term loosely in case there are any philosophy students reading) happening. I was put off back then by the idea of plugging anything into my tower's mic socket that wasn't a mic... really glad I took the risk this time.

Cheers

Code:
setfreq m64

symbol Squelch_Hi = b0 'This is the high section of the header
symbol Squelch_Lo = b1 'This is the Low section of the header
symbol Zero_Lo = b2
symbol Zero_Hi = b3
symbol One_Lo = b4
symbol One_Hi = b5
symbol Address_Lo = b6
symbol Gap_Lo = b7

Squelch_Hi = 528/10
Squelch_Lo = 29
Zero_Hi = 49/10
Zero_Lo = 19/10
One_Hi = 48/10
One_Lo = 990/100
Address_Lo = 30
Gap_Lo = 950


main:

' This section generates the header 
pwmout pwmdiv4, C.5, 104, 211
pause Squelch_Hi
pwmout pwmdiv4, C.5, 00,00
pause Squelch_Lo
pwmout pwmdiv4, C.5, 104, 211

' This section generates the Adress Code 
Gosub Zero
Gosub Zero
Gosub One
Gosub Zero
Gosub One
Gosub Zero
Gosub Zero
Gosub Zero
Gosub Address
' This section generates the function code 
Gosub One
Gosub One
Gosub Zero
Gosub Zero
Gosub One
Gosub Zero
Gosub Zero
Gosub Zero
Gosub Zero

' This section generates the gap between repeat signals 

Pause Gap_Lo

Goto main

Zero:
pwmout pwmdiv4, C.5, 104, 211
pause Zero_Hi
pwmout pwmdiv4, C.5, 00,00
pause Zero_Lo
Return


One:
pwmout pwmdiv4, C.5, 104, 211
pause One_Hi
pwmout pwmdiv4, C.5, 00,00
pause One_Lo
Return


Address:
pwmout pwmdiv4, C.5, 104, 211
pause One_Hi
pwmout pwmdiv4, C.5, 00,00
pause Address_Lo
Return
 

Attachments

slimplynth

Senior Member
Cancel that :D It works !!! :D I have the biggest daftest grin on my face...

Err now for the part where I admit to small bit of stupidity, the reason it didn't work was that the range was too far. It's setup on two breadboards so that the transmitter and receiver can face each other. Just had to unplug everything and carry to the TV and voilla.

There are now two projects I have in mind.. one involves usurping control of the office Aircon system so that the majority of us normal people can work in comfort an secondly my uncle has a supposedly water proof remote control for his bathroom telly.. they cost 48 quid a pop and two have now suffered corrosion on their pcb tracks. The picaxe remote will not look as slick but will definitely be cheaper.

Apologies in advance if you'd already started to type :eek: but thanks anyway. I think I just need to try new batteries or choose a different resistor for the IR LED to extend the range.
 
Last edited:

BillyGreen1973

Senior Member
Simplynth,

what circuit have you used for the mic input on the PC soundcard scope?

I was thinking of having a go at this to help 'reverse engineer' an LED display driver from an arcade machine.
 

slimplynth

Senior Member
Pebble:

Code:
Terminal||198|258|1||TS?||3|4|Terminals||terminal_431
Resistor|4700|203|80|2|Resistor|R?||2||IC||
Wire||721|75|11||11|#FF0000|3|11|||
Wire||425|212|11||11|#000000|2|11|||
Wire||234|104|21||11|#000000|2|11|||
Resistor|47000|211|206|1|Resistor|R?||3||IC||
Resistor|22000|319|234|1|Resistor|R?||3||IC||
Resistor|100000|319|179|1|Resistor|R?||3||IC||
Wire||721|102|11||11|#000000|3|11|||
Wire||477|104|21||11|#000000|2|11|||
Wire||315|159|21||11|#FF0000|9|11|||
Wire||288|104|21||11|#000000|11|11|||
Note||54|245|2||||2||Pin one of TSOP receiver||NOTEPAD_22
Note||317|339|1||||2||To PC >>> mine gave 1.2v max||NOTEPAD_21
Transistor|BC559|209|268|1|Transistor|Q?|||1|IC||transistor_11
Wire||261|104|21||11|#FF0000|3|11|||
BREADBOARDSTYLE=BB5
SHOWTHETOPAREA=false
Hope this helps, errr on second thoughts... It would be nice if one of the moderators could say something like "yeah that looks like it won't turn your PC into a nice brick"

Liability weasel words aside I've had it connected constantly for around a week with no probs.

I read that 1.7V was the max voltage input to a mic socket depending on the motherboard!!! so I used a potential divider that gave 1.2V to air on the side of caution.

Like I say, one of the main things that put me off using a sound card to do this 2 years ago was that this PC was one of my best.. now It's on it's side looking like a bin of PC components. The software I used states resolution is affected by a PC's available RAM, my PC sounds like it's about to take off. (AMD 64bit 2.19Ghz with 1GB of RAM)

re. the pebble, tried to make the TSOP sensor using a couple of other components.. labelled pin 1.. viewed from the top... see this pdf

http://www.rev-ed.co.uk/docs/axe040.pdf

Also the supply is 3x AA batteries (from Maplins)
 

Attachments

Last edited:

BillyGreen1973

Senior Member
Simplynth,

thanks for the effort!
I was actually refering to the scope 'probe' circuit, i.e. potential divider, cap coupling etc..

I have to say the 'code' window in your post, makes no sense to me what so ever, I've never really got into Pebble so it's VERY unfamiliar. How do you use the 'code' layout you posted?
 

slimplynth

Senior Member
Theres a link above the pebble code Billy, click it and download the pebble zip file from one of the kind hosts... it's a great tool, cuts out a lot of ambiguity when trying to explain a circuit (imo)

When you download the zip file, unzip it to your PC and there should be an html file called pebble.. open it and at the bottom of the screen (bottom left) there's a Load/Save button.. just copy the code above into the window then click load.. should show you what resistors I used if you right click them.

On that pebble there's a note showing the wire that feed into the mic socket.. the circuit for the probe is actually on there.. I ignored the recommended caps because it worked straight away without.

You need a 3.5mm plug, stereo or mono... the red wire in the pebble connects to the centre pin on the plug..
 

slimplynth

Senior Member
No worries, just make sure you get a multi meter out and double check the voltage on the tip of the phono plug to make sure it's not giving out 4.5V because I'm guessing some magic smoke will billow from somewhere if it is. When an IR signal is received the voltage drops so without a signal it should read a constant 1.2v (ish) at the plug for the mic socket.
 

hippy

Technical Support
Staff member
without a signal it should read a constant 1.2v (ish) at the plug for the mic socket.
Isn't even a volt technically far too high for a mic input ? For line in it may be more suitable. Hopefully it should just clamp to the supply and not burn anything out but who knows.

This is what has always scared me off using sound cards for scopes; get it wrong and you could be waving goodbye to your motherboard and everything on the hard disk.
 

slimplynth

Senior Member
Cheers for checking Hippy, well I haven't had any probs (yet) saw 1.7V stated as a max... so maybe got lucky so far. This is what put me off the SCOsc - no risk no gain, if it had blown my PC then a lesson learned anyway.

That said, think I'll change the potential divider to give 0.9V.

(have you restored your old freeserve pages btw?) wish I'd mirrored them now when I had chance - thought it was akin to stealing though.. thanks btw much of the IR knowledge I gleaned from posts by yourself and Inglewood Pete, cheers - really enjoyed this part of my picaxe learnings.
 

slimplynth

Senior Member
Hippy, on the pics I attached in the first post the oscilloscope axis shows that the max volatge was max 0.6V (ish) and min -0.4v(ish) ... My multi meter measured 1.2V Max.. which do I trust? or...:confused:

Cheers
 

eclectic

Moderator
Hippy, on the pics I attached in the first post the oscilloscope axis shows that the max volatge was max 0.6V (ish) and min -0.4v(ish) ... My multi meter measured 1.2V Max.. which do I trust? or...:confused:

Cheers
I'll wait for one of the grown-ups to answer, but

+ 0.6586V to
- 0.456V


= 1.146 V or 1.2 (ish)

e
 

inglewoodpete

Senior Member
For measurement of 5v digital sugnals, it is probably better to use the "Line In" input of a computer, which is less sensitive. Ie less preamplification. The input of the computer soundcard is pretty tough. It will just clip (and distort) signals that are too large. I used a 5:1 attenuator when I used my computer as an ocilloscope.

As an aside, when my kids were younger, the AXE026 (RS232 +/-12v) cable got plugged into the output of my motherboard's sound port. Bye bye to the output of sound! So take care!
 

hippy

Technical Support
Staff member
This is the circuit I used to interface a TSOP18 to a sound card for the IR Protocol Analyser. I ran the TSOP18 from 5V and simply took the open-collector output / 0V to the Mic input.

TSOP18 viewed from top, legs pointing away from viewer ...

Code:
   _    .------------------(
  | |---'              .---(
 (| |---.    -.- +5V   |
  |_|---|-----'        |
       _|_ 0V         _|_ 0V
 

hippy

Technical Support
Staff member
The output is open collector so it can only pull down a voltage towards 0V, sink current not source it. I'm surprised it worked at all but just that pulling the Mic input down does seem to work. It'll need a better electrical engineer than me to theorise why it does work.

It didn't work on the Line inputs.
 

pleitch

New Member
Thanks for this thread - very similar code works on the NEC on an 18m2+ running 32mHz. You just need to adjust the carrier signal to be 1/3 up time (and adjust all the headder and up/down times for the NEC codes). Also have to avoid using gosubs - the very slight delay/overhead stops the codes working.
 

Sanjit Raman

New member
Thanks for this thread - very similar code works on the NEC on an 18m2+ running 32mHz. You just need to adjust the carrier signal to be 1/3 up time (and adjust all the headder and up/down times for the NEC codes). Also have to avoid using gosubs - the very slight delay/overhead stops the codes working.
Hi Pleitch, Do you have the BASIC program for NEC transmission? I am trying to do something similar at the moment. Thanks!
 
Top