The aim of this project is to create an easy-to-build and easy-to-use pick to light system that any manufacturer can utilise to improve their production process.
If a worker has to select between two parts. Let's call them part A and part B. They are laid out in two bins. As each assembly is made the worker chooses between part A or part B according to the assembly being made. Somehow he has to get this choice right to make the correct assembly. This means the worker may make a mistake and that can be costly in terms of rectification or worse still loss of goodwill if the customer receives the wrong thing.
Pick to light means a worker doesn't have to make a decision; instead he just follows the light picking parts as they are indicated.
The basic elements of this are:
Order of build- we have to know this in order to light the correct parts bin for next assembly.
A set of parts laid out in bins.
A light above each bin to be lit when that part is to be used.
A switch to be pressed by the worker to confirm pick is complete
A processor to control the lights and sensor.
As each assembly is completed a light located above each bin illuminates to tell the worker which part to use next. As he uses the part he presses a switch which tells the processor that he is ready for the next part.
A simple process should look something like this:
- From build order get next part to be used.
- Light bulb according to part required either bulb A or bulb B.
- Worker presses button to say part picked
- Select next part from build order.
Of course, this is too simple. We need to track problems and make sure that the build order doesn't get disrupted if the hardware fails or if the operator picks the wrong part. For now though my goal is to develop a simple pick to light which can be improved upon later.
So processor wise until my MKR1000 arrives I have an Arduino Uno. In order to get started doing something I'll make a start using the Uno even though that will limit what I can do.
Neither of these boards have WiFi as I do not have a WiFi shield so the only way that I know of that we can use to pass the build sequence to these from a laptop is via serial. In order to do that we will take the first line of a comma separated file containing the build order and pass it to the Uno from my laptop using a Python script. Then get the Uno to light one of two LEDs according to the info received. We then need to monitor the switch until the worker presses it then get the next part and start the sequence again.
So parts list so far:
- Uno/Nano
- 2 lights we'll substitute LED's for now
- 3 resistors 2 x 330ohm and 1 x 10Kohm
- Wire we'll use jumpers
- Laptop
- 1 switch
- 1 breadboard to make connecting easier
All the LED's cables and switches could be scaled up to meet an industrial application.
Step 1So to get started we need to have Python v 3.6 or greater on our laptop or PC. You can download that from here:
https://www.python.org/downloads/
Step 2Additionally we need pyserial and you can download that from here:
https://pypi.org/project/pyserial/
On the Adafruit website there is an excellent tutorial by Simon Monk outlining how to do both of these steps.
Step 3We also need the Arduino IDE either the PC version or the Web version. These can be downloaded here:
https://www.arduino.cc/en/Main/Software
or connected to here:
The instructions on the site are comprehensive so I won't duplicate them unnecessarily.
Step 4Launch the Python IDLE on your PC or Laptop and type import os press enter.
Then type os.getcwd() this should give you your current working directory (cwd).
In Notepad I created a comma separated value file and it quite simply contains a line number and a bin number separated by a comma. See Notepad screen shot below and also text file attached which you can download. I saved this as sequence.txt in the cwd that we gathered in step 4 (you can save the file with the extension of csv but it isn't necessary for the csv to work). Saving the file to the cwd simplifies things when we come to read in the file with the Python script as we won't have to specify a location where the file is stored because it will automatically look in the cwd.
When you connect to your UNO via your PC or laptop you are doing so via the serial connection. You can see this with the "Hello World" example below.
If you type this into the Arduino IDE and send it to your UNO and launch the serial monitor you will see, printed out, the Hello World.
Serial.begin(9600); establishes a serial link at baud rate 9600 bps.
Serial.println("Hello World"); sends the text Hello World across the established link.
If you are using the web editor as soon as you plug in your UNO the editor recognises what Port you are connected to. The IDE has a menu item where you specify which port it is connected on.
We need to note this board rate of 9600 and the port COM3 as the Python program that we write will use the same settings in order for them to communicate properly.
Step 7The Python script needs to read in the content of the csv file one line at a time and send the Bin number to be lit up across the serial interface and then wait until the Arduino returns the message to say that the part is picked. I have added comments to the script so you can understand what I have written.
Copy the script and then launch the IDLE and then do >File >New File and paste the script into the window. Then >File >Save As give it a name it doesn't matter what you call it as long as you know the name.
Note: any data you send to Arduino via serial has to be encoded to Unicode and what you get back has to be decoded.
Step 8The Arduino sketch needs to wait to receive data from the PC for the next pick. It then acts on what it receives by lighting the LED that matches the bin in the sequence. It then needs to monitor the button to see if it is pressed. Once the worker presses the button to say the part is picked the sketch turns out the LED and sends a message back to the PC or laptop to say the part was picked. It then then waits to receive the details for the next pick.
So copy from below the sketch then in the Arduino Web Editor select >sketchbook >NEW SKETCH
Next paste the script in the new sketch completely replacing everything that is in there. Download to the UNO.
Step 9Connect everything up as per the fritzing diagram. There is one for the UNO and one for the MKR1000.
Run the Python script using F5 and if all is well you should see the LED representing Bin1 light up. Press the button and the sequence should move on to the next Bin which is Bin 2 and the LED should light up an so on.
ConclusionIt works and it is simple which is what I set out for. However, the serial connection mean it is tethered to the pc by a cable and this is not really very good when it comes to a manufacturing environment. Also it is not making use of the WiFi capability of the MKR1000 so if time allows project 2 will address that.
Comments
Please log in or sign up to comment.