This GitHub repository hosts the code for the Resistor Sorter project, developed as part of the Integration Workshops 1 subject. The system consists of a resistor sorting mechanism that allows users to insert indivual resistors into a small slit and select up to six resistance values to sort them into. It's implemented as a web application, with its frontend built using CSS, HTML, Javascript, and React framework. Both the server and subsequent backend processes are handled by a Raspberry Pi 3B running Flask in Python. The Pi photographs the resistors through a USB camera and extracts color and position data using Computer Vision (CV) to determine its resistance. To optimise the process of locating and classifying hue values under different lighting conditions, Machine Learning (ML) techniques were used.
- Matheus Passos - Frontend Development and Project Integration
- Jhony Minetto - Backend Development, Algorithm Design and ML Training
- Ricardo Marthus - Conception of 3D models and Image Labelling for the dataset
The frontend of the Resistor Wizard is composed of the web app user interface where resistance values can be selected and the hardware abd mechanical system controlled. The user interacts with the system primarily through this web interface.
The backend of the project runs on a Raspberry Pi 3B server and is implemented in Python using the Flask framework. It handles the following tasks:
- Determining Resistor's position and color bands location using ML (YOLOv8 network trained on PyTorch ML framework)
- Color recognition using OpenCV
- Communication with the frontend
The ML models are a crucial component of this project. They have been trained by our dedicated team to recognize resistors and resistor color bands accurately. The data used to train the models themselves is majoritarily self-provided (meaning we created and labelled the data ourselves). The complete datasets can be visited at resistor dataset and resistor color bands dataset.
To run this project locally or on your own Raspberry Pi server, follow these steps:
-
Clone this repository:
git clone https://github.com/yourusername/resistor-sorter.git
-
Set up the frontend environment and dependencies.
- Navigate to the
frontend
directory. - Install dependencies using npm or yarn:
npm install
oryarn install
. - Start the frontend application:
npm start
oryarn start
.
- Navigate to the
-
Set up the backend environment and dependencies on your Raspberry Pi.
- Navigate to the
backend
directory. - Install Python dependencies:
pip install -r requirements.txt
. - Start the Flask server:
python app.py
.
- Navigate to the
-
Ensure the necessary hardware components are connected and configured on your Raspberry Pi for resistor input.
-
Access the web application in your browser and start using the Resistor Sorter.
We welcome contributions and improvements from the community. If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request. Your contributions will be greatly appreciated.
Feel free to contact us if you have any questions or need assistance with the project.
Happy sorting!