Discussion forum for the BasicX family of microcontroller chips.
|
i was wondering if this would work. i am building a rc car that will be robotic as well. i happen to have 4 infrared emitting led's and 2 infrared collector led's. i was wondering if it is possible for the bx24 to pulse the 4 emitter led's and have it so that when the 2 collector led's pick up the pulse (reflecting off a wall) the rc car would turn away and slow down at the same time. so the emitters and collector would be on the front of the rc car. do i need the sharp module to make something like this work? i just have these parts laying around and i want to put them to use. does this sound like a good idea? conrad |
|
|
|
Robotizing a RC car is quite popular actually. it's the programming that gets everyone. Fairchild makes some QRB1113 and 1114 IR detectors (Vishay too) that work good for this purpose. the detectors have a signal amplifier built in to improve sensitivity and range. www.digikey.com and www.kronosrobotics.com www.parallaxinc.com and some others all sell them. The Parallax robotics manual has a great tutorial on using them. The problem is that these IR sensors (doesn't matter which sensor) only work out to about maybe 30cm or so. Longer ranges would require going to ultrasound and using devices like the Devantech ultrasound rangefinders www.acroname.com has them but others sell them too. You could hack a Polaroid unit too, but it may be more hassle than it's worth. Speed would be the next killer problem. By the time the MCU detects the wall, you may already be hitting it before the MCU can initiate a turn with the car. Start your speeds really slow and work your way up faster gradually. RC car parts are still expensive when you slam into a wall at speed. You might think that IR is the speed of light and ultrasoind is the speed of sound, but it can take you quite a few milliseconds to detect, determine, and react to a object. At 30mph there isn't a lot of time to do anything, you have to be fast. Even the steering servo is slow to respond at fast speeds. There is a lag time (delay) between when the MCU initiates a scan for a object like the wall, and how long it takes for the signal to reflect, and be picked up by the MCU. Then the software lag time of what to do before you hit the object (slow down, turn left turn right, swerve, et cetera. You should be able to build up the speed to a certain point before you start to have problems, then you can start optimization to improve on it. The problem is the MCU can't anticipate things coming like a human can. Makes for lots of fun and experience though. I can attest to how expensive the wall slamming part is. -----Original Message----- From: mixman1982 [mailto:] Sent: Saturday, July 06, 2002 9:23 PM To: Subject: [BasicX] ir emitter/detector i was wondering if this would work. i am building a rc car that will be robotic as well. i happen to have 4 infrared emitting led's and 2 infrared collector led's. i was wondering if it is possible for the bx24 to pulse the 4 emitter led's and have it so that when the 2 collector led's pick up the pulse (reflecting off a wall) the rc car would turn away and slow down at the same time. so the emitters and collector would be on the front of the rc car. do i need the sharp module to make something like this work? i just have these parts laying around and i want to put them to use. does this sound like a good idea? conrad |
|
|
|
thank you earl for such a great post! > Robotizing a RC car is quite popular actually. it's the >programming that > gets everyone. ya i figured it would be easy to write up a bit of code to make it avoid an object and to slow down the main drive motor. but with this setup it will still incorperate the remote control aspect. but also having object avoidance. i want to make an "uncrashable r/c car". b/c a robot car would be useless to me. haha. so having it piggyback off the r/c circuit it would help avoid objects. > Fairchild makes some QRB1113 and 1114 IR detectors (Vishay too) >that work > good for this purpose. the detectors have a signal amplifier built >in to > improve > sensitivity and range. www.digikey.com and www.kronosrobotics.com > www.parallaxinc.com > and some others all sell them. The Parallax robotics manual has a >great > tutorial on using them. okay ya i might go that route. but i swear i had some infrared sensors in my parts box but apparantly i don't. so i might have to try some of those. > The problem is that these IR sensors (doesn't matter which sensor) >only work > out to about maybe 30cm or so. Longer ranges would require going to > ultrasound and using devices like the Devantech ultrasound >rangefinders > www.acroname.com has them but others sell them too. You could hack >a > Polaroid unit too, but it may be more hassle than it's worth. ya i don't need a super good range or anything like that. right now i am going to start from point a and learn as much as i can then maybe step up and add better sensors n such. i figure the infrared is one step up from the switch method. haha. > Speed would be the next killer problem. By the time the MCU >detects the > wall, you may already be hitting it before the MCU can initiate a >turn with > the car. Start your speeds really slow and work your way up faster > gradually. RC car parts are still expensive when you slam into a >wall at > speed. see for me my r/c car isn't insanely fast or fast at all. haha. here is a link to what it is http://www.auditt.org/photo_gallery/misc/cannedheat02.jpg/view its 5-1/2" long and can go maybe less than walking speed. so its not terribly fast. so just basic infrared would be fine for me. haha. > Makes for lots of fun and experience though. ya thats why i want to do something like this. it seems fun and i can see what my code is doing in real life. it just seems super cool. and i know i will learn a lot by goofing around with this project. > I can attest to how expensive the wall slamming part is. i guarantee you it won't be expensive for me considering one of thoes whole cars costs $30-ish canadian. haha. i just like the small size and cheapness so if i screw up its not a huge deal. haha. but a good base to start learning on. conrad |
|
|
|
Conrad, We have run the outputs of an RC receiver into a BX-24 (monitored 4 channels, actually) and forwarded the signals on to devices in a 100 lb robot, so it is reasonable to insert the BX-24 inline in a rc controlled vehicle. Be aware that the way they get the inexpensive model cars cheap is to combine the electronics onto a single board. A more expensive car uses a separate receiver and speed controls and is relatively easy. You won't have that luxory and will have to hack the circuit. As far as sensors, check out www.acroname.com. I have used both the Sharp GP2D12 ($13.50) infrared and the Devontech SRF04 ($25) untrasonic detectors. The GP2D12 works nicely for this purpose because a reading doesn't have to be kicked off, but rather a voltage proportional to the distance is continuously available. Check out these and other sensors at the site. Andy --- In basicx@y..., "mixman1982" <catchya@s...> wrote: . . . > > > Makes for lots of fun and experience though. > > ya thats why i want to do something like this. it seems fun and i > can see what my code is doing in real life. it just seems super > cool. and i know i will learn a lot by goofing around with this > project. > > > I can attest to how expensive the wall slamming part is. > > i guarantee you it won't be expensive for me considering one of > thoes whole cars costs $30-ish canadian. haha. i just like the > small size and cheapness so if i screw up its not a huge deal. > haha. but a good base to start learning on. > > conrad |
|
|
|
ya i will look into thoes devices. but i did end up finding ir collectors in my parts bin. i knew they were in there somewhere. they are in the shape of an led. so i was thinking if i had the ir emitters pulse at 40khz. how can i get the bx24 to make the led's puslse at that rate? or is that even necessary? do you know of any sample ir emitter/collector code? the r/c car i am using is VERY easy to hack into. the chip has an output for forward, reverse, left and right. i found this link that shows the outputs from the chip to a small h-bridge. so i just added diodes to the output of the bx24 to the pins on the r/c circuit board. and it does control it the way i want. but i just need to figure out how to make the ir sensors work. conrad |
|
|
|
You should really read the article about it in the robotics 1.5 manual at www.parallxinc.com It is very simple once you see that. Another way is to use a 555 timer tuned to 38.5khz or to build a oscillator using 7404 or 7400 IC's. If you use a external oscillator circuit you feed the osc signal into a nand gate and the I/O pin from the MCU into the other gate on a nand gate. Then the output from the nand ggate goes to the IR emitter. Your problem is on the receiver or detector side. You will likely need to use a op amp (to increase the signal gain) and a PLL IC tuned to 38.5khz (to get a lock with less interference from florescent light sources and such. Radio Shack sells IR detectors as well. But I really like the QRB1113/4 detectors from Fairchild myself (they have all this stuff already built into them). The Radio Shack ones I saw were the Vishay version of the IR detectors like Fairchild makes. The plain IR phototransistors tend to pick up noise from all around you, especially florescent lights overhead. Thus you get into IR filters (those are a real trick to make), op amps for gain, and frequency filters to block interference from similar sources. -----Original Message----- From: mixman1982 [mailto:] Sent: Monday, July 08, 2002 11:08 PM To: Subject: [BasicX] Re: ir emitter/detector ya i will look into thoes devices. but i did end up finding ir collectors in my parts bin. i knew they were in there somewhere. they are in the shape of an led. so i was thinking if i had the ir emitters pulse at 40khz. how can i get the bx24 to make the led's puslse at that rate? or is that even necessary? do you know of any sample ir emitter/collector code? the r/c car i am using is VERY easy to hack into. the chip has an output for forward, reverse, left and right. i found this link that shows the outputs from the chip to a small h-bridge. so i just added diodes to the output of the bx24 to the pins on the r/c circuit board. and it does control it the way i want. but i just need to figure out how to make the ir sensors work. conrad |
|
Here is something you can try. No guarentees. I have used a technique for transmissive IR sensing that may work in reflective mode. It requires just the LED, current limit resistor, phototransistor, and pull-up resistor (I used the internal pull-up). Wire the LED to an output pin through the current limiting resistor. Feed the phototransistor (emitter to ground, collector to the input pin) into an ADC input with the pull-up turned on. 1. Turn on the LED 2. Take an ADC reading 3. Turn off the LED 4. Take an ADC reading If the 'off' reading is significantly higher (as determined emperically) from the 'on' reading, an object is near. If they are approx the same, no object. The technique adapts well to most ambient lighting conditions. Try it with your $30 car. I don't suggest it for a $300 car <G>. Andy --- In basicx@y..., "mixman1982" <catchya@s...> wrote: > ya i will look into thoes devices. but i did end up finding ir > collectors in my parts bin. i knew they were in there somewhere. > they are in the shape of an led. so i was thinking if i had the ir > emitters pulse at 40khz. how can i get the bx24 to make the led's > puslse at that rate? or is that even necessary? do you know of any > sample ir emitter/collector code? the r/c car i am using is VERY > easy to hack into. the chip has an output for forward, reverse, > left and right. i found this link that shows the outputs from the > chip to a small h-bridge. so i just added diodes to the output of > the bx24 to the pins on the r/c circuit board. and it does control > it the way i want. but i just need to figure out how to make the ir > sensors work. > > conrad |