IR tracker not working

xagemu

New Member
I'm doing a tracking system with a PICAXE-18m2. It doesn't work and I don't know what more I can do.
The tracking system I've used is the same as a solar tracker system (and programming too) but I changed the LDR by IR sensors. The issuer consists 6 simple IR LED. The problem lies in the artificial or natural visible light, which confuse my robot sending a lot of IR light.

Does anyone know a solution?
I have been thinking in encoding the signal, but I don't know how can I do it.
If anyone know how to do this or similar systems that can help me, I would be grateful to advise me.
thanks.

If necessary know something more about this project for helping me, please, feel free to ask me.
 
Last edited:

Jamster

Senior Member
Welcome to the forum :)

First off it usually helps us all if you post:
Code
Schematic if possible
Which PICAXE chip

Now to the problem:
Are you completely sure it's to do with artificial/natural light? I assume you've tried it in a dark room and it worked? How do you know otherwise?
Encoding might work but it might still suffer bad interference; the simplest way would be using an oscillator in the transmitter and the pulsein command in the receiver at prehaps 1Khz...

Others will no doubt be able to help,
Jamster :)
 

xagemu

New Member
Ok.
I'm sure that the problem lies in the artificial or natural visible light. Searching solutions I discovered the existence of visible light filters and looking through it with a camera, I observed the large amount of IR light emitted by the sun or the lights of my house.
My 6 LEDs can't compete with that amount of IR light unless find a solution.
Another problem is that my PICAXE-18m2 can read only 255 bits. That excessive IR light pushes up these values ​​causing sometimes that all 4 IR sensors equalize to 255 bits. This fact causes the robot don't move, thinking it is in the correct position.

I post below some photos of my project.

IMAG0314.jpg
IMAG0312.jpg
 

nick12ab

Senior Member
Modulating the signal sounds like a good idea. The pwmout command is a way to modulate a signal.

A possibility to filter out natural light is to use a bandpass filter then the only signal that gets through is the pulses. Not a perfect solution as if the natural light completely swamps out the signal from the other LEDs (it might already look that way due to the reading being 255 but that doesn't confirm whether the LEDs are completely swamped out) you still won't get a signal.

That's assuming you're reading an analogue voltage - is that what you're doing?
 

xagemu

New Member
yes, I do.
Would you use one 555 for the transmitter?
And what code I have to use to decipher and see the potence of the signal?

which do you recommend? Use another PICAXE or with a 555??

Could you explain me how command "pulsein" works?
 

nick12ab

Senior Member
which do you recommend? Use another PICAXE or with a 555??
Since you're using normal IR LEDs rather than those 3-leg receiver things the frequency doesn't need to be accurate and if you go with the bandpass filter idea you can increase the range of frequencies it will let through easily. So go with the 555 as it's cheaper.

If you go with the bandpass filter idea you'll need something to turn the output pulses into a fixed voltage - maybe a 555 monostable?

Could you explain me how command "pulsein" works?
The pulsin command (link there for when the PICAXE site comes back online, check PICAXE manual 2 on the Programming Editor Help menu until then) measures the duration of a pulse.
 

erco

Senior Member
You'll never get the range and sensitivity required unless you use 38 kHz modulated IR with TSOP4038 IR receivers or equivalent, and you may still have trouble if you have lots of sunlight.
 

xagemu

New Member
I like your recommendation nick12ab, and I would like you to tell me what code is necessary to decipher the signal in the PICAXE. If I have it I can identify my signal and know the potence of it. I'm wrong?
 

nick12ab

Senior Member
I like your recommendation nick12ab, and I would like you to tell me what code is necessary to decipher the signal in the PICAXE. If I have it I can identify my signal and know the potence of it. I'm wrong?
What is your existing code?

Will you be constantly checking the receiving LED to see if the signal is present?

I haven't actually tested my idea, so if possible have you got a 'scope so that you can see what is produced by the receiver+bandpass filter combination when the transmitting LED is being driven at the correct frequency and when this is used under bright external light?
 

xagemu

New Member
In the programming I use the "debug" command that give me the signal information constantly. For the sensors I use the "readadc" command.
Captura.JPG it's only a part of prog.
 
Last edited:

xagemu

New Member
You'll never get the range and sensitivity required unless you use 38 kHz modulated IR with TSOP4038 IR receivers or equivalent, and you may still have trouble if you have lots of sunlight.
Ok, I will try it using a 555 like the circuit I post below, and the receiver will be made by 4 TSOP 38Khz. For that, I will use the "readadc" command.
IMG-20130110-WA0000.jpg

I test it and after that I will tell you about how it works.
 

erco

Senior Member
You need tsop4038 specifically. Others will not work. Order from Mouser, under a buck each.

Repeating. Other lookalike units will not work, because they are not continous signnal acceptable. 4038 is a rare bird.
 

nick12ab

Senior Member
I made this circuit knowing it isn't the tsop4038 http://3.bp.blogspot.com/-nGko7ec7Be8/T649Uloz27I/AAAAAAAAATU/UIrXu0YaPRQ/s1600/receptor+Infrarrojos+-+conexiones.jpg

I used the PICAXE's IR sensor, working at 38 khz too. I know it wouldn't work but, trying it with a readadc, it's pin read 253 constantly. why it isn't 0?
https://www.dropbox.com/s/r327dox33hy76zd/20130112_122427.jpg

when I push a remotecontrol key it change to 3.
You can't read that sensor using the readadc command. Use the irin command.
 

erco

Senior Member
You can read Sony tv codes only using IRIN and most any sensor. But you need the tsop4038 to detect the signal from a 555/556 for more than a half second.
 

xagemu

New Member
OK, I could get 4 tsop4038. Is the connection direct to one PICAXE leg? or resistors and capacitors are needed? In this case, can you show me the appropriate circuit?
Thank you.
 

erco

Senior Member
Yes, direct connection to a PicAxe pin. Schematic shown with the IRIN command, Picaxe manual 2. They show a filter cap and a pullup resistor, but I did not use either.
 

xagemu

New Member
I have done all correctly but it still not working...
if I do a "debug" with "irin", it reads the key code I push, but it isn't what I want.
if I do a "debug" with "readadc", it reads 254 constantly in exception of clicking a key, when it change to 0, and don't understand it...
 

xagemu

New Member
Here's a PicAxe 20M2 robot using dual TSOP4038 sensors to track to low-power 38 khz IR beacons :

http://www.youtube.com/watch?v=3rHuFFe6HRc
I read a post of yours talking about the robot you showed me and I observed that my project it's the same as yours in exception that my project only need to turn on itself.

In your robot, you used a Sharp IR distance measuring module, it is necesary to know the LM556 beacon position??
 

erco

Senior Member
Thanks nick. The guys at ROBOT magazine recently overhauled their website and clearly missed that.
 

westaust55

Moderator
@xagemu,
To be of greatest help for others who may follow in your footsteps in future can you post you program listing as a .bas file attached to your post or embedded as code within [code] and [/code] tags here rather than as pictures/images heres. That can save others time and possible typing errors to input your code as a starting point.
 

xagemu

New Member
Code:
G:\seguidor_v4.bas 


1 '******************************************* 
2 '*** Xavi Genaro *** 
3 '*** Treball de Recerca 2012/2013 *** 
4 '******************************************* 
6 #picaxe 18m2 
7 
8 symbol espera=30 'Temps que esta encés cada motor 
9 symbol opcio=bit8 ' 0:Manual 1:Autònom 
11 'Inicialitzem amb els motors parats: 
12 low c.1 
13 low c.0 
14 low c.7 
low c.6 
16 bit8=0 
17 pause 500 
18 
19 inici: ' funció amb la que sempre iniciem el funcionament. 
21 if bit8=0 then ' control manual: ús del comandament a distància per 
realitzar els moviments basics. 
22 irin c.2,b0 ' s'efectua una lectura dels impulsos que es reben 
del comandament. 
23 
24 if b0=117 then 
gosub baix 
26 elseif b0=52 then 
27 gosub esquerra 
28 elseif b0=51 then 
29 gosub dreta 
elseif b0=116 then 
31 gosub dalt 
32 elseif b0=1 then 
33 bit8=1 
34 pause 300 
'Creem una interrupcio al pin C.2. S'efectua una nova 
lectura (bit8= 0 o 1). 
36 setint %00000000,%00000100 
37 endif 
38 else ' control autònom: ús del sistema de seguiment per infrarroig. 
39 
readadc b.4,b4 's'efectuen lectures constants dels 4 sensors 
d'infrarroig. 
41 readadc b.5,b5 
42 readadc b.6,b6 
43 readadc b.7,b7 
44 
if b4>250 and b5=0 then 
46 gosub baix 
47 endif 
48 if b4=0 and b5>250 then 
49 gosub dalt 
endif 
51 if b6=0 and b7>250 then 
52 gosub dalt 
53 endif 
54 if b6>250 and b7=0 then 
gosub baix 
56 endif 
57 if b4>250 and b6=0 then 
58 gosub dreta 
59 endif 
if b4=0 and b6>250 then 
61 gosub esquerra 
62 endif 
63 if b5>250 and b7=0 then 
64 gosub dreta 
endif 
66 if b5=0 and b7>250 then 
67 gosub esquerra 
68 endif 
69 'pause 100 
71 endif ' fi dels condicionants. 

1 



G:\seguidor_v4.bas 


72 
73 goto inici ' torna a iniciar aquesta funció. 
74 
75 
76 interrupt: 'Funció que s'efectua amb l'interrupció. 
77 irin c.2,b0 ' efectuem una lectura del pin C.2. 
78 if b0=1 then 
79 bit8=1 ' control autònom. 
80 pause 1000 
81 
82 setint %00000000,%00000100 'Creem una interrupcio al pin C.2. 
83 else 
84 bit8=0 'si no es produeix el cas anterior, efectuem el control 


manual. 


85 endif 
86 return 
87 
88 'moviments basics: 
89 
90 baix: 
91 low c.6 
92 high c.0 
93 pause espera 
94 low c.0 
95 return 
96 
97 dreta: 
98 high c.1 
99 low c.7 
100 pause espera 
101 low c.1 
102 return 
103 
104 esquerra: 
105 low c.1 
106 high c.7 
107 pause espera 
108 low c.7 
109 return 
110 
111 dalt: 
112 high c.6 
113 low c.0 
114 pause espera 
115 low c.6 
116 return 


2 



 
Top