Interfacing IS471S IR sensor

David Levick

New Member
Has anyone had any problems connecting a IS471S IR sensor to a Picaxe 18X? I have built a simple sensor using this device and can confirm that it works independantly (it will light an LED on it's output pin when the reflected IR signal is detected). However, as soon as I plug it into my picaxe circuit (currently just the basic upload circuit) I get 2 problems:-

1. I can't upload (device not found)

2. If I disconnect the sensor, I can download the program which is just a very simple test program to look for a high on input pin 1 and send a debug message to the computer. As soon as it has downloaded, I turn off the power, reconnect the sensor and turn on the power again. At this point, the Picaxe seems to crash. The output on the terminal monitor is garbage. Program is below.

main:
if pin1 = 1 then
sertxd ("Input 1 is high",cr,lf)
else
sertxd ("Input 1 is low",cr,lf)
end if
goto main

Can anyone help with this?
 

Technical

Technical Support
Staff member
You have answered your own question, connecting the sensor prevents the PICAXE downloading (ie working). The only explanation is that there is a fault in your circuit wiring.
 

Dippy

Moderator
Post your exact circuit schematic as an image.
Post a link to the IR device Data Sheet.

"1. I can't upload (device not found)"
Do you mean download?
 

hippy

Technical Support
Staff member
Leg 4 is MCLR/Reset and needs to be pulled-up to +V with 4K7, not pulled-down to 0V.
 

Dippy

Moderator
Well, for starters your 4k7 res should go from Pin4 to +V. i.e. pullUP.

Crossed with hippy - Gee, he was in there like a Jack Russell down a rabbit hole!
 

David Levick

New Member
Leg 4 is MCLR/Reset and needs to be pulled-up to +V with 4K7, not pulled-down to 0V.
True! Unfortunately, this is a mistake with my schematic (late nights are never my best). I checked the actual circuit on my breadboard and I am definitely pulling up pin 4.
 

SD2100

New Member
1. I can't upload (device not found)
What are you using for the power supply, maybe the IR unit is upsetting things and if the supply is already a bit shaky it's causing download problems.

The output on the terminal monitor is garbage
Check you have selected the correct baud rate in terminal window.

as soon as I plug it into my picaxe circuit (currently just the basic upload circuit) I get 2 problems
Don't plug it in yet, download the program and connect a simple switch to pin1 so you can make the pin go high/low. Get the input working first so it's displayed on the terminal screen then connect the IR unit.
 

David Levick

New Member
What are you using for the power supply, maybe the IR unit is upsetting things and if the supply is already a bit shaky it's causing download problems.
My power supply is just 4 AA NiMh batteries, fully charged.

I have tested each component independantly. The downloaded program will run and output the expected value to the terminal window with a switch on the input pin. I have also tested the sensor circuit independantly and can cause an LED to light from the output of the sensor when no reflected IR is detected. As soon as I swap the switch on the input pin with the output from the sensor, the terminal window starts displaying garbage, whereas previously it was displaying readable text.

It's almost as if the operation of the sensor is causing the Picaxe to crash or behave unreliably. I'm completely baffled as to why such a simple circuit can have such an effect!
 

Dippy

Moderator
Just some thoughts.
That device modulates continuously and may be introducing some spurious noise into PICAXE.
Try a capacitor very close to PICAXE V+ leg. Value, well anything from 220nF to 10uF.
Try a slightly larger capacitor across Vcc/Gnd of IS471F.
Try a 10K resistor between IS471F Vo and PICAXE input.

Does download work if you leave IS471F connected but just remove IR LED?
 

David Levick

New Member
Just some thoughts.
That device modulates continuously and may be introducing some spurious noise into PICAXE.
Try a capacitor very close to PICAXE V+ leg. Value, well anything from 220nF to 10uF.
Try a slightly larger capacitor across Vcc/Gnd of IS471F.
Try a 10K resistor between IS471F Vo and PICAXE input.

Does download work if you leave IS471F connected but just remove IR LED?
I have tried all 4 suggestions to no avail. I even tried using a separate power supply for the sensor (with a common ground) but without success. Could it be that the sensor is drawing a lot of current away from the picaxe causing it to act unreliably?
 

Mycroft2152

Senior Member
Hi Dave,

According to the spec sheet, the minimum voltage required is 4.5 volts. 4 NiMh batteries will provide 4.8 volts on a good day when fully charged. When a load is applied, or when partially discharged, they will easily drop to 4 volts, well below the required minimum voltage.

Put a meter on the voltage to check it out.

TANSTAAFL*
Mycrooft2152
 

hippy

Technical Support
Staff member
Are you absolutely sure you have got the sensor wired correctly ?

If you disconnect the sensor output from the PICAXE then the sensor should work ( you can try your Led test ) and the PICAXE should also; downloads should work, and a simple SERTXD message loop should display via the Terminal.

If that doesn't work, IMO, there's got to be a wiring fault of some kind.
 

David Levick

New Member
The voltage drops to around 4.6 v when I connect the sensor. This should be enough I nthink for the Picaxe to still operate. I started playing around with different values for the decoupling capacitor across the sensor. A 222nf value gives occasional 'english' output on the terminal window, but is not reliable. Going as high as 10uf allows my circuit to download with the sensor attached, but the sensor doesn't work as expected - the output is always low, indicating a signal detected, but it still gives a low even when I cover the face of the sensor!
 

ljg

New Member
the datasheet shows an output of 50mA. It seems to me there should be a current limiting resistor between the sensor and the Picaxe
 

David Levick

New Member
Are you absolutely sure you have got the sensor wired correctly ?

If you disconnect the sensor output from the PICAXE then the sensor should work ( you can try your Led test ) and the PICAXE should also; downloads should work, and a simple SERTXD message loop should display via the Terminal.

If that doesn't work, IMO, there's got to be a wiring fault of some kind.
Correct. The sensor does work when I disconnect the output to the picaxe and use it to drive an LED instead. However, the SERTXD message loop is outputting garbage still. As soon as I unplug the +v lead to the sensor, the picaxe starts working again and begins outputting the correct response to the terminal window. Plug the +v back into the sensor (pin 1) and I get garbage again. At this stage there is no connection between the sensor and the picaxe, they just share the same power rails.

Both circuits work independantly, but not together. Could it be that the modulating signal is creating too much noise?
 

SD2100

New Member
So it's definitely causing problems on the supply, so maybe better filtering is needed also just a thought is pullup resistor on reset pin4 a 4k7 (4.7k) ???
 
Top