The electrical system consists of several parts, each essential to the main functionality of the project.
From the beginning of this project, we wanted to play sound through the Pi's 3.5mm port.
We used a 3.5mm to block terminal adapter to route the audio signal through an amplifier board into two 3-watt speakers.
The speakers were chosen primarily because they fit in the already-decided form factor of the box, and because they provided a reasonable sound for a low price.
The amplifier circuit was chosen specifically to drive two 3-watt speakers at a low price.
The Raspberry Pi is the brains to our project! We chose to use it as such because of its relatively-easy-to-use Raspbian environment, so we could focus on getting our software environment as functional as it could be.
We initially used a Raspberry Pi 2B V1.1 (seven years old!), chosen because we had a spare laying around, until we ran into performance issues due to its low processing speed, around 900 megahertz.
To help bridge that gap, we borrowed a friend's Raspberry Pi 3B+, which has a 30% faster clock cycle and 3 more cores.
We chose a cheap line laser diode because we did not want to worry about making custom optics to turn a laser-dot into a laser-line.
We connected the laser directly into the power supply, as connecting it to one of the Pi's GPIO ports would draw more current than is safe for the Pi.
We initially experimented with using a Raspberry Pi ribbon camera, as those are built for our specific use case, but this did not work out for reasons discussed in the Firmware section.
We eventually landed on a Logitech 1080p webcam that Aydin lent the project, which is plugged via USB directly into the Pi. This worked out of the box.
We chose a stepper motor and Raspberry Pi Adafruit Motor Hat for ease of use and a possible expansion into different rotation patterns that we could not accomplish with a simple DC motor.
The motor hat is powered directly from the Meanwell power supply, as the Pi cannot safely source enough current to power the motor.
To implement the LEDs, we used a FadeCandy NeoPixel LED driver and a Raspberry Pi.
We chose to use a FadeCandy for this project because it provides a more straightforward and comprehensive way to interface with the NeoPixel strips. The Raspberry Pi runs a Python script which utilizes the FadeCandy server and its corresponding Open Pixel Control library.
Both the LEDs and the FadeCandy board we used were already owned by a member of the team.
Of course, all these components have to be powered somehow. We determined each component's maximum current draw, then chose a Meanwell power supply that could supply enough current for everything at 5 volts.
➢ The motor hat and motor together draw about 1.5A at maximum.
➢ The laser draws about 50mA at maximum.
➢ The speaker amplifier draws about 50mA at maximum.
➢ If we set all 32 LEDs to full brightness, they would draw about 2A.
➢ If we were to power the Raspberry Pi from the power supply, it would draw about 3A
For a hypothetical total of about 6.6A.
For an abundant safety factor, we decided on a Meanwell single-output power supply that could supply 10A at 5V and powered the FadeCandy board, motor hat, laser, and speaker amplifier directly from that output in parallel.
Due to us not wanting to accidentally power-cycle the Pi without shutting it down properly first, we chose to use a separate wall plug to power the Pi in this prototype.