Lift Counter using PIC12F629 Microcontroller

This project has been developed due to a request from Mr Moshweunyane ([email protected]). He asked for a circuit that would count up when someone entered a lift and count down when someone exited, using two infra-red sensors.
All we had to do was take the 2-digit up/down counter and add two optical sensors.
These sensors could be any type of detector and we have shown two LDR’s (Light Dependent Resistors) and two amplifying transistors mounted on a sub-board. You can use infrared or photo-transistors as the sensors to get equal results.
All the β€œdetection” is done via the software and the program β€œpolls” the detectors and works out if a person is entering or leaving the lift.

Lift Counter
The reason for polling the sensors is clever. It prevents the micro being caught in a loop and allows the program to display numbers at the same time.
The same design can be used for a shop or any activity where you need to know if a room is getting too crowded.
This arrangement has been requested for bathrooms in an attempt to control and avoid unsavory behavior.
The circuit is designed around a PIC16F628A. It has been presented on an experimental PC board using surface-mount components and was built in less than 1 hour, with about 2 hours to write and finalise the program.
It uses β€œIn Circuit Programming” via PICkit-2 or Talking Electronics Multi-Chip Programmer, plus the adapter (specific to each programmer) shown below.
You can add an alarm feature if the lift gets overcrowded or if someone is in the bathroom when the shop is closing.

This project has been created as an add-on for the 2-Digit Counter. We placed the two transistors, LDR’s and pots on a small PC board and connected it to the 2-Digit Counter via a plug and socket.

The light detectors have to be set up for the application. The best is to use infra-red detectors as they are not upset by ambient light.
Each detector has to be set up so that light falling on the detector makes the input line LOW.
When the beam is broken, the line goes HIGH.
We have directly coupled the output of the detector to the micro however you could use capacitor couplingΒ  and breaking the beam will produce a pulse.

The files for Lift Counter
LiftCounter.asmΒ Β 
LiftCounter.hex
LiftCounter-asm.txt (.asm)
LiftCounter-hex.txt (.hex)

 

For more detail: Lift Counter using PIC12F629 Microcontroller


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.