Projects Banner

Prototype Zero

Now that I have some level of understanding of the individual components for the build, I wanted to put them together into a single board.

My idea was to continue with the breadboard as the intial prototype so that I can get some test code working to exercise each component simultaneously. This also enables me to refine my decision(s) on the final design requirements.

I basically just followed what I did on each component page and wired it like that. This was pretty easy and only took an hour or so. This strategy enabled me to test everything with the existing code in the powerzero/learning files.

I was pretty pumped that it was all working, but it was fragile and looked so janky.


I Wish I had Wire Strippers

As mentioned in Hello Sound, I had bought a soldering station. I also got a small box of solid core wires and some prototype boards. I chose the MakerSpot Raspberry Pi 3 Prototyping Board which are compact, and I like that the internals are wired similar to a breadboard — this aligned with my plan to translate what I had just built to the prototype.

Before I started, I spent some time thinking through placement of components and how I would run the wires, which resulted in me re-organizing some items and testing those updates on the breadboard.

What I didn't do though was to think through what other tools I might need, or to practice on anything smaller first. I found a pair of wire cutters in the garage which were a poor substitute for wire strippers (using my teeth kinda sucked) — and at one point I had to wait for next-day Amazon delivery of some solder wick and flux paste.

The first board took me most of a day with numerous learning experiences. The only one worth mentioning is test early, test often. I probably worked for about six hours before I plugged the board into the Pi the first time. By this point, I had put so much together I was unable to debug what I had done wrong and nothing worked.

The second board (image below) took less time, took less time, and by testing incrementally, I kept it working the entire way. I learned at least as much completing that board as I did on the first aborted effort. I was tempted to build another one, but I want to move along.

Breadboard of all components Front and back image of the same board photoshoped together.
I used tape to keep the speaker attached.

This table is presented in the context of the GPIO header. I found that the easiest way to think about it when planning for the prototype board.

Final Wiring Table
Component / Destination GPIO / Name (Left) Pin Pair GPIO / Name (Right) Component / Destination
Board Power 3.3V
1-2 5V
MAX98357A Vin
DS3231 SDA
SSD1306 SDA
GPIO 2 (SDA1) 3-4 5V
DS3231 SCL
SSD1306 SCL
GPIO 3 (SCL1) 5-6 GND
Button GPIO 4 7-8 GND Board Ground
... 9-10 ...
MAX98357A BLCK GPIO 18 11-12 GPIO 17
... 13-18 ...
MAX98357A LRC GPIO 19 19-20 GND
... 21-36 ...
LED (330Ω Resistor) GPIO 26 37-38 GND
MAX98357A DIN (White) GPIO 21 39-40 GND Board Ground

Bridges Table
Component Bridge Reason
MAX98357A GAIN ↔ Board Ground Set gain mode (fixed level)
MAX98357A SD_MODE (SU) ↔ 5V Keep amplifier always on

Code Sample

There is some sample code that just tests the components. When the program first executes it enables the LED white it converts some sound files and such. The display shows a simple counter. Pressing the button increases the counter, and holding the button resets the counter. There is some sound on button press.

To execute the sample code, there is more detail in Remote Coding, but in short:

  1. In one terminal window, ensure tools/sync.py -s initialize -c learn is running
  2. In another terminal window, SSH into the Pi
  3. On the Pi, cd to /projects/powerzero/learning/proto/ to see and execute the sample code files.
  4. Ensure you setup the virtual environment, and then you can execute the file main.py.
Ensure you execute bootstrap config (tools/bootstrap.py -s initialize -c learn) before you run sync if you haven't already done so.


Next Steps

I have a prototype board I can use without fear of wires just falling out. I was originally planning to start the application code, but I've decided to tinker more. First, I want to create a custom PCB to make this easier to reproduce (and I want to learn how to do it).

Next up: Prototype One.

Second, from playing with the UI in this initial prototype, I think a status LED might be a useful signal particlarly when the system is booting. I want to figure out a circuit such that the LED comes on automatically when the Pi gets power, and then somehow use the GPIO to control it once it's fully booted. Due to the turnaround time with the PCB process, I'm going to start this as well — and possibly move on to the project code before the PCB prototype board is finished. We'll see.

Next up as well: LED Part Deux.