Sensors

From XinCheJian
Jump to navigation Jump to search

We tried it generate the 38kHz frequency with an AtTiny2313 and it failed. So we need another solution for this and that will probably be the 555.

The code we was using was written for another µC but we got it running on the Attiny2313. However, it seems that the command delayMicroseconds() is not fixed to the real value. We then tried the example scetch "Blink" and changed the values for Delay(1000) to DelayMicroseconds(13) for HIGH and LOW. The frequency we got was not stable and not even near 38kHz. At some point i got 40Hz or 15kHz.

Modified Blink sketch:

void loop() {
 digitalWrite(led, HIGH);
 delayMicroseconds(13);
 digitalWrite(led, LOW);
 delayMicroseconds(13);

About the sensors on the robot we was thinking to put 4 sensors on top of it. One is facing forward and is inside a little tube (shrink tube or similar) to get directional. the other three 38kHz receivers are facing front left, front right (120°) and one backwards. Those receivers are not directional and will just get the reading approximately. Once one of those receivers is receiving the signal the robot will turn the front in direction to the IR emitter and will stop turning as soon as the directional receiver is receiving the signal. This should give us a corridor of approximately 5° and this is precise enough to find the goal ;-)

The beacon with the 555 timer is working. However, we have to build a reliable one with exactly adjusted components since the change of frequency depands on used the resistors and capacitors. The beacon has now a range of about 1 meter and is quite directional (maybe the IR LED is emitting a very narrow beam). The robot detact the signal depending which sensor is facing torwards the beacon. Success!!!

We built a beacon on a PCB now. This can be used to check and adjust the programming. The robot is chasing the beacon according to the sensor which see's the IR beam of the beacon. Now we can develop the agorithm for the communication. besides this we need to build at least one more test robot platform and one or two beacons.