- Ultrasonic Distance Meter Using Microcontroller 8051 Pdf Download
- Ultrasonic Distance Meter Using Microcontroller 8051 Pdf
- Ultrasonic Sensor with Accelerometer Based Smart Wheel Chair Using Microcontroller Sandeep Kumar, P.Raja 1 Ph.D Student, Electronics & Communication, OPJS University. Ultrasonic Sensor, Microcontroller, LCD, GSM Modem, Mobile 1. Mechanical energy transformation to measure distance from the sensor to the target object.
- Arduino Ultrasonic Sensor Code for Distance Measurement. In code we read time by using pulseIn(pin). Getting Started with 8051 Microcontroller. Htoo Oct 18, 2015 Log in or register to post comments; Can you give me a distance meter flow chart. Dan Jan 11, 2016 Log in or register to post comments; nice work. I just have one query.
List of 8051 based Microcontroller projects from Microtronics. GSM, GPS projects, RFID, Touchscreen based projects. 8051 Microcontroller Projects List. We have a wide range of 8051 Microcontroller project. So here the engineering students can get 8051 Microcontroller project for their study purpose. Android based Ultrasonic Distance.
Hi guys… Today we are going to see Ultrasonic Sensor Interfacing with 8051.
Post Contents
- 7 Code
- 7.3 Full Code
Before we will start i would suggest you to read these topics. Then you can understand this strongly. If you already know, please go ahead.
- 8051 Microcontroller
- Ultrasonic Sensor [HC-SR04]
- LCD Module (To print the Distance)
The measurement of Echo pulse can be done with the help of external Interrupt and Timer modules of 8051 Microcontroller. In capture mode when external pulse is fed to the interrupt the timer starts counting and will stop only after the state of pulse is changed. Steps to follow to program controller as a capture device.
- Initialize Timer0 module as 16 bit timer with Gate bit as 1.
- Making Gate bit as 1 will transfer the control of timer to external interrupt pin INT0.
- When there is an interrupt pulse timer 0 starts counting and stops as soon as the interrupt disappears.
- The value in the Timer 0 (TH0 and TL0) gives the time period or length of the pulse.
- Connect the Trigger pin of the HC-SR04 module to any I/O pins of 8051 controller.
- Connect the Echo pin of the module to interrupt pin INT0 of the Microcontroller.
- Send a pulse of minimal timer period 10us, this will make the Ultrasonic module to send burst of data.
- The reflected waves will be sensed by the module and it exhibits the output in Echo pin logic high or 1 to INT0 pin of Microcontroller.
- This creates an interrupt and Timer 0 will start counting.
- When the pulse from echo pin alters its state to logic 0 or low the timer 0 stops counting
- The length of pulse from echo pin is proportional to the distance at which the object is located.
- The value in the Timer 0 gives the distance of course with some simple calculations.
CALCULATION
According to the data sheet the distance can be given by the formula :
Distance in cm = Timer 0/59
Distance in inch = Timer 0/148
Ultrasonic Distance Meter Using Microcontroller 8051 Pdf Download
LCD:
- RS – P0.0
- RW – P0.1
- EN – P0.2
- Data Lines – P2
Ultrasonic Sensor:
- Trigger – P3.5
- Echo – P3.2
Sending Trigger Pulse
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 | #include<intrins.h> #define lcd_data P2 sfr16 DPTR=0x82; sbit trig=P3^5; sbit rw=P0^1; voidcmd(unsignedchara); voidshow(unsignedchar*s); { cmd(0x0e); cmd(0x0c); } voidcmd(unsignedchara) lcd_data=a; rw=0; lcd_delay(); } voiddat(unsignedcharb) lcd_data=b; rw=0; lcd_delay(); } voidshow(unsignedchar*s) while(*s){ } { for(i=0;i<=1000;i++); voidsend_pulse(void) TH0=0x00;TL0=0x00; _nop_();_nop_();_nop_();_nop_();_nop_(); trig=0; { send_pulse(); while(echo); DPL=TL0; if(DPTR<38000) else returnget; voidmain() TMOD=0x09; TR0=1; show('DIS'); while(1){ range=ultrasonic(); dat(((range/10)%10)+48); } |
So this code will print the distance in LCD module. You can use this module for any robot projects.
Related
Download Project Document/Synopsis
Ultrasonic Distance Meter Using Microcontroller 8051 Pdf
The project aims at measuring the distance of any object with the help of an ultrasonic transducer for inaccessible areas like high temperature, pressure zones where the traditional methods are inappropriate to be implemented.
A microcontroller of 8051 family is used to interface the ultrasonic module. Ultrasonic module consists of a transmitter and a receiver. The module transmits the sound waves to the object and the transducer receives the waves reflected back from it. The measurement of the distance is calculated by the total time taken from sending the waves and receiving it with respect to the velocity of sound. The calculation is done by the programmed microcontroller and displays it on LCD screen.
- Hardware Specifications
- 8051 Microcontroller
- Crystal Oscillator
- Resistors
- Capacitors
- Transistors
- Cables and Connectors
- Diodes
- PCB and Breadboards
- LED
- Transformer/Adapter
- Push Buttons
- Switch
- IC
- IC Sockets
- Software Specifications
- Keil µVision IDE
- MC Programming Language: C