InfraRed sensor for 14M project board

jensmith25

Senior Member
Hi all,

I have set up an infra red sensor (LED020) with a 14M2 chip on the 14M project board AXE117.

For info I'm running 5 LEDs off 2 pins through the darlington driver so one set lights up on button 1 of the remote and the other set lights up on button 2 of the remote. Buttons 6 and 7 turn them off. Simple programme to test it's working basically. I've cheked the LEDs light by running a basic high B.1 etc test programme and they work fine so it's definately the sensor.

I can't get the IR sensor to work. I've triple checked my wiring and I had a search on the forum and one suggestion to check the IR sensor was recieving was to put an LED between V+ and the picaxe pin and if the LED flashes on pressing the relevant buttons on the remote then it's working.

My LED is flashing.

So I'm now wondering if I've put the sensor on the wrong pin of the 14M2..... I've put it on pin C.4... is this correct??

I couldn't see any reference to irin on the 14M2 pin out diagram so I assumed any pin would be ok but as it's not working...

Hope someone can help with this as I've spent hours trying to get it to work!

This is my code just in case there's something wrong there but I think it's ok as I've used a similar programme previously, just the input pin that's diffierent:
Code:
 #Picaxe 14M2

main:
	irin [1000,main],C.4,b0  ;wait for new signal
	if b0 = 0 then swon1   ;switch on 1
	if b0 = 1 then swon2  ;switch on 2
	
	if b0 = 6 then swoff1  ;switch off 1
	if b0 = 7 then swoff2  ;switch off 2
	
	goto main
	
swon1:
	high B.1
	goto main
	
swoff1:
	low B.1
	goto main
	
swon2:
	high B.2
	goto main
	
swoff2:
	low B.2
	goto main
 

jensmith25

Senior Member
I seem to have solved the problem. I tried switching the sensor to C.0 but it still didn't work. Decided to try reprogramming the remote. Turns out I'd not programed the remote properly.

I'd still be interested to know if the sensor can go on any pin or if it is limited to one or two?
 

erco

Senior Member
If you have a universal remote which used to work but suddenly stops working, make sure it's in TV mode, not DVD, SAT, AUX, etc. That can ruin your day.
 
Last edited:

jims

Senior Member
Jen... I often use an IR clicker to enter data or control projects. Normally use the numeric keys and it helps me when the key on the clicker returns the same code as the key marking. This code corrects the numeric key offset on numeric keys so that the key marking and it's code are the same. Sometimes it helps to use the code as a "Macro". JimS

Code:
symbol clicker = C.4
symbol irdata = b2
#picaxe 14m2

'** Subroutine to sense the IR Clicker & correct numeric key offset.
UseClicker:
	irin clicker,irdata	'Read data from IR clicker.
	if irdata>9 then return:endif	'Return if NOT a numeric key.
	do:let b0=0:count C.4,50,b0:loop until b0=0 'Optional..Pauses until numeric key is released.
	irdata=irdata+1//10	'Correct numeric key offset.
	return
 
Last edited:

techElder

Well-known member
Jims, a little typo in your routine? Shouldn't it be "C.4" instead of "C.2"?

do:let b0=0:count C.2,50,b0:loop until b0=0 'Optional..Pauses until numeric key is released.
 

jims

Senior Member
Jims, a little typo in your routine? Shouldn't it be "C.4" instead of "C.2"?
Thank you Texas.... I cut and pasted the subroutine from one of my programs where the clicker was on C.2. When responding to Jen... I made the symbol match hers and didn't change from C.2 to C.4. These type mistakes seem to permeate my life these days. I'll edit the code snippet . JimS
 
Top