HackerBox 0118: More Human
by HackerBoxes in Circuits > Raspberry Pi
2437 Views, 4 Favorites, 0 Comments
HackerBox 0118: More Human

Welcome to HackerBox 0118. Experiment with the Raspberry Pi Pico 2 W featuring the RP2350 microcontroller combined with the Infineon CYW43439 wireless chip and an integrated niche antenna. Configure the Arduino IDE to target the Pico 2 W and explore example sketches for LED control, network scanning, and an embedded web server. Generate pulse-width modulated audio to drive headphones and a PAM8302A audio amplifier. Connect an INMP441 I2S MEMS microphone sensor to sample audio signals. Explore Edge AI technology, including TensorFlow Lite, Edge Impulse, LiteRT, and training models using synthetic data.
There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.
Supplies
This Instructable contains information for getting started with HackerBox 0118. The full box contents are listed on the product page for HackerBox 0118 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month, you can subscribe at HackerBoxes.com and join the party. Subscription members save at least $15 every month and automatically receive each new HackerBox shipped immediately off the production line.
A soldering iron, solder, and basic assembly tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for tools and supplies along with a wide array of introductory activities and experiments.
The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.
WEAR SAFETY GLASSES WHEN SOLDERING, WHEN TRIMMING WIRE LEADS, OR WHEN CUTTING, DRILLING, ETC.
Raspberry Pi Pico 2 W

Raspberry Pi has produced a progression of four different microcontroller products...
HackerBox 0082 featured the Raspberry Pi Pico based on the RP2040 microcontroller.
HackerBox 0087 featured the Raspberry Pi Pico W based on the Raspberry Pi RP2040 microcontroller and the Infineon CYW43439 2.4GHz wireless chip.
HackerBox 0110 included the Raspberry Pi Pico 2 based on the RP2350 microcontroller.
Now, HackerBox 00118 finds us working with the Raspberry Pi Pico 2 W based on the RP2350 microcontroller combined again with the Infineon CYW43439 wireless chip.
(BEFORE SOLDERING) Initial Tests with the Raspberry Pi Pico 2 W
Possibly in an attempt to keep all the Pico modules "compatible" with one another, the 2 W still has a microUSB connector, so HackerBox 0118 includes a Female USB-C to Male MicroUSB Adapter. To first connect to the Pico 2 W, use that adapter and a USB-C cable, or alternatively just use a MicroUSB cable.
Once the Pico 2 W is connected to your computer, there may not be any LEDs illuminated on the module, however your computer will have a new "drive" called RP2350.
From here, we suggest following this Random Nerd Tutorial to:
- Install the Arduino IDE
- Add the Earle F. Phillhower Board Manager URL
- Install the Earle F. Phillhower Board Manager
- Select Tools > Board > Raspberry Pi Pico/RP2040 > Raspberry Pi Pico 2W
- Loading the Blink Sketch
- Verifying operation of the Blink Sketch with the onboard LED (GP0)
Digital Airwaves

The Raspberry Pi Pico 2 W features an Infineon CYW43439 wireless chip coupled to an Abracon Niche Antenna built into the module PCB. These elements allow the Pico 2 W to support 2.4GHz Wi-Fi (802.11n) as well as Bluetooth 5.2 (BLE and Bluetooth Classic). Let's test out a couple wireless examples...
Network Scanner
Open Sketch: File > Examples > WiFi > ScanNetworks
Compile and Upload the Sketch
Open the Serial Monitor
LED Control via Web Server
Open Sketch: File > Examples > WebServer > HelloServer.ino
Set the SSID and Password for the desired 2.4GHz WLAN
Compile and Upload the Sketch
Check in the Serial Monitor to find the IP address assigned to the Pico 2 W
This video (around time offset 30:50) shows doing this with some similar code ported from ESP32.
Pulse-Width Modulated Audio

Finally - Solder Time!
Snap the white 40 pin male header into two sections with 20 pins each.
Insert the headers and hold the pins perpendicular to the module PCB.
Solder the header pins into place.
Verify that the MCU still boots and properly executes code when powered.
Connect Earbuds
Solder the four-pin header onto the 3.5mm TRRS (Tip, Ring, Ring, Sleeve) breakout module.
Use two female-to-female jumper wires to connect:
Plug earbuds into the TRRS module
Or Connect An Amplified Speaker
Solder the five-pin header onto the PAM8302A 2.5W Audio Amplifier Module.
Use female-to-female jumper wires to connect:
Solder the speaker wires to the output pads of the amplifier modules as shown.
Let There Be Code
Open Sketch: File > Examples > PWMAudio > PlayRaw.ino
Compile and upload to enjoy a brief pulse-width modulated musical sample.
Customize
To play a different sound, grab the wav.h file attached here to replace the wav.h file that comes with the PlayRaw.ino example sketch. HACK THE PLANET! To convert other WAV files into C headers, visit this page.
Downloads
Digital Audio Sampling

The I2S Microphone Sensor Module features the INMP441 (datasheet). The INMP441 is a high-performance, low power, digital-output, omnidirectional MEMS microphone with a bottom port. The complete INMP441 solution consists of a MEMS sensor, signal conditioning, an analog-to-digital converter, anti-aliasing filters, power management, and an industry-standard 24-bit I2S interface. The I2S interface allows the INMP441 to connect directly to digital processors, such as DSPs and microcontrollers, without the need for an audio codec in the system.
Solder the six header pins onto the microphone module. Note that the "sound input" into the microphone is the tiny hole through the PCB above the microphone icon, not the metal can on the reverse side. Accordingly, it is suggested to position the header pins to extend out from the same side of the module as the metal can and other components.
Use five female-to-female jumper wires to connect:
Note that the L/R pin of the microphone is not connected (NC)
Open Sketch: File > Examples > I2S > I2SInput.ino
Compile and Upload the Sketch
Open the Serial Plotter (not the Serial Monitor)
Whistling into the microphone should display a wave on the plotter.
Whistling at different pitches should change the frequency of the plotted waveform.
Is there an echo in here?
Reconnect one of the two optional audio out devices (headphones or amplified speaker) from the previous step.
HOWEVER, instead of connecting GP1 as the PWM audio signal, use GP8. (GP1 is already in use by the microphone.)
Grab the attached echo.ino sketch file.
Compile and Upload the Sketch
Audio recorded from the digital microphone will be echoed back to I/O pin GP8 as analog PWM audio.
Downloads
Training and Deploying Edge AI Models

Edge artificial intelligence refers to the deployment of AI algorithms and AI models directly on local edge devices such as sensors or Internet of Things (IoT) devices, which enables real-time data processing and analysis without constant reliance on cloud infrastructure. (IBM)
The video embedded above demonstrates the use of generative AI to create audio samples (synthetic data) for training an Edge Impulse model for keyword detection.
While the video demonstrates training a foreign language, the same project using English keywords is published here. The project includes deployment options for "Arduino Library" and for "Raspberry Pi Pico 2W" among many others. Its use requires a (free) account and is a little tricky, but if you want to play with Edge Impulse, here's your chance.
Also check out the Micro Speech example from the TensorFlow Lite Micro Library for Arduino
Additional Edge AI Resources...
Get Started With Machine Learning on Arduino
What is Edge Impulse and TinyML (video)
USB-C to 3.5mm TRRS Digital Audio Converter

This USB Type-C to 3.5mm Headphone Jack Adapter is a handy accessory to many modern mobile phones, tablets, and gaming devices which no longer include analog TRRS audio ports. The adapter allows use of wired headphones to listen to music and make phone calls. It also supports microphone input and remote control functionality.
The USB-C to 3.5mm audio adapter is equipped with a DAC chip. It features low power consumption and excellent stable decoding performance, supporting a maximum audio sampling rate of 16Bit/48kHz. The device is plug and play without the use of additional software drivers.
Generative Artificial Intelligence

You may wish to recap Steps 9 and 10 from the HackerBox 113 Guide covering perceptrons, backpropagation, attention weighting, and transformers.
Generative AI is a subfield of artificial intelligence that uses generative models to produce text, images, videos, or other forms of data. These models learn the underlying patterns and structures of their training data and use them to produce new data based on the input, which often comes in the form of natural language prompts. Generative AI tools have become more common since the AI boom made possible by improvements in transformer-based deep neural networks, particularly large language models (LLMs). Major tools include chatbots such as ChatGPT, Copilot, Gemini, Claude, Grok, and DeepSeek; text-to-image models such as Stable Diffusion, Midjourney, and DALL-E; and text-to-video models such as Veo and Sora. (Wikipedia)
Do Androids Dream of Electric Sheep?

White Zombie - More Human Than Human
We hope you are enjoying this month's HackerBox adventures into electronics, computer technology, and hacker culture. We aim to curate a challenging and rewarding experience of learning through experimentation and exploration. Thank you for joining us on this journey.
Reach out and share your success in the comments below. Email support@hackerboxes.com anytime with questions or whenever you need some help.
Hungry for more? Surf over to HackerBoxes.com and join us as a monthly HackerBox subscription member. You'll get a cool box of hackable gear delivered right to your mailbox every month and you'll enjoy a generous member discount.
Please consider sharing this free Instructable with others who may be interested in learning about these subjects. Word of mouth advertising is the greatest compliment that we can receive. We sincerely appreciate your support.