MCU Examples.com
PIC Microcontroller Project Examples, free source codes and resources collection.
The system consists of a PIC16F877A microcontroller as the main processing unit of the system. The PIC is powered by a 5V DC power supply. The MCLR pin of the PIC is connected to +5V via a 4k7Ω resistor. A 20MHz oscillator is used instead of a 4MHz oscillator since the RS232 communication speed is reasonably high. The oscillator is connected at the OSC1 and OSC2 pins of the PIC (Pin diagram of the PIC16F877A is given in the Appendix). To the microcontroller Reflective Infra-Red sensor is connected at the 1st pin of PORTD. The sensor is used to detect a package before it comes on to the weighing scale. Two pneumatic arms are connected at 3rd and 4th pins of PORTB through a 5V relay. A 5V relay is chosen instead of 12V or 24V because the same power supply that powers the microcontroller at can be used to power up the relay coil. Controller connected at the 4th pin controls the motion of the pneumatic arm 1 and the one connected at the 3rd pin controls the motion of the pneumatic arm 2. The system also consists of a weighing scale which has a built in RS232 weight transmitter. The weighing scale is powered by an AC power supply and the scale is connected to the PIC using HIN 232 CP IC. The way how the IC is connected is shown in the Figure 3 below and the HIN 232 CP IC’s pin diagram is given in the Appendix. The RS232 logic levels are in the form where -15V representing logic 1 and +15V representing logic 0. The logic levels in the microcontroller used are as +5V for logic 1 and 0V for logic 0 therefore to convert these logic levels of RS232 to TTL levels the HIN 232 CP IC is used. The HIN 232 CP IC is powered by +5V and capacitors are used for charge pumps and one capacitor is used for inverting the voltage level from +15V to -15V or vice versa. The pin connections are such that the ‘R1in’ pin of the HIN 232 CP is connected to the 2nd pin of the COMPIM port of the weighing scale and the ‘R1out’ pin is connected to the RC7/RX pin of the microcontroller.
Mentioned above is the hardware setup of the actual system which is to be developed but the prototype developed differs and the schematic of the prototype is given in the Appendix. So when the following considerations were made.