IR led -> Photo Modulator help needed

satrapus

Member
I'm trying to establish a connection between an ir led and a photo modulator using an picaxe 18m2 on a chi035 board.

Ir led is a TSAL5100
Photo modulator is a TSOP34838 38KHz

I'm using the command pwmout b.3, 25, 51 so that my ir led transmits at 38KHz.
The camera on my phone confirms that the ir led is lit and my multimeter is showing a frequency just over 38KHz.

It's pointed at my photo mod on c.5 but code if c.5 = 1 is not playing ball.

Am I doing something wrong?

Many thanks
 

AllyCat

Senior Member
Hi,

but code if c.5 = 1 is not playing ball.
The correct syntax is IF pinc.5 = 1 THEN .... , but that's probably not a good way to test for a pulsed (i.e. modulated) signal anyway. Try PULSIN or COUNT with a suitable timeout (test or destination).

Cheers, Alan.
 

erco

Senior Member
The TSOP34838 is an IR receiver module, not a photomodulator. It's a variant of the popular TSOP4838 with all sorts of internal circuitry and filters, great for receiving modulated IR control signals. That is, pulsed signals riding on a 38 kHz IR carrier. If you swamp it with a steady (unmodulated) 38 kHz IR signal, it goes low for a fraction of a second then reverts to its normal high status. That is, it's an active low device, so your program should be using a command more like IF pinc.5 = 0 to detect a signal.

Most modern IR modules share those characteristics, active low and NOT continuous signal compatible. You have to work to find one which will receive a continuous 38 kHz signal. The newest one is Vishay's fixed-gain TSSP4038, which replaced their newly-obsolete TSOP4038. Also, if you can find any of the original Sony "tin cube" receivers, those work too, although their center frequency is 40 kHz: http://www.goldmine-elec-products.com/prodinfo.asp?number=G8155B

One workaround to use your existing TSOP34838 receiver is to pulse the carrier. You could do that with a PicAxe, but I consider that a waste of a micro. I often use the attached simple circuit to make IR beacons for robots to track to. It uses a classis LM556 dual timer, one timer generates the 38kHz carrier and the other timer pulses it. There is a narrow range of modulation frequencies that most receivers can detect, so it's possible make several different beacons with a unique frequency so that a robot can distinguish between them.



More on the Vishay 4038 receivers at http://www.vishay.com/company/press/releases/2010/100628irsensors/ and http://www.robotroom.com/PNA4602M-Replacement-1.html
 

satrapus

Member
Thanks to everyone for their answers.

Whilst I'm finding this electronics malarkey very interesting is all completely new to me so please bear with me and my simple questions.

What I basically need is ir led and some sort of receiver.
They will be housed side to side in the same project box.
A reflective mirror some 6" (15cm) away will bounce the ir beam back into the receiver.
I need to monitor this beam and process every time something breaks it.
Given these simple requirements and short range I think the TSOP34838 was a bad choice.
As I am using the chi035 power board I want to minimize external components.
I will look into the TSSP4038 as it sound like what I need.
 

satrapus

Member
Yes, that does exactly what I need.
Only drawback is that my project will live on board an offshore boat and will be battered by waves, sardine guts and intense sun for 12 hours per day.
It may be tricky to install that neatly inside a box whilst preserving protection from these elements.

This is something similar to what I'm after :
[video=youtube_share;0QksFPaxV00]http://youtu.be/0QksFPaxV00?t=46s[/video]

I think a receiver for a continuous 38 kHz signal may be my bet bet.
I didn't even know such a thing exists until you mentioned it.
Then I'll just have 2 small neat holes on the side of my box.

There have been a number of diy and commercial implementation of such machines and they all use a reflector for some reason so I decided to go with the crowd. This may be due to bloody mashed up sardines not reflecting very well.
 
Last edited:

satrapus

Member
The second one only has a specified range of 7-30mm which is too short for my needs.

I think the first one looks good. The receiver look like a diode (It's not a 3 pin photo modulator)
This would be ideal as mounting in a box is simple and neat.
Just have to figure out what the receiver is.
I may buy it and simply separate the 2 components :)
 

Buzby

Senior Member

satrapus

Member
I may indeed end up with this tubular solution.
What puzzles me is the implementation in the video I posted.
I know there's a blue ir led as it's clearly seen in the side of thr project box.
It's probably a 20 degree beam.
About an inch underneath is the receiver that's mounted in a steel ring housing.
I suspect this is a receiver that works with a continuous 38khz beam that sets it high.
This is what I'd really like to figure out.
 

Buzby

Senior Member
I wouldn't bother trying to replicate the separate TX/RX method.
One of those off-the-shelf $10 tubular ones is so much easier to use.

( Also, there is no such thing as a 'blue IR LED'. IR is past the red end of the spectrum, so that blue LED might be just a beam indicator. )
 

satrapus

Member
20 euro delivery for those guys :(
I suspect it's shipped from States.
Same deal on other sites I found with .co.uk domain.
The bloody things not even on flea bay.
 

erco

Senior Member
Outdoors in bright sunlight is a very difficult environment for an optical sensor, as is a marine environment, and having a motorized conveyer slinging slimy chum. I would say that optical shielding and a watertight, easily cleanable/hose-able enclosure are your top priorities.
 

AllyCat

Senior Member
Hi,

If anyone knows where I can purchase a TSSP4038 in the UK or EU please drop me a line.
I think it's the answer to my problems.
It appears to be in the Farnell catalogue here (sadly not from their "CPC" offshoot which delivers £10 orders for free), but it's currently "awaiting stock (on 11th March)". When in stock, it appears to be 50p + £3.95 shipping + VAT.

But the PICAXE store has IR LEDS and phototransistors at about 15p each, or modulated receivers for 50p. ;)

Cheers, Alan.
 

erco

Senior Member
20 euro delivery for those guys :(
I suspect it's shipped from States.
Same deal on other sites I found with .co.uk domain.
The bloody things not even on flea bay.
I can send you one or two TSSP4038's for postage & cost if you can wait for regular mail. PM me if interested. Paypal OK.
 

satrapus

Member
I just need a receiver that will accept a constant 38khz unmodulated signal which will set it high.
From the docs I've read the tssp4038 and tsop4038 meet these requirements (thanks erco ;) )
Alan, if you know of such a component on the PICAXE store I'd very much appreciate it if you let me know.

Cheers
 

eclectic

Moderator
I just need a receiver that will accept a constant 38khz unmodulated signal which will set it high.
From the docs I've read the tssp4038 and tsop4038 meet these requirements (thanks erco ;) )
Alan, if you know of such a component on the PICAXE store I'd very much appreciate it if you let me know.

Cheers
http://www.picaxestore.com/index.php/en_gb/led020.html

and, for expert discussion ( :- )

Possibly use an IR LED and IROUT to send
say a "X" at 500ms (or whatever) intervals.

IRIN, with timeout might be used to trigger a response
 

AllyCat

Senior Member
Hi,

I believe it was said earlier in this thread that most IR RC receivers don't behave well with an unmodulated carrier; I don't know if that from the PICAXE Store does or not.

But personally, I would just apply some modulation to the carrier, perhaps using one of the embedded RC commands, or by using two PWM oscillators. I think most M2s support two different PWM frequencies which might be mixed (modulated) with external hardware, or some of the on-chip hardware functions. There is the "Data Signal Modulator" (not directly supported by PICxaxe Basic) or the Set-Reset Latch (which can be triggered by internal clock dividers) that might be arranged to operate entirely in the "background", but they do require more "advanced" programming techniques.

However, I have to endorse erco's wise words in #11:

Outdoors in bright sunlight is a very difficult environment for an optical sensor, as is a marine environment, and having a motorized conveyer slinging slimy chum. I would say that optical shielding and a watertight, easily cleanable/hose-able enclosure are your top priorities.
Cheers, Alan.
 

satrapus

Member
I've pretty much got the project box housing the component and it's waterproofing sorted, but that comes at the very end.
I will try the simple solution with a tssp4038 receiver and an unmodulated carrier.
If by chance, someone has tested this please let me know if it will work as my project is on hold till I get my hand on the elusive tssp4038. This is likely to be weeks.
If that fails I will be offering a financial reward to the person who solved this last puzzle in my project.
Advanced programming techniques are not for me as I can even get the bloody irin irout to work.
I'm better at landing tuna than electronics and I'm getting a feeling this project is a never-ending story with a sad ending.
Skipper out
 

rossko57

Senior Member
One way to have a project achieve results is to benefit from previous experience, easier than reinventing each wheel. There are reasons why IR beams are modulated, it offers a degree of immunity to environmental noise - e.g. sunlight, reflected sunlight, muck in the optical path .... I rather think you should benefit from "this is the way it's usually done" in this case?
 

satrapus

Member
Back to the drawing board then, at least I don't don't have to wait for the tssp4038.
Just have to decide if I'll use another picaxe for modulation or a LM556 like shown in the ir beacon schematic on page 1.
Will look at the tubular ready made solution on the bay too.
 

erco

Senior Member
An unmodulated 38 kHz carrier is far more reliably detectable than a stronger unmodulated IR beam. It's a simple task to use a 4038 to sense such a beam. There is a bewildering variety of IR receivers out there, some are better at operating with sunlight. Hard to know without testing. As I mentioned, I'm happy to send you a 4038 or two, but those will take a while to reach you. If you're handy at all with a soldering iron or breadboard, you can knock out that 556 circuit in an hour or two, you can find those parts anywhere, and you can use the IR receiver you already have.

Alternatively, you can get one of those $2 sensors I linked to earlier, even if you just want to gut it for its continuous-signal-compatible receiver module. Shorter range than a 4038, but probably fine for your application.
 
Top