Problem with IR
MovieMaker
Posts: 502
OK, my pinouts are:
0.········ Left Wheel Servo (1k)
1.········ Right Wheel Servo (1k)
2.········ PING Servo (1k)
3.········ IR Detect (table top edge) (NOTHING)
4.········ IR EMIT· (table top edge) (NOTHING)
5.········ PING DATA (1K)
6.········ LED (YELLOW) (100 ohm)
7.········ LED (RED)(100 ohm)
8.········ SD –D0
9.········ SD - CLOCK
10.······ SD - DI
11.······ SD -CS
12.······ bootTX (reserved)
13.······ bootRX (reserved)
14.······ LED (GREEN) (100 ohm)
15.······ Sound Pal
16.······ IR Detect· (may not use this) REAR (NOTHING)
17.······ IR Emit (100 ohm) (NOTHING)
18.······ Heartbeat Monitor (100 ohm)
19.······ SPEAKER
20.······ IRemitter (White) (100 ohm)
21.······ IRdetect (GREEN) (1k)
22.······ IRemitter (BLACK) (100 ohm)
23.······ IRdetect (RED)(1k)
and I have changed the IR to totally new pins. I have changed the IRdetectors to totally new detectors. With my video camera, I can see that the IRemitters are emitting. Now, they are only showing up as a dim purple light when I turn them on and off. Should this light be very bright instead of dim?
You can see the resistors I am using on each port. They are on pins 20 through 23.
I have tested the port by putting an LED and turning it on and off. They seem to be wired according to the way Mike Green told me to.
I am using the Program BoeBot.BAS in boebotbasic. This program checks the PING and IR and runs the machine 45 degrees in each direction then forward and back.· The PING values come back correctly, but the IR values remain at 9. They are at 9 wether on not I hook up the ditectors.
As you can see on the pinouts, I have changed ports 3 times and changed IRs two times.
I am very puzzeled.· I cannot figure out WHY they are not working. I have done one I/O at a time and this is the last one.
I am sure it is something I am not seeing and overlooking. But, I have checked,checked and double checked everything.
????????
Please help.
0.········ Left Wheel Servo (1k)
1.········ Right Wheel Servo (1k)
2.········ PING Servo (1k)
3.········ IR Detect (table top edge) (NOTHING)
4.········ IR EMIT· (table top edge) (NOTHING)
5.········ PING DATA (1K)
6.········ LED (YELLOW) (100 ohm)
7.········ LED (RED)(100 ohm)
8.········ SD –D0
9.········ SD - CLOCK
10.······ SD - DI
11.······ SD -CS
12.······ bootTX (reserved)
13.······ bootRX (reserved)
14.······ LED (GREEN) (100 ohm)
15.······ Sound Pal
16.······ IR Detect· (may not use this) REAR (NOTHING)
17.······ IR Emit (100 ohm) (NOTHING)
18.······ Heartbeat Monitor (100 ohm)
19.······ SPEAKER
20.······ IRemitter (White) (100 ohm)
21.······ IRdetect (GREEN) (1k)
22.······ IRemitter (BLACK) (100 ohm)
23.······ IRdetect (RED)(1k)
and I have changed the IR to totally new pins. I have changed the IRdetectors to totally new detectors. With my video camera, I can see that the IRemitters are emitting. Now, they are only showing up as a dim purple light when I turn them on and off. Should this light be very bright instead of dim?
You can see the resistors I am using on each port. They are on pins 20 through 23.
I have tested the port by putting an LED and turning it on and off. They seem to be wired according to the way Mike Green told me to.
I am using the Program BoeBot.BAS in boebotbasic. This program checks the PING and IR and runs the machine 45 degrees in each direction then forward and back.· The PING values come back correctly, but the IR values remain at 9. They are at 9 wether on not I hook up the ditectors.
As you can see on the pinouts, I have changed ports 3 times and changed IRs two times.
I am very puzzeled.· I cannot figure out WHY they are not working. I have done one I/O at a time and this is the last one.
I am sure it is something I am not seeing and overlooking. But, I have checked,checked and double checked everything.
????????
Please help.
Comments
Any input would be nice. But, if you guys have run out of answers, I understand.
It's obvious that your IR detector isn't detecting properly. It's probably your wiring since you've tried several IR detectors and you know the IR emitter is emitting IR. How do you have the detector connected? Maybe you have the pins mixed up. It's easy to get things confused and the IR detector turned around in your mind so that the pins get connected wrong. I've done it.
Here's the link for the IR detector's datasheet: www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/PNA4601M.pdf
You can also look at pages 164-166 of "IR Remote for the BoeBot" for diagrams.
Vcc should be connected to +5V, GND (the center pin) should be connected to ground (Vss), and Vout should be connected to one end of a 1K resistor with the other end of the 1K resistor connected to a Propeller pin.
All I can say is that if the IR emitter and detector are wired correctly, the IRZONE statement in BoeBotBasic will work as documented.
TIm, I will try your suggestion. If it works you will hear me yelling from here. I will be so glad to solve this mystery.
obex.parallax.com/objects/37/
if you have a SONY TV remote control, or a universal remote that can be set up to operate a SONY TV.
The code should be easily modified to send data by serial back to a Terminal program instead of TVTerminal....If you can't figure out how, I'd be glad to modify it and send it to you.
I also have some code to drive a BoeBot with a SONY remote... pushing 2 to go forward, 8 to back up, 2 to turn left, 6 to turn right. I used some of the objects in the above referenced repository, and well as a Servo object.
That's what I love about the Propeller, all these Objects exist to do all sorts of cool things, you just have to get them to work together.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
I still have 3 left that are brand new and running cool.
I switched to 3 or 4 different ports so I know the port is not blown. Also, I tried them on an LED and it worked fine.
I would have got back sooner, but today being Sat, the wife had some "Honeydo"s for me to do. Sorry.
I ran the test and when I put the resistor to the 3.3vdc, I got -1 for the first time. I ALWAYS get a 9. So, according to what you have told me, the detector is not working or is dead. But, I have tried Four brand new detectors. Wow! I have always tried to wire them correctly. As the bubble is facing away from you and you are looking down on the detector, the Left pin is 5vdc and the right is Signal going to the prop through a 1k resistor. The middle is Ground. How else could it be wired? I have done this 10 times at least.
?? Where do I go from here?
Yes, that's correct
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
hmm????
How about using just a single IRZONE statement and see what you get? Like:
100 print irzone [noparse][[/noparse] 38000, 10, 500 ]
Every time you run this you should get a number from -1 to 9. If you have the IR emitter and IR
detector aimed in the same general direction and use a book or piece of wood or something as a test
surface, you should be able to get different zone values with different distances from the emitter / detector.
If you get -1 all the time, then either the IR emitter isn't working or the IR detector is always giving <---
a high (+5V) value. If you get 9 all the time, then the IR detector is always giving a low (0V) value. <---
Check your wiring. The IR detector should have a supply of +5V, ground, and the output lead should <---
be connected to the proper Propeller I/O pin through a 1K resistor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
Post Edited (PJ Allen) : 9/6/2008 10:42:38 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
I'll be back in a little bit. Thanks for hanging in there with me. I have been at this for 9 hours straight.
Thanks for your help.
What you described for the connections of the IR detector sound correct as long as you use +5V. I'm very thrown off by your descriptions of what sounds like wild trial and error. That's a very easy way to destroy things. To debug these things successfully, you usually have to be methodical and thoughtful, ask questions before doing, whether of yourself or of others, so you know what it is that you're trying to demonstrate.
What I mean is to wire up one of the IR detectors on the breadboard with Vdd connected to +5V and GND connected to ground (Vss).
Vout should be connected to a 1K resistor with the other end of the resistor connected to the base of a 2N2222 or PN2222 or similar NPN switching transistor. The emitter of the transistor should be connected to ground. The collector should be connected to the cathode of a visible LED. The anode of the LED should be connected to a 330 Ohm resistor and the other end of the resistor to +5V (Vdd). When the IR detector is not detecting anything, the LED will be on. When the IR detector detects something, the LED will turn off.
When you do an IRZONE statement, that should cause the IR emitter to produce a couple of pulses of IR light at frequencies that the IR detector will respond to. The LED should flash off briefly or flicker when an IRZONE statement is executed. If you increase the number of zones (the 2nd parameter) and decrease the frequency width of the zone (the 3rd parameter), you'll get longer periods of IR energy emitted. You could try
IRZONE 38000,20,250 or IRZONE 38000,50,100
I took an ohm meter and checked everywhere for continuity. Then I turned on the protoboard and measured 5 volts and 3.3 where they were supposed to be.
I understand about the wild way I have been troubleshooting. I saw that PJ or who ever he was posted that he had a 4.7k resistor across signal and voltage instead of series with the pin. He also had 3.3volts instead of 5 volts. I did that number, but it did not work.
No, the Detector never did work, only the ports which I hooked it to. I did have an accident and one of the Detectors burned up. That was the time that I checked everything else to see if it still worked. After the LED test, I checked the speaker, the SoundPal, the SDcard, the Ping and servos left and right. All other stuff worked fine except the IR. I changed the ports 4 times already. After that, I got a breadboard and did it all on the breadboard. I mean the IR stuff. I got two Brand new IRdetectors from Parallax and wired them up. I checked the emitters by using my camcorder and they glowed faint pink. When I shorted the resistors out, they glowed Bright pink or purple. You told me not to do this, so I stopped. I found a remote control (actually about 8 of them.) I pressed the remotes while running the irzone program continuously getting only 9s. I looked to see if when I pressed the remotes that the number would change. I reversed the leads on the IRdetectors in hopes that I had wired them backwards(doubleful). When I did that,l got a -1 instead of a 9. So, I put them back.
Actually the Emitter LED never flashed just stayed on until I turned it off.
My statement was PRINT IRZONE[noparse][[/noparse]38000,10,500] I believe.
The above is the results of 9 hours working straight. new ports, new detectors, new circuitry, new ideas.
Mike, thanks for listening. You are a good teacher. I love the way your mind works.