Color Sensor Motor
I worked with a partner to program a smart motor that can indicate whether a color is closer to red or green using a color sensor and an ESP32. The code can be accessed here.
​
1. Data Input Mode: The color sensor must be trained to detect the color green- button D34 on the ESP32 must be continually pressed while showing the color sensor different shades of green. Likewise, button D35 must then be continually pressed while showing the color sensor different shades of red.
​
2. Playback Mode: After long pressing one of the buttons, the color sensor will automatically detect whether it's being shown green or red, and the motor will point in the direction of the respective color on the wheel.
​
The KNN (K nearest neighbor) learning algorithm was used to group the data points collected in data input mode, so the ESP32/color sensor could distinguish two separate classes of color in playback mode. Through this project, I learned about how KNN mathematically works to classify 1D and 2D datasets and learned the importance of K value selection.
​​
Haley and I both conceptually designed the project and figured out how to use the color sensor and KNN. She worked on the majority of the micropython code while I designed the semi-circle wheel in SolidWorks and printed it using a laser printer.
