|
Conveyor belt controller circuit

Connections: - as shown in above circuit two ports of 89C2051 P1 & P3 controls entire system. Pins P1.0, P1.1, P1.2 are connected to fwd, stop and drop controls through buffers 7407. P1.5, P1.6 & P1.7 drives 3 LEDs as shown. So P1 is completely output port. All four sensor outputs are connected with P3 pins P3.2, P3.4, P3.5 & P3.7 through inverters 74LS04. One LED indicator is also connected with each output. Pin P3.0 is connected with reset input of counter. Also the sensor 4 output is directly connected with clock signal of counter. A 12 MHz crystal along with 2 33 pf capacitors is connected with XTAL pins to provide clock signal. A push button switch along with capacitor C1 forms power on reset circuit.

Above figure shows 2 digit counter using CMOS chip CD4026, that is counter cum 7 segment display driver. Its outputs can be directly connected to common cathode type 7 seven segment display. As shown in figure the clock signal from sensor 4 is given to chip U3. Its carry out signal is connected with clock signal of chip U1. Clock inhibit signal (INH) of both chips are tied to Gnd and display enable signals (DEI) are tied to Vcc. The master reset (MR) of both chips are connected with reset output from 89C2051.
Operation:-
-
Controller will apply fwd pulse to motor and motor will start rotating
-
At the same time one timer is started. Container will move forward and this is indicated by D1
-
As container passes through sensor 1 the timer is reset
-
As a container reaches to sensor 2 immediately stop pulse is applied and container is stop. D2 glows to indicates this event
-
Now the drop signal is made high to drop items from nozzle to container.
-
The counter will display the count and counter will count no of items. It will count 50 items
-
Now again fwd pulse is applied.
-
As container reaches to sensor 4. Again motor is stopped for 3 sec
-
Again this cycle repeats
-
Now if there is no container on belt. There is no output from sensor 1.
-
So timer overflows and that means there will be no more containers to be filled.
-
So motor will be automatically stopped.
Software program: -
Software program is very simple that is written in C language and compiled using KIEL (ODE) cross compiler. Along with main function entire program is a combination of 5 different functions.
Delay function generates random fix amount delay (<10 ms) to provide pulse to LEDs
Bigly function generates fix amount delay of 2 sec to hold the conveyor belt when container reaches sensor 4 position
Mildly function is again random fix amount delay (<1 ms) provided in between two item counts.
Timer function is interrupt enabled function and it is called automatically when timer overflows from all 1's to all 0's. It is called after every 50 ms. It increases the count (b) and calculate up to 200. If this count is reached that means total 10 sec delay is over then it will apply stop pulse and stop rotating motor and belt
Interrupt function is also interrupt enabled function and it is called when the container passes through it. It just resets the count (b) every time as containers are passing through belt.
Main function performs following tasks
-
Initializes ports, timer and enables interrupts
-
Then it applies start pulse to motor and reset pulse to counter
-
Indicates motor is running on LED
-
Waits for container to reach at sensor 2. When it reaches stops the motor
-
Now it applies high logic to drop pin to drop item into container
-
Counts number of items to 50. And then stops dropping items.
-
Again applies start pulse to motor and now waits for o/p from sensor 3
-
As container reaches to sensor 3 position sends stop pulse
-
After 2 sec again the same above cycle repeats.
click here for complete coding in C with necessary comments. |