This folder contains all files of code needed to run the GUI and control all the components for the MSCS
- GUI code without implemented hardware functions. This code the same as MSCS_GUI_1.py but with the hardware functions commented out. This is used for only testing GUI related functions.
- Working GUI code with implemented hardware functions. This is used to run the automated cleaning cycle and also individually control the rest of components.
- Contains the functions for starting and stopping the dc motors/cleaning rollers.
- Functions are called to automatically in the cleaning cycle and manually in the Rollers page.
- Linear actuator location settings.
- Pololu Tic USB Stepper Controller settings file.
- Contains the functions used to control the movement and placements of the linear actuator.
- Functions are called to automatically in the cleaning cycle and manually in the Linear Actuator page.
- Controls the pump for the soap.
- Functions are called to automatically in the cleaning cycle and manually in the Pumps page.
- Controls the pump for the water.
- Functions are called to automatically in the cleaning cycle and manually in the Pumps page.
- Contains the functions for turning on and off relays 1 2 and 3 on automation hat. Controls the opening and closing of solenoid valves.
- Relay one is for opening and closing drying valve. Relays two and three are for the valves that open and close the gripper.
- Functions are called to automatically in the cleaning cycle and manually in the Solenoid Valves page.
- Variable assignments for Raspberry Pi pin numbers
- Contains the code that allows us to take pictures with the camera and save it as a file.
- Also can create a new directory for the storage of the pictures.
- Contains the functions used to take a picture during the cleaning process and the code to control it using the camera component page of the GUI.
Raspberry Pi OS Version:
- Go to (https://downloads.raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2021-03-25/) to get
2021-03-04-raspios-buster-armhf-full.zip
1a. Unzip this file and then install the OS on the Raspberry Pi SD card using something like the Raspberry Pi Imager (https://www.raspberrypi.com/software/)
(Steps 2-5) Standard updates:
2. sudo apt-get update
3. sudo apt-get upgrade
4. sudo apt-get install python3-pip
5. sudo pip3 install --upgrade setuptools
(Step 6) Update Linux Kernel to be Compatible with Camera:
6. sudo rpi-update b4145cfaa838049fcc1174d1311a98a854703c29
(Steps 7-9) For Camera Kernel (https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/how-to-install-kernel-driver-for-pivariety-camera/#21-the-first-way-build-from-the-kernel-source):
-
wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
-
chmod +x install_pivariety_pkgs.sh
-
./install_pivariety_pkgs.sh -p kernel_driver
9a. To check if the camera is detected, enter:
dmesg | grep arducam
9b. To check if the video nodes are normal, enter:ls /dev/video* -l
9c. To view the device node information: enter:v4l2-ctl --list-formats-ext
(Steps 10-14) For Camera Access and to Program (https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/how-to-access-and-program-the-pivariety-camera-using-command-line-python-opencv-and-gstreamer/):
wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
- Check if the camera is working properly by taking a picture:
libcamera-still -t 5000 -o test.jpg
14a. For Raspberry Pi 3 devices: Make sure that dtoverlay=vc4-fkms-v3d
is in the [all]
section of /boot/config.txt
14b. Also for Raspberry Pi 3 devices: Add cma=400M
to the end of /boot/cmdline.txt
(Steps 15-18) For installing board (https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi):
cd ~
sudo pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
sudo python3 raspi-blinka.py
18a. To check if blinka is installed, enter: ls /dev/i2c* /dev/spi*
You should see the response:
/dev/i2c-1 /dev/spidev0.0 /dev/spidev0.1
(Steps 19-22)For installing Linear Actuator:
-
python -m pip install PyYAML
-
Follow steps 1 through 4 on https://www.pololu.com/docs/0J71/3.2 and install for Rasbperry Pi.
-
Installing adafruit motor hat library:
sudo pip3 install adafruit-circuitpython-motorkit
-
Installing automation hat library:
curl https://get.pimoroni.com/automationhat | bash