Joey Klapkowski Work Log

  • Post author:
  • Post last modified:February 24, 2024
  • Reading time:19 mins read
  • Post category:Work Logs

9/22/2023

Recap

  • Went through documentation for the YOLO object detection algorithm
  • Installed YOLO on the raspberry pi
  • Received USB camera
  • Found this article by propelland on how to record using a USB camera on a raspberry pi

To do

  • Integrate USB camera using propelland article
  • Train YOLO on water bottles

9/29/2023

Recap

  • Attempted to use propelland article, but it was made for a video stream and not single captures as this project needs
  • Was able to capture images using a USB camera using OpenCV VideoCapture() method

To do

  • Continue work on training YOLO
  • Integrate detection software on USB images

10/07/2023

Recap

  • Trained YOLO model on medium Starbucks cups using Roboflow following this article
  • Uploaded trained model weights to the Pi
  • Troubleshooted YOLO install on the Pi. Had an error with keyboard shortcut APIs blocking YOLO import.
  • Got software for USB camera to work on my laptop and try to perform detection on images

To do

  • Move USB camera to Pi and confirm that detection software works on captured images
  • Continue troubleshooting YOLO and get detection software finished

10/22/2023

Recap

  • Got YOLO running on the Pi and working on uploaded images
  • Created software using Roboflow to analyze captures while the Pi took them with a USB camera
    • Very slow due to multiple file saves, may be able to optimize
Image
  • Moved USB camera software to Pi and was able to get it running with a presumably correct output

To do

  • Confirm that USB camera is configured properly for current code
  • Optimize Object Detection code
  • Test to confirm that defects do not get recognized by the camera

10/27/2023

Recap

  • Added support for the pi camera in the object detection
    • Much faster than USB camera analysis, but still somewhat behind camera feed
  • Printed new camera mount
  • Performed some testing with different lenses and positions for detection accuracy
    • Some issues with low contrast backgrounds, but for our purposes this should be fine as we want to have a controlled, calibrated environment for testing our objects

To do

  • Test defect detection and modify tolerances
  • Add I2C communication to the BREAD Loaf

11/05/2023

Recap

  • Tested dent detection using object detection software
    • Modified confidence tolerance within code to try to get deformations to be recognized
    • Too high tolerance for missing parts, could not recognize when a lid was missing
  • Retrained model with a more strict and consistent setup
    • Will hopefully be stricter when trying to recognize the cup as it has less information about it in different positions

To do

  • Test new model on dented cups
  • Add I2C communication to the BREAD Loaf

11/19/2023

Recap

  • Retested dent detection using object detection software
    • Trained in one position while rotating cup between pictures
    • Gave much tighter tolerance for cup recognition, missing lid or dents drop about 5% confidence consistently
  • Worked through corruption issues
    • Accidently cut power to the pi while writing to the hard drive
    • Corrupted config files and had to reinstall libcamera and rewrite some files
    • Caused Picamera to not be recognized
  • Finished support for USB camera by adding separate Color Detection file with modified image dimensions
  • Added support for using both USB camera and Picamera at the same time
    • Can be modified to use different types of analysis on each camera

To do

  • Work on I2C communication to the BREAD Loaf
  • Begin drafting final report

12/08/2023

Recap

  • Worked through issues with Roboflow
    • Limited to 1000 API calls per month
    • Due to being offline, updated all at once at the start of December and prevented usage of our weights
    • Retrained using same images and uploaded new model
  • Added I2C communication
    • Raspberry Pi sends what test is being run with a true or false to indicate a pass or fail
    • Arduino processes this signal to do various things

To do

  • Finish report
  • Plan for next semester

1/27/2024

New Project: BREAD DAQ

This semester I am starting work on a new project. I will be working towards making a DAQ device for the larger BREAD project. The goal is to have an Arduino read a sensor voltage and convert it to useful data. The Arduino will display this on an LCD screen as well as save this with time data to an SD card.

To properly read the voltage, the sensor’s output will need to be amplified to create a more readable voltage. This will be done using an op-amp and digital potentiometer to change the amount of amplification depending on the sensor the device is set to read from. Below is a sketch of what this may look like on the Arduino.

To do

  • Start programming the Arduino
    • Will focus on being able to read a voltage and then add the ability for it to convert that voltage to a usable data value. This conversion will be easily modifiable to allow for different sensors to be used
  • If parts come in, begin breadboarding circuit for controlling amplifier and reading in a sensor voltage

Concerns

  • Parts will not arrive, so breadboarding and planning the circuit may not be able to start
    • If this occurs, more coding work will be done, likely preparing the display on the LCD screen to display the reading from the sensor

2/3/24

Recap

  • Planned how our code should look; we want each type of sensor to have it’s own function to convert a voltage to data and format that data in a String. The function being used will be determined by a variable that can be set in the code. Eventually, we would like this to be changeable using push buttons.
  • Began writing some of this code
    • I focused on the code for reading a voltage from the Arduino and sending it to the proper function to handle it.
    • Brett soldered the LCD screen and wrote some test code to begin writing to it

To-do

  • Breadboard a test circuit once parts come in
  • Continue coding
    • Still need code for each sensor to convert the voltage to data

Concerns

  • Parts will still not come in. This may prevent us from having time to get an initial design for our PCB board before midsemester
  • Winter Carnival will be too busy to get a lot of work done. This is being planned around and should not affect the project overall

2/10/24

Device Operation Flow

The main flow of the device will be reading in a sensor voltage, amplifying it by some amount, and then reading that voltage and converting it to usable data that can be displayed on the LCD screen. The amplification level and conversion formulas will change with the device state to match the correct levels for the sensor being used. This state will be controlled either through a change in the code or by using buttons built into the slice.

Recap

  • Added some code for converting voltage read to usable data
  • Still waiting on parts

To-do

  • Breadboard a test circuit
  • Continue coding

Concerns

  • Parts will still not come in. This will certainly prevent us from having time to get a functional initial design for our PCB board before midsemester, however a theoretical design is in progress

2/17/24

Recap

  • Parts came in, so breadboarding was able to begin
    • Have LCD Screen able to display a voltage read by an Arduino
    • Have a noninverting op-amp amplifier setup using the digital potentiometer, need to find correct amplification amount

To-do

  • Test op-amp circuit
    • Found that amplification being done is not consistent over the voltage range that we need, may need to modify circuit or op-amp to prevent errors
    • Will look into adding ways to add bias voltage to get a cleaner input
  • Finish PCB board design and order
    • Some progress already made, but it cannot be completed until there is a working breadboard prototype

Concerns

  • The op-amp that we have is not accurate enough or the amplification method we are using is wrong
  • The sensor may have a lot of noise so a filter will be necessary

2/24/24

Recap

  • Tested op-amp circuit to find proper amplification
    • Having some error with low voltage inputs being amplified more than expected. When set up as a noninverting op-amp with 181 V/V amplification, were getting about 500 V/V amplification to a 10 mV input
    • Not sure how to fix this error, will be looking into different op-amp configurations and error correction methods over break
  • Decided that we will add a second sensor terminal and make each terminal capable of reading a resistance based sensor
    • Will use a voltage divider circuit by applying 5 V across the terminal that leads to the sensor and back to a built in resistor
    • Will have a physical switch between amplification and voltage division

To-do

  • Find ways to set up op-amp to get amplification required using a potentiometer
  • Finish PCB board design
  • Add code for reading from a photoresistor

Concerns

  • There is not a way to get the proper amplification we want with an op-amp circuit and we will need to switch to some other method of reading sensor voltage