Assignment title: Information
Scenario
You have been contracted to develop a control system for a sorting system which will sort components passing a sensor on a conveyor belt. The system you develop will determine what type of object is passing a colour based sensing system controlled by a microcontroller and will sort the objects based on colour using solenoids controlled by a PLC.
The colour sensing system will use red and green LEDs to successively illuminate the component in question and measure the amount of light that is reflected. In order to achieve this you will experiment with two methods of reading the light level from the sensor.
A critical feature of the system is that it will not allow the receptacles in to which the components to be sorted to overflow. To this end the PLC controller for the system must maintain a count of how many components have been placed into each bin and stop the system when the specified threshold has been reached. You will also have the opportunity to examine the possibility of using a weight based system to ensure the bins do not overflow.
Project Objectives
1. To investigate the optimal means of interfacing the colour sensor to the microprocessor
2. To develop a microprocessor based system to classify objects by colours
3. Control a conveyor belt and a set of solenoids using a PLC to realise a sorting system
4. Implement a safety system to ensure the sorting system does not overflow
System Elements
Colour Sensing System The conveyor is fitted with a colour sensing system. The senThe conveyor is fitted with a colour sensing system. The sensor system comprises of 2 coloured LEDs which illuminate the object in turn. The amount of light reflected is detected by a light dependent resistor. A microcontroller program is to be designed and developed which will light the LEDs and read the signal produced by the LDR. The microcontroller will then process the values recorded and will set three outputs based on the colour of the object as described in table 1 below.
Colour output 1 output 2 output 3
Green on off off
Red off on off
White off off on
Conveyor Control System
The control system for the conveyor will be implemented by a PLC and will move the objects to the position of the colour sensor. The object will then pause for enough time for the colour to be read. The PLC will then read the output from the sensor system as described in table 1 above and will move the object to the appropriate location as indicated in figure 2 below before actuating the appropriate servo to move the object off the conveyor.
Additionally, the PLC program should incorporate a counting system to ensure that the sorting system does not overfill any of the hoppers. Once any one of the hoppers contains 5 components the system should stop and a warning light should be activated.
Deliverables
Colour Sensor Signal Conditioning (10%) You will provide a brief report of 1 – 2 pages (length for guidance only) documenting the best strategy for interfacing the colour sensor with the microprocessor. Your decision should be clearly justified and your report should draw on your experiences in the laboratory activities and any relevant references you wish to cite.
Submission by Monday 28th November 2016
. Colour Sensor Design Notes (10%)
You will carry out design work on the code and produce a set of design notes which may include:
• a flow chart of the operation of the program,
• a list of the I/O pin allocations
• A list of the subroutines you will use.
• Pseudocode outline for your program
Your notes may contain code extracts that may total no more than 20% of your final program. You may also include notes on any instructions or code constructs that you may wish to use. You will be given the opportunity to discuss your design notes with a member of academic staff during your usual class in week 19 (w/c 5th December 2016) . You will then be required to submit a hardcopy of your notes following the coding session in week 20 (w/c 12th December 2016).
Microcontroller Code (20%)
You will use your design notes to code the colour sensor program during the class in week 20. At the end of the session you will have the opportunity to demonstrate your code using the ECIO development boards. During the coding session you will work with your lab partner and will be provided with access to the documentation provided which will include as a minimum:
• The datasheet for the PIC18F2455
• The datasheet for the ECIO microprocessor boards
• Relevant documentation for MPLab, The XC8 C Compiler and the MPASM Assembler software. You may not collaborate or communicate with other groups and you may not bring any other material (including any electronic copies of code etc on memory sticks) into the session other than
the design notes which will be submitted at the end of the session. You will have 90 minutes to complete the coding. Submission of Code in lab class in week 20 accompanied by live demonstration.