Help with Infrared transmitter

ernest

Member
Hello All, I really would appreciate your thoughts, even if it’s to tell me my code is rubbish and that I should take up fishing, so here goes .
My Hobby is Meccano modelling.
First what am I trying to do? I am trying to use infrared to control a Meccano model crane.
-----------------------
I am trying to replace a standard TV remote control, with a Transmitter that is more “authentic” to Meccano. I have in mind a meccano box housing the Transmitter with input switches operated by levers. My Transmitter has eight channels using Picaxe20X2.
-------------------------
The Receiver Circuit is Picaxe20X2 and is attached to a crane controlling four motors forwards and reverse. The model works perfectly using a standard TV remote control, so I think the receiver circuit is OK.

My Transmitter (that’s where my problems start) is made using a Picaxe project board AXE118 fitted with Picaxe 20X2.and an IFLED.
Reading the Mauals,Tutorial, Post, and Code snippets, I came up with this code.
This Transmitter code works! It will control four motors forwards and reverse.
So what’s the problem?
1, Pause is a problem. I would like to increase the pause time (to 45ms) but if the pause time is increased ,then the IF transmission is interrupted and the Motor will also pause. I have reduced the pause time in the code, so that the Motor “visibly” does not pause, I could live with this but it does seem a bit of a “copout”.
2, Range is a problem. The reliable range is less than One meter .
To increase the range I have connected Two IRLEDs in series and reduced the resister from 220r to 150r (Tutorial) this has improved the Target giving a better spread, but the range is much the same.
I am just going to put the Maggots in the Fridge , Thanks for your thoughts . Ernest

Code:
#PICAXE 20X2

SYMBOL Countr =b10
start:
if pinc.0=1 then gosub ir0
if pinc.1=1 then gosub ir1
if pinc.2=1 then gosub ir2
goto start
end

ir0:
For countr =1 to 3 'loop 3 time in case receiver misses first pass
irout 0,1,0
NEXT Countr 
PAUSE 18
if pinc.0=1 then ir0
return

ir1:
For countr =1 to 3
irout 0,1,1 
NEXT Countr
PAUSE 18
if pinc.1=1 then ir1 
return

ir2:
For countr =1 to 7
irout 0,1,2 
NEXT Countr
PAUSE 18
if pinc.2=1 then ir2 
return

'This is repeated for Eight outputs.
 
Last edited by a moderator:

nick12ab

Senior Member
2, Range is a problem. The reliable range is less than One meter .
To increase the range I have connected Two IRLEDs in series and reduced the resister from 220r to 150r (Tutorial) this has improved the Target giving a better spread, but the range is much the same.
I am just going to put the Maggots in the Fridge , Thanks for your thoughts . Ernest
I can't suggest a fix to number one now, but for number two look in the datasheet for your IR LEDs and you'll find a continuous current rating (which might be 20-30mA) and a pulsed current rating (not necessarily with that name) where it'll tell you that you can drive it at 500mA or something else much higher than 30mA as long as you only do it for 50ms at a time or something. So, try powering your LEDs through a power transistor and appropriate small series resistor (remember R = V/I and also you will have to take the voltage drop of your transistor into account).

 

SAborn

Senior Member
I have gotten away with driving the IR leds off a transistor at 5 volts with no resistors at all, running continuously.
It might not be the best practice but it has worked for me with great distances of range. (20+meters)
100 IR leds for a few dollars i was prepared to blow a few up to see if they would handle it, so far i have not killed any yet.
 

ernest

Member
Thank you kindly for your reply. I will certainly try your suggestion and let you know how I get on. Ernest
 

ernest

Member
Thank you kindly for your reply. I am going to try your suggestion. I will let you know how I get on. Ernest
 

John West

Senior Member
Hello All, I really would appreciate your thoughts, even if it’s to tell me my code is rubbish and that I should take up fishing
Ernest, as I mentioned in another thread, fishing and PICAXE programming are a great combination, especially ice-fishing in a shanty. Absolute peace and quiet in which to both catch fish and develop PICAXE code and projects. So take up both hobbies. :)
 
Last edited by a moderator:

ernest

Member
Hi John, I tried ice fishing one time on the great lakes, with some American friends, portable radio,12 pack, oil heater, rod as big as knitting needle, catching perch as big as your finger,it was one of lifes great experiences. Realy I loved it. Tight lines .Ernest
 

inglewoodpete

Senior Member
Ice fishing: what's that? The closest snow to where I live falls nearly 3,000km/2,000miles away! Even then, it doesn't get cold enough for streams and lakes to freeze.
 

SAborn

Senior Member
Ice fishing: what's that?
Thats in the frozen section at the supermarket IWP, Yes we normally get fish the size of fingers too, but we call them Fish Fingers, they come caught with bread crumbs on the outside.
 

westaust55

Moderator
@ernest,

My own experiments with IR having two IR LEDs in series and a 68 Ohm resistor with two transistors (one for carrier frequency control using PWM and another for data switching) worked indoors up to around 12 to 14 metres. You range of just 1 metre suggests a problem such as high transistor collector to emitter voltage (see more on that below).
With a single transistor and two series IR LEDs rated at 50 mA, in my tutorial, I had suggested that thew series resistor could be dropped to as low as 56 Ohms for a current draw of 40mA.

As nick12ab has already indicated, you can try increasing the range within the current ratings of your IR LED(s) by further reducing the resistor value if you know the peak current and allowable pulse duration from the datasheet.

The resistor between the PICAXE output and the transitor base also needs to be low enough to ensure the transistor goes into the saturation region and thereby minimising the collector to emitter voltage (Vce).
You need to look at the transistor datasheet to ascertain the gain (ie Hfe(sat)). If this is not given compare the currents for collector and base in satuiration or at the worst case, as a guide divide the linear gain (ie Hfe)by say 10.
 

ernest

Member
Thank you kindly for your detailed reply. It will take me sometime to digest. To gether with the other post I have received, I am now in with a chance to make my Picaxe transmitter. Ernest
 
Top