emitter/detector
ltmhall
Posts: 102
Is there any way you could design a emitter/detector circuit so the emitter would be on the time
and not be pulsed through the basic stamp using a hex schmitt trigger or something.
and not be pulsed through the basic stamp using a hex schmitt trigger or something.
Comments
So I could use this schematic shown below to run an emitter, but would the other circuit look like.
Post Edited (ltmhall) : 1/24/2007 5:50:43 PM GMT
····and the other connected to the basic stamp as shown in the boe bot manual. Could I
··· use the emitter circuit with the 555 timer I posted earlier. Suppose I wanted to build a pair
··· would I need two 555 timer circuits.
2) I know this may seem like a stupid question but is a emitter/detector the same as detector/reciever
··· I'm new to robotics and I hear people call them different things.
Post Edited (ltmhall) : 1/24/2007 6:51:23 PM GMT
These days, you buy an integrated receiver/detector for pulsed IR (at a specific frequency - often 40KHz) rather than making your own circuit. These are the detectors that Parallax (and others) sell. They connect to +5V and ground and have a 3rd pin as mentioned that becomes grounded when the detector detects something. You connect a pull-up resistor from that pin to +5V (often 4.7K) and also connect that pin to the microcontroller (Stamp) I/O pin.
The 555 circuit in that doc lets you turn on/off the emitter(s) with a single pin (LOW or HIGH, no FREQOUTs). I would suggest that you turn the emitters on and off when you need them -- if they are on all the time then you will use juice AND you are more likely to trip up other IR detectors.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
I would just connect one pin of the detector (as shown in the boe bot robotics manual) to the Basic Stamp and this will be the only connection to it from the IR circuit.
And if I wanted to add a second IR LED to my previous circuit. I just connect one end to power and the other
would just connect to a resistor that connects to the collector of the 2N2222 transistors.
The BOE-BOT Robotics manual is a great reference.
So as Mike said, yes, you would only *need* one pin for the IR detector. But you might like the option of using another pin to turn the 555 on and off. For example:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Correct.
I checked out the schematic in your Word doc. In the circuit posted you would connect the "pin" labeled "take low to disable" to your Stamp pin -- if that pin is HIGH or INPUT the timer is on, if that pin is LOW, the timer is off. The posted circuit has a pullup on the disable line which it takes it "high" by default, even if the enable/disable line is left unconnected.
If it were me, I would use the circuit in the IR tutorial PDF (link is above). Way fewer parts, and you don't need the transistors if you are driving 1-4 LEDs or so (though I bet you could push it to 6 or 7 if you weren't driving the LEDs too hard). That said are you actually using a CMOS and not a TTL timer? Check the specs for the actual 555 you are using -- the TTL 555 I use will drive nearly 200ma, which is way more than I need usually.
Now you can just tie the reset pin on the 555 high (to +5v) to keep the LEDs on all the time (and saving a pin).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
If I used the 555 timer circuit shown in
www.parallax.com/dl/docs/prod/sic/WebIR-%20v1.1.pdf
Could this also be used to produce the emitter circuit and turn it off/on.
The I would just connect the reciever as shown in the robotics manual.
In this design if I wanted to add another IR LED, would I just connect between
ground and a I/O pin or would I need another 555 timer.
For my robot I need it to be able to roam towards a light and avoid obstacles. In addition
it must be able to hear a sound and be able to react to it. While designing I had friend tell
me that it wouldn't be a good idea to pulse it through the microcontroller because that it
would just be a burden to have the microcontroller do it and it would slow down its process
of running through the other comands.
Thats just a little backround about why I want it to be pulsed seperatley.
THANKS FOR EVEYONES HELP I REALLY APPRECIATE IT
Post Edited (ltmhall) : 1/24/2007 11:10:25 PM GMT
Yes.
No, you would only need another IR LED and another resistor. You would wire that LED and resistor to the 555 output just like the single LED in the circuit. You would be wiring the LEDs in parallel but each would have it's own resistor. You may need to experiment with resistor values to get the IR "brightness" you want.
It's not so much a burden, since you are only FREQOUTing for a very very brief time, but with the 555 circuit you can run one more than one LED from one pin. One caveat -- with the 555 circuit you can only get a YES/NO on whether an obstacle is present; you can not get a distance range as described in Robotics with the Boe-bot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
I tried building the circuit with a LM555CN using the code below and the debug terminal reads 0 HZ.
' IR Remote for the Boe-Bot - Test555Frequency.bs2
' Displays 555 timer frequency for potentiometer adjustment and tuning.
' {$STAMP BS2}
' {$PBASIC 2.5}
cycles VAR Word
DO
HIGH 6
COUNT 7, 100, cycles
LOW 6
cycles = cycles * 10
DEBUG HOME, "Frequency = ", DEC5 cycles, " Hz"
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
And the wiper(the middle of the Potentiometer) connects to·the node from pin 6 and pin 2·and I just connect one of the
two other ends of the pot to pin 7.
Post Edited (ltmhall) : 1/25/2007 5:13:02 PM GMT
It sounds like your pot is wired up OK, but make sure you have the other half of the voltage divider at the node to pin 7 (the 470ohm resistor between pin 7 node and pin 8 node).
I would wire up the circuit as shown. If you don't have the right value cap and resistors on hand, a quick trip to Radio Shack can solve that. Wire it up, double check your wiring, center your pot, and give it a go.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Does anyone know why it does that ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
First I placed the 555 on a bread board. Then I took the 0.01ufd cap and place it between pin 1 and pin 2.
Then I took a piece of wire and connected pin 1 to ground. Next I placed a 220 ohm resistor
to pin 3 and connected the other side of the resistor to Basic Stamp pin 7. I also connected the IR
LED to that same side of the resistor and ground. Then I took another 220 ohm and connected one side to pin 4
and the other side of pin 6 of Basic Stamp. Next I placed a wire between pin 2 and a empty
row on the bread board and connected the wiper of the pot tt that same row. Then I took a piece of wire
and connected pin 6 to the same row. Then I connected another piece of wire between pin 7 and the other
end of the pot. Next I took the 470 ohm resistor between pin 7 and pin 8 and connected pin 8
to power.
' IR Remote for the Boe-Bot - Test555Frequency.bs2
' Displays 555 timer frequency for potentiometer adjustment and tuning.
' {$STAMP BS2}
' {$PBASIC 2.5}
cycles VAR Word
DO
HIGH 6
COUNT 7, 100, cycles
LOW 6
cycles = cycles * 10
DEBUG HOME, "Frequency = ", DEC5 cycles, " Hz"
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Now if I want to use it for object detection I just connect my detector as shown in the robotics manual and
have it constantly check for the emitter signal. Also I can turn the emitter IR 38 kHz signal off/on with the reset
(pin 4) of the 555 chip by sending High and Low signals.
Yes, connect your detector as shown -- use a 220ohm resistor between the output pin of the detector and the pin of the Stamp.
Set RESET pin of the 555 HIGH and then read the detector. Set RESET pin of the 555 LOW to turn off the LEDs.
Remember on the IR detector that a 0 (low/false) means there IS IR detected, a 1 (high/true) means that NO IR was detected.
You may want to experiment with the value of the resistor(s) that go to your IR LEDs to get the opitmal "brightness" of the IR -- the lower the resistor, the more electricity flows to the LED, and so it's brighter. The brighter the LED the farther an object can be when it reflects the IR to your detector. Don't make the resistor too low or you risk burning out the LED. If you have any kind of video camera with "nightshot" infrared mode, you can point your camera at the LED and see the IR light, which can be kind of fun.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1) It seems that it is really slow to detect an object using the code I have provided. Is there any way to fix this
2) It seems it constantly false triggers.
IR555 PIN 6
IRdet PIN 7
DO
HIGH IR555
IF IRdet = 0 THEN
HIGH 8
ENDIF
LOW 8
LOW IR555
PAUSE 10
LOOP
Now, for false triggers there are number of things you can do. First you might want pause a tiny bit after turning on the 555 so it can settle. See code below
You can also stabilize your circuit (the detector) and/or the software so it only reads IR correctly. First make sure you don't have interference from fluorescents, other IR sources, etc.
Then you can try any or all of the following:
- put a .1 - 10uf capacitor across the +5v and GND pins of the detector (right at the detector)
- put a pull-up resistor (5k-20k -- experiment) from the output pin of the detector to +5V. This "pulls" the output of the detector towards +5v ("1" or no IR) unless it gets a strong "0" from the detector itself
- sample the detector a number of times in software. Count the number of times you get a "hit" and then decide how many hits = a true obstacle (i.e. if you hit 3 out 5 it's real, anything less than 3 out of 5 might be false)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
when an object is placed in front the led would come on, then turn off when there wasn't anything in front of it. However
when I tried it I placed an object in front I could see that the led wasn't illuminating really bright and I could see it flashing on/off. I'm not really worried about the fasle triggering because I know that can be corrected. I just want it to react quicker.
I tried running the code that was supplied above and my circuit shows no reaction. When I place and object in front
of the circuit using the code above the led doesn't flash on.
So far I built the emitter circuit using the 555 timer and I checked its frequency and it read 38 kHz. Then I connected
the 220 ohm resistor on the reset pin of the 555 timer to pin 6 of the Basic Stamp. Next I took the detector and placed one pin to ground, another pin to power and placed a 220 ohm on the last pin and connected the other side of the resistor to pin 7 of the Basic Stamp. Then I took an led and placed on pin to ground the other end to a 470 ohm resistor, and then connected the other end of the resistor to pin 8 of the Basic Stamp.
When I tried the code I supplied it worked but it seemed liked the led wasn't quick to respond, so I can tell wasn't to an object in front of the detector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST