how do I modulate an IR LED at 38Khz?

tarantulataramasalata

Senior Member
I am trying to create a IR circuit, where a IR LED activates a remote circuit. There's no data to transmit, just on and off. I have used one of these

http://www.vishay.com/ir-receiver-modules/

I have found that I have to modulate the LED at 38khz. A pulseout command would do the 'mark' bit ok, but I'm not sure how to do the 'space' bit.

Alternatively a short burst of pwmout might do(?), praps someone might help me with the code...

how's this for an 18x:

pwmout 3,3,1

the idea is to get a 50:50 mark space ratio with a duty cycle length of 38khz (approx 0.0000263157 secs, I think...)

Any help appreciated.
 

Dippy

Moderator
I managed it with pwmout.
Chek it out on the Basic Language pdf sheet.
Are you sitting down? Because you may (shock horror) have to dig your calculator out to work out the values to apply.
 

Bloody-orc

Senior Member
ty this: take a 555 chip. create 38kHz pulses with it. shoot this into a AND gate pin 1 and the other input of AND gate connect to Picaxe. and then just send out serial data (or something like that) and you should get nice modulated IR beam
 

manuka

Senior Member
I certainly agree with technical- the 08M has so revolutionised simple RELIABLE 38kHz IR datacomms (both sending & receiving) that it's now the automatic choice.
 

tarantulataramasalata

Senior Member
I would like to stick with a 18x and calculator, if possible, to keep the components simple (quantity of inputs and outputs needed). More complex softwiring is an acceptable trade.

Dippy - how many decimal points did you work to? I don't think the pwmout command can support partial integers.

Will this produce 38khz modulation?: pwmout 3,3,8 (where syntax = PWMOUT pin,period,duty cycles)

Using the formulae:
The PWM period = (period + 1) x 4 x resonator speed
(resonator speed for 4MHz = 1/4000000)
The PWM duty cycle = (duty) x resonator speed

the value of 3 for the period = 0.000004 seconds.

the value of 8 for the duty cycle = 0.000002 seconds.

This should result in turning on and off every 0.000002 seconds. I reckon that dividing 1 by 38000 (38khz) gives you 2.6315789473684210526315789473684e-5 (dippy's scary calculator number!)

Unless there's something wrong with my reasoning, this is the closest one can get to 38khz using this method. The big question ($38000?!?) is whether this is accurate enough? I could try it, of course, but I would appreciate your thoughts on the matter.

Thanks again.




Edited by - tarantulataramasalata on 20/02/2006 21:00:53
 

Dippy

Moderator
With risk of criticizing your casio calculator, here's my old 4 line doings:

symbol FP = 50 ' period for 50% duty cycle
symbol F = 25 ' @ Frequency 38kHz

' This will give a roughly 0.5mS pulse of 38kHz (ish.).

pwmout 3,F,FP
pwmout 3,0,1
(in a loop if neccessary?)

I know it doesn't sound right but it looked pretty good on my calibrated Tektronix 'scope. Its not quite 38kHz, but its well within the acceptable bandwidth of a couple of IR receivers I use. I use a low-power Hitachi device. HAVE you read the data sheet?

You may have to play with OSCTUNE to get it bang on - and it will remain pretty stable over a good temp range, maybe 1kHz over 25oC. NOTE: the tolerance of the PIC resonator!!!!

You won't be able to modulate it as in the proper PICAXE commands, but it does mean you can regularly emit a short blast. Are you making an IR security beam?
(I've just finished one and its pretty darned good.)


And a quick REMEMBER: You may think my figures for duty cycle sound a bit strange for 50%. Well, I was feeding a ZVN4306A FET so you have to adjust slightly for capacitance.
MORAL: GET A DIGITAL STORAGE OSCILLOSCOPE. Calcs are all right to get a good 'ballpark'.

Note: Due to something (probably incompetance) I have never had reliable results from a 555 or a couple of other CMOS mono/astables (4258 I think and somit else but I can't remember.)

I hope I get good marks in your homework.

Edited by - dippy on 2/20/2006 9:30:28 PM
 

tarantulataramasalata

Senior Member
well, I guess I'm going to take the figures you kindly offer and chuck them into a pic and hope that the darn thing does what it is supposed to... thanks

we're making a IR gun for rc cars. we've yet to start messing with the rf bit.

Edited by - tarantulataramasalata on 20/02/2006 22:58:58
 
PWMOUT command is great for generating 38kHz carrier direct from pin 2 on an 08M. This can be gated on and off with repeat PWMOUT commands.

Note also that the 38kHz carrier from pin 2 can be easily gated with serial data from an adjacent pin 1 and amplified at the same time with a BC337 to give HUGE Ir ranges.

We have managed 30 meters +

- Andrew







 
 
No lens. I use 2 IR LED's in the collector load and a very low value current limiting resistor (if any) direct to the +ve.

The base can be connected to pin2 with a 470 Ohm resistor.

I have gated N2400 serial data from an adjacent pin on the 08M with the 38kHz from pin 2 which results in an average IR LED / collector current that is much reduced when only sending occasional bursts of data modulated IR carrier. With 3 x alkaline AA batteries I have removed the IR LED current limiting resistor completely and the IR LED seems to survive. Suggest you dont remove / reduce it until you have everything working correctly! I see the specs for the IR LED's I am using have a peak forward current in excess of 1.2 Amps

As you can see quite a punchy IR serial data transmitter but this has worked in daylight across the street and a few sections away. Night time distances are well in excess of 30 meters.

A standard IR Rx decoder is all that is needed to serin 3, T2400 data at the other end. NOTE the N/T2400 polarity swap needed.

- Andrew

 
RPM7100 series

<i>RPM7100 series are remote control receiver modules. Small-sized, light-weight, and low current consumption modules
have been achieved by using resin mold.
1) Low current consumption. (0.95mATyp.)
2) High ripple rejection.
3) 5 types of holders available for each set.
</i>

I find these will work well on low electrical noise projects direct off the battery with the OP pin connected direct to pin 3.

- Andrew
 

manuka

Senior Member
Andrew is certainly the Kiwi IR data champ, &amp; is talking about IR links TransTasman to Oz!There's an outlet nearby here in NZ (PMB components =&gt; www.pmb.co.nz/components_14.htm <A href='http://www.pmb.co.nz/components_14.htm ' Target=_Blank>External Web Link</a> selling these TSOP1738
&quot;Vishay&quot; style 3 leg 38kHz IR receivers for &lt;1 UK pound as well. Check their other listings- very cheap LCDs etc. 1GBP ~ NZ$2.50 at present

But Andrew hasn't mentioned his initial <i> two IR LEDs </i> trick? Rather than waste diving current in a dropper R, use another IR LED in series with the first. Since each expects ~2V, then the series pair will handle twice that (= the typical 4.5V Picaxe supply) with ease &amp; merrily flash away in synch OK. Stan
 

Michael 2727

Senior Member
Stan,,,&quot;&quot;Andrew is certainly the Kiwi IR data champ, &amp; is talking about IR links TransTasman to Oz!&quot;&quot;
On the news tonight Stan there was a story
about some rather silly people over the last
12 months have been pointing Lasers at aircraft, high powered stuff, the pilots
and police are not amused.
 

Rickharris

Senior Member
Ah yes, but they are not Infra red lasers! they would in that case be invisible.

Stan How far is it to Oz over the water? Is there line of sight (I assume there is)
 

manuka

Senior Member
Geography lesson: NZ-Australia distance some 1200 miles = approx the same as UK-Greece. This is hence rather beyond LOS, although we do get their birds, spiders &amp; bush fire smoke(&amp; jokes)
 

vk6bgn

New Member
Hello All,

Although not IR, I think this link is about modulating very bright LUXEON light emitting diodes over a 100 miles or 160 kms? Lots of technical stuff too.

http://www.bluehaze.com.au/modlight/index.htm

Enjoy,
Steve VK6HV
 

manuka

Senior Member
Steve: That's an exceedingly interesting web site - &amp; surely a Luxeon &amp; Fresnel lens tribute too. Strongly suggest <b>everyone </b> browse it pronto =&gt; <A href='http://www.bluehaze.com.au/modlight/index.htm ' Target=_Blank>External Web Link</a>

I recall the publicity at the time (early 2005) &amp; reflected that only an <i>offshore </i> Australian could have the energy to scale suitable mountains for the 167km/104 mile link. For those of you unaware of Pacific geography, Tasmania (where these trials were held) is the innovative Australian island state,about the size of Scotland, some 240kms off the Oz. mainland.


Edited by - Stan. Swan on 2/24/2006 7:38:50 AM
 
Trans Tasman IR Data Link one stage closer...

http://www.stuff.co.nz/inl/common/imageViewer/0,1445,224681,00.jpg

Caption...
<i>LIGHT ENGINEERING: Len Pentelow (left) and Ron Thompson have seen the light, and now the rest of South Taranaki can too.
MIKE SCOTT/Taranaki Daily News </i>

<b>Taranaki Daily News... </b>


<i>
They'll be light on the night.

THURSDAY , 23 FEBRUARY 2006

Len Pentelow and Ron Thompson have restored the original Fresnel light from the Cape Egmont lighthouse to full working order.

It was built in Sweden 145 years ago and decommissioned in August 1999 to be replaced by an automated beacon.

The Maritime Safety Authority has given permission for the light to be installed in the Cape Egmont Lighthouse Trust replica building, as long as it does not shine seawards.

&quot;The South Taranaki District Council has consented to . . . night demonstrations, but they've reserved the right to withdraw permission if anyone complains,&quot; Mr Pentelow said.

The beam could be seen 25km away in clear conditions.

Neither man had any previous knowledge of lighthouse beacons, nor did they have any technical drawings to guide them.

&quot;We just used our practical farm engineering skills to pull it apart, replace some parts, and get it working properly,&quot; Mr Pentelow said.

</i>

==================================

Some background... This is just up the road from here on cape egmont Nth Island West Coast. It is just down the road from where E. Rutherford lived on a farm for a while...
They are setting up a tribute museum for Rutherford in the new light house building.

http://www.trc.govt.nz/xplorer/xplorer.htm

(Stan... this should work from there to my place in Opunake. &lt;25km easy. Then we will point it to your place in Wellington before the trans Tasman hop.

- Andrew

<img src="wink.gif" width=15 height=15 align=middle>



Edited by - Andrew Bright Sparks NZ on 2/24/2006 7:38:57 AM
 

Dippy

Moderator
Bright enough flashy-thing one end and a good drop of optics t'other end. Not really rocket-science is it?
Am I missing something (apart from some grey cells)??
Big fat laser + OrionOptics telescope&amp;pd and you could bounce it off one of Murdoch's sattellites.
I'm just kidding....
 

Rickharris

Senior Member
Ok Stan, I suspected my Geography wasn't so wrong but willing to ask the question :)

How about bounce off cloud layer? Must be a way to overcome such a challange.

Silver solar powered Blimp mid way? could be an interesting ROV project to keep it in position with GPS, compass etc available at good prices now. It wouldnt need to be very big as long as you could track it.

 
Top