IR transmitter & reciever circuit switch

I need to make up some switches and I think that using IR's will be the best solution to my problem.

The manuals don't seem to cover these switches, but I did find an interesting circuit at

I will be using the switch to stop a 15cm wide conveyor belt. The Tx will be on one side and the Rx on the other.

Is there a simpler hardware solution, I need 3 switches?

The switches will be about 60cm from the control box, is it neccesary to have all of the components (resistors, capacitors) at the sensors, or can I have them mounted in the control box?



Senior Member
As this article indicates, the 08M near revolutionised easy IR sending and receiving. Go for it! The associated switching hardware will be best worked out "learn by doing" style I'd say - get to know the IR features on a breadboard first. Stan.
thanks for the replies

Ok, my next problem is when I test the IR receiver using a multimeter (between pins 2 & 3), the output reads 4.3 volts. When I use the TV remote, the volts drop to 3.3.

I am using the batteries that normally power the picaxe, it currently is 4.3 volts

I am using the LED020
Pin 2 is negative
Pin 1 is positive



Senior Member

Remember the output of the IR receiver is a series of ON-OFF pulses. The multimeter is reading the average DC voltage from those pulses, so the 3.3 volts is relative. You would need an oscilloscope to actually see the output going from 4.3 to zero volts.

Steve G.
Hi Steve

thanks for the quick reply

I have been trying to duplicate the senario at

He says "Test the device with the LED above or just attach a volt meter between pins 1 and 2 (output and ground). When it sees a 38 kHz IR signal the meter will show 5 volts. When it does not the meter will show 0 volts. You can easily test it by pressing buttons on a TV remote control and observing the volt meter or LED".

Mine starts at 4.3volts and reduces when I use the remote
I'm not sure if I am doing anything wrong

If the result is pulsing, can I still use it as my switch?



Senior Member
Hi Michael,

Welcome to the Forum and the PICAXE world.

I would consider your results normal. Remember that IR data (from a TV remote say) is data switching between '0' and '1'. These being logic levels, and could be between 0V and 5V typically. BUT because the pulse train is so fast (38kHz), most meters will give an average reading.
If you have a fast peak hold meter, you'll see what the actual high and low levels really are.

The 4.3V you see when no buttons are pressed is also normal. A lot of receivers only pull LOW, and therefore appear to have a 'normally' HIGH output.

As mentioned, the only way to really be sure is to use an oscilloscope. If you don't have one then don't worry too much about it.

For use as a switch, you may only need to have the LED constantly ON, and then only need to detect when the output changes at the receiver.

Hope this helps.:D



I'm not sure if you've quite grasped this.

Let's just go back to basics.
The IR demodulator detects the carrier (in this case 38kHz).
When a carrier is detected the output (in typical module) goes LOW.
When there is NO carrier is stays HIGH.
See Diagram Below at bottom.

Your TV/Whatever remote control modulates the 38kHz carrier i.e. switches it on and off rapidly - like the 'Burst Wave' Output Signal in the diagram below. This can then be decoded by devices such as PICAXE IR commands - very similar to Serin.

So, when testing with a multimeter, it's almost like measuring an AC signal using a DC meter. And the apparent DC volts will be lower when you press an RC button.

HOWEVER, in your case, you are looking for ON/OFF i.e. a break-beam switch.
All you have to do is provide a continuous 38kHz carrier pulse to an IR LED.
When it is pointed at an IR Detector, the detector will stay LOW.
When something BREAKs the beam it will go HIGH for the duration of the break.

This, then , can EASILY be detected by PICAXE using an IF or an Interrupt.

For your App forget TV remote controls.



New Member
All you have to do is provide a continuous 38kHz carrier pulse to an IR LED.
When it is pointed at an IR Detector, the detector will stay LOW.
I am working on a beam break system for unauthorised machine access prevention.

And unfortunately the above may not be quite true. Most of these IR Receiver devices cannot receive a constant 38khz, they have a built in gain device to amplify the signal to increase range, and often require a specific modulation pattern of certain length pulses and a certain length of gaps.

The important part, is that they are designed to reduce the gain if it receives a continuous signal, as it tries to ignore this, as it may be light interference from other DC lighting sources, this will give you extremely short range of only a couple of CM or less.

You need to check the datasheet for your receiver device for the specific modulation requirements. For example, I am using the TSOP1138, that requires pulse bursts of between 6 and 70 cycles, and a gap of nothing of between 6 and 70 cycles, for every burst that lasts longer than 1.8ms a gap time of equal time or longer is required.

So, what I am doing is pwmout on for 1ms and then off for 1ms and loop it.

However, the other obstacle for you to overcome is that when the receiver picks up the modulated frequency, the output will also be pulsed, so you will need some way of stopping it.

Depending on how close to the train your system will be placed, it may be simpler to just use a regular IR phototransistor, and just keep an IR LED constantly on, check voltages of phototransistor, and use an OP-Amp with adequate voltage reference and output the logic high or low to the picaxe if you desire.


Yes, that's a good point Phil, I'd forgotten that. Thank you.
And simple DC method, as you say, will be a lot easier/smaller/cheaper where ambient light isn't a problem.

As fas detecting pulses is concerned that's quite easy.
Either Missing pulse electronics (e.g. a simple 555) or Missing Pulse code will do the trick.
If speed of response isn't important a simple rectifier type circuit, where you 'pump up' a capacitor with the pulses + a transistor will also work well.

I'd suggest experimenting as overkill often happens.


New Member
My receiver in my system counts pulses, and activates a relay if pulses are below a set value.

But for model train then I don't think range will be an issue, so may be far simpler to use a regular IR phototransistor.


New Member
This may be the solution I am looking for Missing Pulse Code.I have converted a Joystick to operate as an Ir remote control. Using a 28x1 chip by combining with push swiches it is possible to transmit up to 20 diffrent ir signals.However wheras the TV remote works at over 2 metres the joystick only transmits up to 20cm.The out put code I use is as follows
high 5
irout 6, 1,b2
pause 45
low 5
goto main
A red led is attached to five to show transmission. B2 is infra code depeding on which button is pushed ,I have ommitted the for next loop as this keeps the joystick trans mitting after release and leads to overrun on the controlled models. I note the pwmout command has been used but I cant see how you can combine this with irout.How do I simulate the Sirc Sony protocol,if missing pulse code is the answer what is it?