Turn as many lights off in one minute as you can.
Use a robotic arm to manipulate light switches. A raspberry single board computer randomly turns on the lights.
Students were introduced into recognizing button presses, turning on/off equipment, computer vision, motors and laser cutting parts during the semester. Parts seen below are a part of a kit sent home. The course finishes with a competition of students willing to participate.
42 Students are enrolled in the class.
1 Brendan, 57, Video
2 Nathan, 34, Video
3 Jerry, 33, Video
4 Vanessa, 27, Video
NA Instructor, 20, Intro Video
5 Reganne, 18, Video
6 Clara, 15, Video
7 Ethan, 14, Video
8 Julia, 7, Video
9 Jacob, 3, Video (U of A restricted)
Good bye (U of A restricted)
Congratulations!
You will need to build the game pieces, consisting of the lights (3 LEDs) and 3 Push Buttons. The LEDs will be powered through the Raspberry Pi and the Push Buttons will be read by the Raspberry Pi. Ideally you connect them on the solder-less breadboard and use the correct pullup and current limiting resistors.
Your design components will likely consist of
You will need to use the MeArm as your Button Manipulator. Your gripper can hold a Button Pusher.
You will need to use your camera as Light Detector.
The further apart your buttons are the more likely you can turn them off consistently, however it will also take longer to move the arm to a different button.
The scoring and light activation software will be provided. There will be a section where you can assign the lights and buttons to pins of your raspberry pi and where you can indicate whether on or pushed corresponds to high or low.
Your program will consist of a light detector and a arm activator. Both program section will need to be optimized to identify which light is on and to move the arm in a manner that will push the button in a most consistent way.
Camera software for the CSI and USB camera will be provided.
I recommend third party software to analyze your images off line. For example you likely will need to identifying the location of your LED in the image: https://imagej.net/Raspberry_Pi
A new randomly selected light will light up as soon as you turned off the current light.
Turning off the light is accomplished with mechanically pushing the button corresponding to the light.
Software to select and turn on the light will be provided and with exception of the pin assignments can not be modified. The next light to be turn on will differ from the currently lit one. The provided software will count the cycles of successfully turning off the lights.
The timing will start once the first button is pressed. The game will last 1 minute.
Your score is the number of completed cycles.
The grade does not depend on your game score. Participation in the competition will be graded using the following submissions:
Competition.py This code will need to be run in the shell with python3 Competition.py
CameraTest.py This code reads pictures of your camera and attempts to compute the average intensity in a region of interest.
LEDtestCamera.py Manipulate LEDs manually to turn them on/off. This is helpful to test the camera code. Develop your program in Thonny or VS Code and run this one in a shell with python3 LEDtestCamera.py
LEDtestArm.py Run this code to see whether LED was pushed by the arm or not.
ActivateButtonWArm.py An attempt to push a button