ultrasonic sensor interfacing with 8051

  
Inside:
Repository
If you want to make your robot sense the objects in it`s surroundings i suggest you to go for an ULTRASONIC sensor. Though the IR based sensors are cheep, their working range may vary due change in ambient light and won`t give accurate range values. In case of ULTRASONIC sensors they work based on the principle of RADAR(RAdio Detection And Ranging).
ultrasonic sensor interfacing with 8051 - schematic

A RADAR transmits electromagnetic "pulse" towards the target and receives the "echo" reflected by the target. Then the range of the target is determined by the "time lagging" between transmitted pulse and the received "echo". Generally microwave and ultrasonic frequencies are used in RADARS STEP1. Make "Trig" pin of the sensor high for 10 µs. This initiates a sensor cycle. STEP2. 8 x 40 kHz pulses will be sent from the transmitting piezzo transducer of the sensor, after which time the "Echo" pin on the sensor will go from low to high. STEP3. The 40 kHz sound wave will bounce off the nearest object and return to the sensor. STEP4. When the sensor detects the reflected sound wave, the Echo pin will go low again. STEP6. To inter face the sensor to AT89S51 microcontroller we need two I/O pins. One of them is external interrupt pin(INT0 or INT1) for measuring the pulse width at the echo pin. and any other pin say P3. 5 for trigger. STEP3. Configure the TIMER0 of 8051 in 16 bit mode with GATE  bit enabled. If the GATE pin is enabled and timer run control bit TR0 is set, the TIMER0 will be controlled by INT0 pin. When INT0 is high then the TIMER0 starts counting. Whenever INT0 goes low TIMER0 holds its count. So load the TMOD register with 00001010=0x0A; (better refer to any book of 8051).



Leave Comment

characters left:

New Circuits

.