Hey,
This blog is about the circuit that I've designed for my college project.
I've designed Object counter using PIC16F877 and used Op-Amp as comparator-LM324.
The circuit diagram and simulation is as under:
1).Sensor Circuit.
Working of Sensor:
2).Microcontroller Programming and Proteus Simulation:
I've done simulation in proteus. I couldn't find a way to give input from sensor to microcontroller for simulation. So, I've skipped that part and simulate only initialization of 16x2 LCD.
Programming is done in MPLAB using HI-Tech C Compiler. I've made my own library to use 16x2 LCD.I've made a simple mistake while programming that skips the counts of 10,20,30....etc.
So, whenever count reaches to 8,18,28..... it skips 9,19,29,..... and shows 10,20,30....etc.
The recording was done before I can edit my program.I made some modification after that and now the circuit works fine. So, hope you'll bear me for this video that was recorded before I can find my mistake.
Bill Of Materials
1 LDR
1 9V Battery
Some Photos
PS: To get proteus file or MPLAB coding file mail me or write your e-mail address in comment.
This blog is about the circuit that I've designed for my college project.
I've designed Object counter using PIC16F877 and used Op-Amp as comparator-LM324.
The circuit diagram and simulation is as under:
1).Sensor Circuit.
Working of Sensor:
- Resistance of LDR when light falls on it=7.8kΩ
- Resistance of LDR when light is blocked=19kΩ
- Voltage drop across R2 when light falls on LDR=1.42V
- Voltage drop across R2 when light is blocked by an object=0.7V
- Voltage given to comparator by potentiometer=1.38V
- Output Voltage from Comparator=2.17V
2).Microcontroller Programming and Proteus Simulation:
I've done simulation in proteus. I couldn't find a way to give input from sensor to microcontroller for simulation. So, I've skipped that part and simulate only initialization of 16x2 LCD.
Programming is done in MPLAB using HI-Tech C Compiler. I've made my own library to use 16x2 LCD.I've made a simple mistake while programming that skips the counts of 10,20,30....etc.
So, whenever count reaches to 8,18,28..... it skips 9,19,29,..... and shows 10,20,30....etc.
The recording was done before I can edit my program.I made some modification after that and now the circuit works fine. So, hope you'll bear me for this video that was recorded before I can find my mistake.
Bill Of Materials
U1 PIC16F877
U2 LM324
X1 4MHz Quartz Crystal
2 15pF Capacitor
1 16x2 JHD162A LCD
2 150Ω resistors
2 1kΩ resistors
2 IC Sockets
1 Yello LED in white
2 10k POT1 LDR
1 9V Battery
Some Photos
PS: To get proteus file or MPLAB coding file mail me or write your e-mail address in comment.