• 1
    Setting Up the Pi

    I went to the Raspberry Pi Downloads page and downloaded the most recent version of Raspbian. I then extracted the file and put it into a convenient directory. You can't just copy/paste a .img file to an SD card, you have to "burn it" onto the card. You can download a burning utility like Etcher.io to easily transfer the OS image. After the .img file was on my SD card I inserted it into the Raspberry Pi and gave it power. After about 50 seconds I unplugged the cord and removed the SD card. Next I put the SD card back into my PC and went to the "boot" directory. I opened up Notepad and saved it as a blank file named "ssh" with NO extension. There was also a file I added called "wpa_supplicant.conf" and put this text into it:

    network={     ssid=<"SSID">     psk=<"PASSWD">
    }
    

    Then I saved and ejected the card and put it back into the Raspberry Pi 3. This should now allow for the usage of SSH and connecting to WiFi.

  • 2
    Wiring

    The wiring for this is pretty simple. I connected the Rx pin to the Tx1 of the Mega, and the Tx pin to the Rx1 pin of the Mega. 5v goes to 5v, and GND goes to GND. I also connected the Arduino Mega to the Raspberry Pi 3 via a small USB cable.

  • 3
    Programming

    There are two files, one for the Arduino Mega and one for the Raspberry Pi. The Arduino Mega first sends out a handshake request to the module and then waits for a response. Once the response has been given the Mega starts polling the device to see if any cards have been scanned. If so, the ID of the card is read. In order to send concise information to the Pi, I used a pseudo-checksum algorithm to combine the five bytes into one number. The first four bytes get added together once, and the last byte gets added twice. There is also an array that contains the numbers of each card. When a card is scanned its checksum gets compared to the ones in the array and then matched. Lastly that data gets sent over serial to the Raspberry Pi for further processing.

    The Raspberry Pi waits for new serial information and then prints it. A dictionary is created at the beginning of the code that defines how each clothing item corresponds to each card. Each has a name, the card number, the color, and the status (clean or dirty). There is an option to change the status once the clothing item is scanned.