Question

In: Electrical Engineering

Any microcontroller project with minimum requirement use switches, led, and 7-segment.

Any microcontroller project with minimum requirement use switches, led, and 7-segment.

Solutions

Expert Solution

Bidirectional Visitor Counter using 8051 Microcontroller

This project describes the design and working of a Bidirectional Visitor Counter using 8051 Microcontroller. The main intention is to design a system wherein the number of persons entering or leaving a room is kept track of and displayed on a screen. When a person enters the room, count would be increased, whereas on leaving, the count would decrease. IR sensing mechanism is used to sense the presence of visitors and the whole counting operation is done by a microcontroller.

Bidirectional Visitor Counter Circuit Principle

The circuit works on the principle of IR sensing. Infrared or simply IR Sensors are devices that work with Infrared Light Source and a Photo Detector like a Photo Diode or a Photo Transistor that act as a Transmitter and Receiver respectively.

In this project, we have used an IR LED as the IR Transmitter and a Photo Diode as the IR Receiver. Two sets of IR sensors consisting of an IR LED and Photo Diode are placed at two ends of the entrance of a room.

Output from each sensor is fed to the microcontroller. In normal operation, IR light from the LED would not fall on the Photo Diode as it is a Reflective type IR Sensor. The output from the sensor would be a logic LOW signal in this case.

In case of any interruption (due to any person crossing the path), the Photo Diode would start receiving the IR Light and start conducting. As a result, the output from the sensor would be a logic HIGH signal.

The transition from low to high, for each sensor pair is detected by the microcontroller and accordingly the count would be increased or decreased.

Circuit Design of Bidirectional Visitor Counter using 8051 Microcontroller

The heart of the circuit design lies in designing the Microcontroller interface. Here, we used the Microcontroller AT89C51, which is an 8051 family microcontroller.

The microcontroller AT89C51 is interfaced to the IR sensor pairs at PORT2 pins – P2.0 and P2.1 respectively. The following image shows the circuit diagram of the Reflective Type IR Sensor Module used in this project.

The sensor circuit is designed by selecting appropriate value of resistors for both the LED and the Photo Diode. A 150Ω current limiting resistor is placed in series with the IR LED.

Photo Diode is connected in reverse bias with a series resistor of 10KΩ. Photo Diode and 10KΩ Resistor form a potential divider and the output is given to the non – inverting input of the Operational Amplifier (Op – Amp).

Operation of a  Bidirectional Visitor Counter Circuit

When the system is powered ON, the microcontroller initially initializes the stack pointer and all other variables. It then scans the input pins (P2.0 and P2.1).

In the meantime, when there is no object in front of the IR Sensors, the light from the IR LED would not fall on the Photo Diode of the first sensor pair and hence, the Photo Diode doesn’t conduct.

As a result, the output of the IR sensors is LOW. In other words, ports P2.0 and P2.1 are at logic LOW level. If there is a person in front of the IR Sensors, IR light from the IR LED reflects from the person and falls on the Photo Diode.

As a result, the Photo Diode starts conducting and the output of the sensor becomes HIGH. In other words, the ports P2.0 and P2.1 are at logic HIGH level.

Now when a transition takes place, i.e. a logic HIGH level is received, first at port P2.0 and then at P2.1, the microcontroller sees this as an interruption to sense the passage or entry of a person or an object in front of the IR LED and the Photo Diode.

As per the program, the count value is increased and this value is displayed on the 16 x 2 LCD Display.

If the microcontroller senses logic HIGH, first on the P2.1 and then on P2.0, it assumes that the person is leaving the room and as per the program, the microcontroller decreases the count as displays the same on the LCD.

The program ensures that the count is increased or decreased only when both the sensors detect the person.

A 10KΩ POT is connected at the inverting input. This POT can be adjust in order to change the sensitivity of the IR Sensor. A 16 x 2 LCD Display is used to display the count values. The data line of the LCD are connected to PORT1 Pins of the Microcontroller.

The Control Pins i.e. RS, RW and E are tied to P3.6, GND and P3.7 pins. A 10KΩ POT is connected to contrast adjust pin i.e. Pin 3 of LCD.   

Another important aspect of the design involves designing the oscillator circuit and the reset circuit. The oscillator circuit is designed by selecting an 11.0592 MHz quartz crystal and two ceramic capacitors – each 33pF.

The reset circuit is designed by selecting a resistor of 10KΩ and an electrolyte capacitor of 10µF to ensure a reset pulse width of 100ms and reset pin voltage drop of 1.2V.


Related Solutions

(i) Design a 7-segment LED driver using the truth table given in the lecture notes, inside...
(i) Design a 7-segment LED driver using the truth table given in the lecture notes, inside a hierarchical block. Assume only numbers from 0 to 9 will be sent to your block. Explain your design. Name your block with your student number: eg “123456 LED driver”. (ii) Test your circuit in block form using digital interactive constants to represent the inputs, and showing for every input combination what the LED display shows. Explain your testing.
Design a 4-bit up/down counter which displays its output on the the 7-led segment using the...
Design a 4-bit up/down counter which displays its output on the the 7-led segment using the decoder used in Lab 2. In this lab, you will design a 4-bit up/down counter which displays its output on the 7-segment LED using the decoder that you designed in Lab 2. The 4-bit up/down counter module has 4 inputs, Clk_1Hz, Reset, Pause, and Up; and a 4-bit output Count. If Reset is 1, the counter should reset its count value to zero (0000)....
Design the hardware connection of the SEN-11931, reuse the 4-bank 7-segment LED connection from Lab 4...
Design the hardware connection of the SEN-11931, reuse the 4-bank 7-segment LED connection from Lab 4 for the mbed to read the temperature from the SEN-11931 and display the temperature in Fahrenheit degrees on the LED display in the format of xxx.x. Build your circuit and include all the required information about your hardware design in your lab report. You will also need to make the decision on whether pull-up resistors are needed.
Using Selection Sort on an any array of size 7, what will be the minimum/maximum number...
Using Selection Sort on an any array of size 7, what will be the minimum/maximum number of comparisons and number of exchanges? 1 for i = 1 to A.length-1 2 for j = i+1 to A.length 3 if A[j] < A[i] 4 exchange A[i] with A[j]
Use Word to create a task list with a minimum of 25 tasks for the project...
Use Word to create a task list with a minimum of 25 tasks for the project plan. The tasks should be in the format of verb then noun. Deliverable headings should be nouns. The list should be a complete plan to build a local area network in an office.
Please Avoid Plagiarism , Don't use handwriting. 250 word minimum discussion. Choose any system of the...
Please Avoid Plagiarism , Don't use handwriting. 250 word minimum discussion. Choose any system of the human body and prepare a response to the following questions--> What body system do you have the best understanding of and why?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT