0% found this document useful (0 votes)
89 views

Object Counter Using 8051 Microcontroller

Project for 8051 microcontroller

Uploaded by

Hrudaya Sawant
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

Object Counter Using 8051 Microcontroller

Project for 8051 microcontroller

Uploaded by

Hrudaya Sawant
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

     

in 8051 PROJECTS

Object counter using 8051

Object counter using 8051 microcontroller.

This article is about a simple object counter/visitor counter using 8051 microcontroller
. AT89S51 belonging to the 8051 family is the microcontroller used here. This circuit
can count the number of objects passing across a line , number of persons passing
through a gate/door and so on. The can be simply divided into two sections i.e. the
sensor section and the display section.

Sensor.

The sensor part consists of a ultra bright led (with focus), and LDR, opamp LM324 and
the associated passive components. The LED is placed on one side of the door and the
LDR is placed on the other side so that the light from the LED falls directly on the x
LEARN MORE
LEARN MORE
LDR.As you know, the resistance of the LDR has an inverse relationship with the
mersenfuses.net
intensity of the light falling on it. The preset resistor R14 is so adjusted that the
24/7
voltageCustomer Service
across the LDR is below 1.5V when it is illuminated. This voltage (labelled A in x
the circuit diagram) is connected to the inverting input of the opamp which is wired as
a comparator with reference voltage 1.5V (set using R15 and R16).Capacitor C1 is
meant for bypassing noise or anything like that which may cause false
triggering.Resistor R13 is meant to control the current through the LED.

When the light is falling on the LDR the voltage across it will be less than the reference
voltage and so the output of the opamp remains high. When the light beam is
interrupted, the voltage across the LDR goes above the reference voltage and so the
opamp output goes low and it indicates a pass.

Display section.

The output of the opamp is fed to the INTO (interrupt 0) pin of the microcontroller. The
microcontroller is programmed to count the number of negative edge pulses received
at the INT0 pin and displays it on the three digit seven segment display.

Circuit diagram.
Object counter using 8051

Program.

ORG 000H 
SJMP INIT 
ORG 003H  // starting address of interrupt service routine (ISR) 
ACALL ISR // calls interrupt service routine 
RETI 
 
INIT: MOV P0,#00000000B 
      MOV P3,#11111111B 
      MOV P1,#00000000B 
      MOV R6,#00000000B 
      MOV DPTR,#LUT 
      SETB IP.0     // sets highest priority for the interrupt INT0 
      SETB TCON.0   // interrupt generated by a falling edge signal at INT
      SETB IE.0     //enables the external interrupt 
      SETB IE.7     //enables the global interrupt control 
 
MAIN: MOV A,R6

      MOV B,#100D 
      DIV AB 
      ACALL DISPLAY 
      ACALL DISPLAY 
      SETB P1.0 
      ACALL DELAY 
      ACALL DELAY 
      MOV A,B 
      MOV B,#10D 
      DIV AB 
      ACALL DISPLAY 
      CLR P1.0 
      SETB P1.1 
      ACALL DELAY 
      ACALL DELAY 
      MOV A,B 
      ACALL DISPLAY 
      CLR P1.1 
      SETB P1.2 
      ACALL DELAY 
      ACALL DELAY 
      CLR P1.2 
      SJMP MAIN 
 
ISR: INC R6     //interrupt service routine 
     RET 
 
DISPLAY: MOVC A,@A+DPTR // display sub routine 
         CPL A 
         MOV P0,A 
         RET 
 
DELAY: MOV R3,#255D  // 1mS delay
LABEL: DJNZ R3,LABEL 
       RET 
LUT: DB 3FH 
     DB 06H 
     DB 5BH 
     DB 5BH 
     DB 4FH 
     DB 66H 
     DB 6DH 
     DB 7DH 
     DB 07H 
     DB 7FH 
     DB 6FH 
END

About the program.

The program is written so that, it keeps displaying the current value in register R6 on
the three digit seven segment display. When ever there is a valid negative going pulse
(interrupt) at the INT0 pin, the program branches to the interrupt service routine (sub
routine ISR). Subroutine ISR increments the value in register R6, then jumps back to
the MAIN loop and the display gets updated by the new value.

Notes.

Entire circuit can be powered from a 5V DC supply.

LDR must be placed in an enclosure so that the light from LED alone falls on it.

 
OBJECT COUNTER USING 8051 VISITOR COUNTER USING 8051

AUTHOR

admin

RELATED POSTS

Interfacing Nokia 5110 Display to 8051 Micro Controller


JULY 1, 2017

Moisture sensing automatic plant watering system using 8051.


Moisture sensing automatic plant watering system using 8051.
DECEMBER 19, 2016

Heart rate monitor with sms alert.


AUGUST 10, 2016

27 COMMENTS

Zeenath
3 YEARS AGO

I used IR sensors and my project is automatically counting with any objects when power is given can u
tell me the possible errors

faiz
5 YEARS AGO

which software can be used to compile the code

faiz
5 YEARS AGO

Which type of seven segment it os??anode or cathode?

sharnitha
5 YEARS AGO

can u provide me the block diagram for this project

Sajor Barrie
5 YEARS AGO

can anyone please explain the circuit diagram briefly say the functions of the components used
especially the resistors. will be very grateful. regards

Sajor Barrie
5 YEARS AGO

hello helper. please i want to know the speci몭c componenets to be used say for example the 7-segment
display type and also the type of programming language used.regards

Umang khatri
5 YEARS AGO

Thanks, It’s working.


I’ve used Common Anode 7 segment for this. Only problem i faced was- Reset function at pin9. Project
started working when i removed all connections from pin9 of 8051.
Thanks again.

newton
3 YEARS AGO

if you remove the connections from pin 9 , then where did you connect the reset button ?

Shivam
3 YEARS AGO

Can I see your code

vikrant
6 YEARS AGO
6 YEARS AGO

Plz help me to convert this program into c language …

HAMZA
6 YEARS AGO

Hello Sir I am using Proteus isis 7 simulator.


my counter is not working, displaying 000 plz give me some advice

manju
6 YEARS AGO

Sir, plzzz suggest software for this program.

sagar khandale
6 YEARS AGO

which seven seg display is used?common anode or cathode

omkar
6 YEARS AGO

can i use IR sensor for this?

mithun
6 YEARS AGO

itz not working…..please help


rahul gupta
7 YEARS AGO

it was good

asif ali khan


7 YEARS AGO

sir plz tell me which 7 segment display can i use in the project common anode or common cathode

riddhi
7 YEARS AGO

Which type of seven segment it os??anode or cathode?

Ankit DHall
7 YEARS AGO

What type of 7 segment display is used? Please tell asap. I really need it.

Ankit
7 YEARS AGO

Can anyone please send a report on this circuit if they have made?

Waqar Ahmad
7 YEARS AGO

Thanks a lot..it’s working just 몭ne.


dahlia
6 YEARS AGO

really?? how can you do that? please i need your help for my 몭nal year project. i you can reply my
amail as soon as posibble, really2 appriciate it. thanks

antony
5 YEARS AGO

which type of led…common anode or cathode

ratnesh thepade
7 YEARS AGO

its not working….. comparator is not changing its state from low to high or from high to low.. please
help… as soon as possible..

Kornell Azih
8 YEARS AGO

I am relatively new in programming, what type compiler did you use for the writing of this program,
because I tried to build it with mide-51 ut gave ne 9 errors?

shegzzyy
8 YEARS AGO

Thanks.which software can be used to compile the code


safoor
8 YEARS AGO

Dear sir,
Its an interesting circuit to put in practice thanks for that, but I would like to understand how the
programming is done and to load it. Also to learn how to program it, so that we can create our own.
Thanks And regards
Safoor

ABOUT US

CircuitsToday.com is an effort to provide free resources on electronics for electronic students and
hobbyists. Our webiste has thousands of circuits, projects and other information you that will 몭nd
interesting.

ARDUINO COURSE
CATEGORIES

101-Announcements (29)

555 Timer IC (16)

8051 (26)

8051 projects (21)

Ampli몭er Circuits (39)

Arduino (81)

ARM (3)

Audio Circuits (105)

Automotive Circuits (28)

AVR (23)

Basic Electricity (1)


Basic Electronics (17)

Battery Circuits (23)

C plus plus (7)


C Programming (14)

Cable TV Circuits (1)

Camera Technology (5)

Clipping and Clamping Circuits (7)

Clocking & Timer Circuits (2)

Conversion Circuits (10)

Counter Circuits (2)

Counters (2)

Digital Electronics (11)

Drones (1)

Education & Training (7)

Electronic Components (32)

Electronic Keys & Locks (3)

Electronics Books (10)

Electronics Jobs (5)

Embedded Systems (7)

Equipment Reviews (1)

Events
Events (3)

Fan Circuits (1)

Filter Circuits (16)

Fire Alarm (3)

Fun & Game Circuits (14)

Gadget Reviews (6)

Guides (15)

Ham Radio Circuits (2)

High Voltage Circuits (1)

History (26)

Home Circuits (35)

Industrial Circuits (15)

Industry News (1)

Infographics (1)

Instruments (13)

Integrated Circuits (20)

Inverters (5)

Lab Manuals (20)

LED related (3)

Light Related (14)

Lighting Circuits (44)

MATLAB (3)
Microcontrollers (12)

Mobile Phone Related (3)

Motor Related (14)

Nanotechnology (14)

Oscillators (25)

PCB (5)

Peripheral Interface Controller (PIC) (29)

Power Controller Circuits (8)

Power Electronics (3)

Power Supplies (72)

Product Reviews (12)

Project Ideas (1)

Projects (12)

Proteus (16)

Proximity Detectors (3)

Radio Circuits (30)

Radio Transmitters (19)

Raspberry Pi (4)

Relays (3)

Remote Circuits (12)

Reviews (8)
Robotics (7)

RTOS (2)

Security & Saftey (17)

Sensor Circuits (16)

Signal Conditioners (11)

Signal Generators (13)

Speed Controller Circuits (1)

State space analysis (2)

Switching Circuits (6)

Tech News (90)

Telephone Related (9)

Television Related (4)

Temperature Related (3)

Test & Measurement Circuits (38)

Testing Components (9)

Three phase circuits (1)

Timer Circuits (3)

Tone generator circuits (20)

Tools and Softwares (6)

Transmitters (7)

Tutorials (163)

UPS
UPS (2)

USB Circuits (3)

Videos (5)

VLSI (36)

Voltage Regulators (15)

OTHER LINKS

About

Authors

Electronic Circuit Symbols

Advertise With Us

Write For Us

Disclaimer

Privacy Policy

report this ad
© 2020 CircuitsToday

 Top

You might also like