IR Wiring

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
fuzzball27
Posts: 103
Joined: 29 Sep 2010, 17:14
Location: US

IR Wiring

Post by fuzzball27 »

Hello again!
I have an IR transmitter hooked up to my NXT
Photo on 2011-04-30 at 11.23 #2.jpg
I am running a very simple program to turn the transmitter on and off:

Code: Select all

task main () {
	SetSensorLight(IN_1);
	while (TRUE) {
		SetSensorType(IN_1, IN_TYPE_LIGHT_ACTIVE);
		Wait(1000);
		SetSensorType(IN_1, IN_TYPE_LIGHT_INACTIVE);
		Wait(1000);
	}
}
To ensure that the transmitter is working, I am using my phone camera. Indeed, the transmitter is working, but it is not turning off...
Does anyone know why this might be?
fuzzball27 >>-->
fuzzball27
Posts: 103
Joined: 29 Sep 2010, 17:14
Location: US

Re: IR Wiring

Post by fuzzball27 »

I have tested the program with my Light sensor, and it does work, meaning this is a hardware problem.
Any ideas?
fuzzball27 >>-->
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: IR Wiring

Post by mattallen37 »

How is it wired?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
fuzzball27
Posts: 103
Joined: 29 Sep 2010, 17:14
Location: US

Re: IR Wiring

Post by fuzzball27 »

Green 4.3V wire --> IR Transmitter --> 560 Ohm Resistor --> Ground (Red)
fuzzball27 >>-->
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: IR Wiring

Post by mattallen37 »

The green one is always powered (when the NXT is on). It is the sensor supply voltage.

Pin 5 (yellow) is the control pin used for the light sensor. It is turned on and off to control the light. You should use a transistor to handle the power though.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
fuzzball27
Posts: 103
Joined: 29 Sep 2010, 17:14
Location: US

Re: IR Wiring

Post by fuzzball27 »

Thanks! I'll give it try :D
fuzzball27 >>-->
fuzzball27
Posts: 103
Joined: 29 Sep 2010, 17:14
Location: US

Re: IR Wiring

Post by fuzzball27 »

It's working great! Thanks for the help.
fuzzball27 >>-->
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: IR Wiring

Post by mattallen37 »

Cool!
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests