HackerBox 0121: MCU Lab 2025

by HackerBoxes in Circuits > Microcontrollers

190 Views, 0 Favorites, 0 Comments

HackerBox 0121: MCU Lab 2025

HB0121 Whole Box.png

Welcome to HackerBox 0121. Explore embedded electronics and programming with the HackerBoxes MCU Lab 2025 Edition. This development platform is useful to test, program, and prototype a variety of microcontroller modules. Four different MCU development boards are included, based on the ESP32, RP2040, STM32, and nRF52840. These MCU modules can be conveniently interfaced with the quick-connect feature blocks of the MCU Lab platform such as a 4x4 keypad, full-color LCD display, microSD card slot, LED bar, I2S digital audio module, slide potentiometer, and a solderless prototyping area.

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 0121. The full box contents are listed on the product page for HackerBox 0121 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.

Microcontrollers

ESP32 vs STM32 vs NRF52 vs RP2040 - Which is Best for Your Product?

A microcontroller unit (Wikipedia), often abbreviated as MCU, uC, or μC, is a small computer on a single integrated circuit. A microcontroller contains one or more processor cores along with memory and programmable input/output peripherals. Program memory in the form of NOR flash, OTP ROM, or ferroelectric RAM is also often included on the chip, as well as a small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general-purpose applications consisting of various discrete chips. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys, and other embedded systems. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make digital control of more devices and processes practical. In the context of the Internet of Things, microcontrollers are an economical and popular means of data collection, sensing and actuating the physical world as edge devices

An embedded system (Wikipedia) is a specialized computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is embedded as part of a complete device often including electrical or electronic hardware and mechanical parts. Because an embedded system typically controls physical operations of the machine that it is embedded within, it often has real-time computing constraints. Embedded systems control many devices in common use. In 2009, it was estimated that ninety-eight percent of all microprocessors manufactured were used in embedded systems. Modern embedded systems are often based on microcontrollers.

MCU features and functions have evolved over the years. Four of today's most popular microcontroller families are presented in the video above:

ESP32, RP2040, STM32, and nRF52

We'll be working with an example development board from each of these families. In the next four Steps, we will power up each example and run a quick example program or two on each one before we get into soldering anything.

After introducing the four microcontroller development boards, we will assemble the exclusive HackerBox MCU Lab 2025 Platform for developing and testing out a variety of microcontroller projects.

History of the HackerBoxes MCU Lab

The MCU Lab 2025 is a remix/evolution from one of the more popular past monthly HackerBoxes, which was HackerBox 0051 - The MCU Lab. The new MCU Lab 2025 and the original MCU Lab (from about six years earlier) feature diverse enough features that it will be quite useful to have both of them at our disposal.

ESP-WROOM-32 Development Board

ESP32.png

The ESP32 is a dual core 32-bit System-On-Chip. It has Wi-Fi, Bluetooth, and 512KB of RAM built-in. The clock can be supplied at frequencies up to 240MHz. The ESP32 incorporates a wide variety of peripherals including: capacitive touch, ADCs, DACs, UART, SPI, and I2C.

Configuring the ESP-WROOM-32 for use with the Arduino IDE

  1. Attach the ESP32 Dev Board to a computer using a USB-C cable
  2. A solid red light will illuminate - nothing else
  3. Install the Arduino IDE (if you don't already have it)
  4. In the IDE, use the Boards Manager to search for ESP32 (by Espressif Systems)
  5. Select that board package and hit install
  6. From the top menu, select Tools > Board > esp32 > ESP32 Dev Module
  7. Select Tools > Port (COM port that appears when the ESP32 is connected and turned on)
  8. Open the sketch File > Examples > Basics > Blink
  9. Add the line #define LED_BUILTIN 2 at the top of the sketch
  10. Compile an upload the sketch to the Dev Board

If everything is in order, the sketch will cause the blue LED that is connected to I/O pin 2 to begin blinking.

Scan for Wireless Networks

  1. Open the sketch: File > Examples > WiFi > WiFiScan
  2. Compile an upload the sketch to the Dev Board
  3. Open Tools > Serial Monitor

Sniffing Wireless Packets

  1. Video: Sniffing WiFi with ESP32 into Wireshark

Ultimate Pico RP2040

RP2040.png

The RP2040 is a 32-bit dual-core ARM Cortex-M0+ microcontroller designed by Raspberry Pi. It was originally released as the basis of the Raspberry Pi Pico development board. An impressively powerful and versatile chip, it has since been incorporated into a wide variety of other hardware platforms including the Ultimate Pico RP2040 development board.

Prior to Soldering pins to the Ultimate Pico RP2040

Connect it to a computer using a USB-C cable

The LED will not illuminate, but the computer will have a new "drive" called RPI-SP2

When the drive does not appear, unplug the dev board and plug it back in while holding the bootsel button

Configuring the RP2040 for use with CircuitPython

Head over here and download the UF2 file for the latest stable release

Copy the UF2 file to the RPI-SP2 drive

The drive will disconnect and reconnect as CIRCUITPY

Also, the LED will blink (very slowly)

Configuring the RP2040 for use with the Arduino IDE

Follow this Random Nerd Tutorial to:

  1. Install the Arduino IDE
  2. Add the Earle F. Phillhower Board Manager URL
  3. Install the Earle F. Phillhower Board Manager
  4. Select Tools > Board > Raspberry Pi Pico/RP2040 > Raspberry Pi Pico
  5. Load the Sketch File > Examples > 1. Basic > Blink
  6. Verify operation of the Blink Sketch with the onboard LED (GP0)

STM32F401 Microcontroller Board

STM32F401.png

STM32F401CCU6

ARM 32-bit Cortex-M4 CPU with floating point unit, Adaptive real-time accelerator (ART Accelerator) allowing 0-wait state execution from Flash memory, frequency up to 84 MHz, memory protection unit, 105 DMIPS, and DSP instructions

Memory

  1. 256 Kbytes of Flash memory
  2. 64 Kbytes of SRAM
  3. SPI Flash (Optional)

Clock and Power Supply

  1. 3.3V-5V power input, 3.3V LDO maximum output current 100mA
  2. USB-C interface power with backflow protection diode
  3. 25MHz 9PF high speed crystal oscillator
  4. 32.768K 6PF low speed crystal oscillator

Interface and Key

  1. USART x 3, I2C x 3, SPI x 4
  2. 40 Pin 2.54mm pitch header pin interface
  3. 4 Pin 2.54mm pitch SW debug interface
  4. USB-C interface

Prior to Soldering pins to the STM32F401

Connect it to a computer using a USB-C cable

The red power LED will illuminate and the blue LED will blink on and off

Configure the Arduino IDE

This repository adds support for STM32 MCUs in Arduino IDE

Configure for use with Micro Python

Follow the STM32F401 information on this tutorial.

NRF52840 SuperMini

SuperMini nRF.png

The nRF52840 MCU (Specs and Documentation from Nordic Semiconductor) features an ARM Cortex-M4F CPU clocked at 64MHz and offers 1MB of flash memory and 256KB of RAM. It supports multiple wireless protocols, including Bluetooth 5, Thread, Zigbee, ANT, and 2.4GHz. The MCU peripherals include ADC, PWM, SPI, I2C, UART, USB, GPIO, etc. The nRF52840 also supports a variety of security functions, such as AES encryption, SHA-256 hashing and True Random Number Generator (TRNG).

The SuperMini NRF52840 development board is based on the Arduino Pro Micro layout and supports charging and discharging of a 3.7V lithium battery connected at the B+ and B- terminals. The charging rate is 100mA.

Initial Power Up (prior to soldering the pins)

When first plugging in the SuperMini nRF52840, the red LED will glow solid and the blue LED will blink. A USB storage device named NICENANO will appear on the attached computer.

Exploring nRF Sniffer

To install the nRF Sniffer firmware onto the SuperMini nRF52840:

  1. Download this UF2 file
  2. Drop the file onto the "NICENANO" storage volume

After re-flashing itself, the SuperMini nRF52840 will have its red LED off and again the blue LED blinking.

To setup the software on the PC side, Adafruit has a tutorial covering all of the necessary elements...

Begin HERE and follow the instructions to install python3, pyserial, Wireshark, and the nRF Sniffer plugin.

CircuitPython Configuration

Any NRF52840 compatible UF2 file can be dragged onto the NICENANO volume to update the firmware. For example, you can install CircuitPython.

To return the SuperMini NRF52840 to bootloder mode, simply short the RST and GND pins together twice within half a second, connect to a computer via USB, and once again use the storage device named NICENANO to drop in a UF2 file of your choice.

The HackerBox MCU Lab 2025 Platform

Assemble MCU Lab.png

The MCU Lab is a compact development platform for prototyping and testing various microcontroller based designs. Six rows of 24 pin female headers comprise an MCU landing zone supporting the insertion of any DIP (dual inline package) format microcontroller development board having a width between 0.6 and 1.0 inches.

The male header pins adjacent to the MCU landing zone as well as those associated with the "feature blocks" of the MCU Lab can be readily interconnected using female-to-female Dupont jumper wires.

START ASSEMBLY WITH THIS IMPORTANT FIRST STEP

Configure the PCM5102A (specifications and datasheet from Texas Instruments) Digital Audio Module using the four jumpers on the back side of the module. The jumpers must be set using four blobs of solder as shown in the yellow box in the image above. Jumper #3 is set HIGH (solder blob between 3 and H). Jumpers 1, 2, and 4 are set LOW (solder blob between the respective number and L).

MCU Landing Zone

Insert two 1x12 pin female headers into each of the six inner most rows as shown in the green box in the image above. The two headers in each row should fit quite snuggly against each other. The two outer rows should be populated with 24 pins cut from one of the blue male headers.

4x4 Matrix Switch Keypad

Installing the 8 header pins at the bottom of the matrix such that the plastic insulator is not positioned between the module and the PCB allows the keypad to lie flat against the PCB providing a solid feel while operating the keypad.

Color TFT LCD Display

The 1.54 Inch 240x240 pixel display is based on the ST7789V driver chip. It is suggested to install the header pins such that the plastic insulator is not positioned between the module and the PCB allowing the display to have a flat and flush appearance.

Micro SD Card Slot Module

While the module can be installed in either direction, an advantage to installing the module with the meal slot facing down is that the silkscreen labels for header pins will be visible to assist when connecting jumper wires.

Three Bus Strips

Install three sets of five pins as shown in the aqua box in the image above. The five pins of each strip are connected together (by PCB traces) but the three strips are not connected to one another. Each connected strip of five pins can serve to split signals. For example, it can be quite useful to jumper each of GND and VCC from the MCU to separate bus strips allowing multiple connections from the strips to connect GND and VCC on to multiple other modules. The central position of the bus strips may also be useful to extend connections when jumping far across the board.

Additional Feature Blocks

The remaining elements of the MCU lab platform are installed as shown in the image.

4x4 Keypad Input

Keypad Demo.png

This simple example uses pin numbers associated with the ESP32, but it can be targeted to a different MCU by changing the pin numbers.

Wire up the Rn and Cn pins as shown in the code below.

From the IDE's Library Manager, search for and install the library Keypad (from Stanley and Brevig)

Open the example sketch HelloKeypad.ino that comes with the library.

Change the following lines:

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {19, 21, 22, 23}; //connect to R1 R2 R3 R4
byte colPins[COLS] = {26, 25, 33, 32}; //connect to C1 C2 C3 C4

Compile and upload the sketch to the target MCU.

Open the serial monitor to display the keypad output.

Color TFT LCD Display Output

TFT Demo.png

The 1.54 Inch 240x240 pixel display is based on the ST7789V driver chip.

Wire up the eight pins as shown in the code below, or select the desired pins and modify the code accordingly.

Both the BL and VCC pins of the display should be connected to 3V3 pin of the MCU. This is the perfect time to leverage one of the three bus header strips as a splitter.

From the IDE's Library Manager, search for and install the library Adafruit ST7735 and ST7789 (along with all of its dependancies)

Open the Example Sketch:

File > Examples > Adafruit ST7735 and ST7789 Library > graphicstest_st7789.ino

Replace the definitions near the top of the file with the following lines:

#define TFT_CS 5
#define TFT_RST 22
#define TFT_DC 21
#define TFT_SDA 23 // MOSI
#define TFT_SCL 18 // Clock
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_SDA, TFT_SCL, TFT_RST);

Compile and upload the sketch to the target MCU.

The display will appear upside down.

To remedy that, add the following line immediately after the call to tft.init in setup().

tft.setRotation(2);

PCM5102A I2S Audio Examples

ESP32 Audio.png

PCM5102A I2S Digital Audio (from Internet):

  1. Install Arduino Library ESP32-audioI2S
  2. Grab the TestESP32i2s.ino sketch attached here
  3. Set the SSID and Password Strings in the sketch to your network
  4. Set Tools > Partition Scheme > Huge APP
  5. Compile the sketch and upload to the ESP32 target
  6. Plug headphones or amplified speakers into the PCM5102A

PCM5102A I2S Digital Audio (from MicroSD Card):

  1. Place an MP3 file on a Micro SD card (card must be formatted as FAT32)
  2. Use the same TestESP32i2s.ino sketch as above
  3. Comment out the line starting: audio.connecttohost
  4. Uncomment the line: audio.connecttoFS(SD, "song.mp3");
  5. Change song.mp3 to the name of your mp3 file
  6. Compile the sketch and upload to the ESP32 target

Stream Bluetooth Audio to the ESP32 Acting as an Audio Sink

  1. Install Arduino Library ESP32-A2DP
  2. Open File > Examples > ESP32-A2DP > bt_music_receiver_arduino_i2s_3.ino
  3. Change three variables for pin numbering (I2S_SCK, I2S_WS, I2S_SDOUT) to match your wiring
  4. Connect audio source (e.g. mobile device) to "speaker" named MyMusic

Downloads

Cyberpunk Lit

Speculative Reader Ep. 70: Rudy Rucker's 'Ware Tetralogy': Software, Wetware, Freeware, and Realware

The Ware Tetralogy is a series of four science fiction novels by polymath Rudy Rucker - an author, mathematician, computer scientist, and philosopher. The four works include:

  1. Software (1982)
  2. Wetware (1988)
  3. Freeware (1997)
  4. Realware (2000)

The first two books both received the Philip K. Dick Award for best novel.

The central technological speculation of the series are the "boppers", a kind of robot with artificial intelligence developed through natural selection rather than through design. Crediting mathematician Kurt Gödel with the germ of the idea, Software declares: "We cannot build an intelligent robot.... But we can cause one to evolve." By creating self-replicating robots whose programming is randomly altered periodically (and who can exchange programming information with each other in a form of sexual reproduction), and then forcing these robots to pass "fitness tests" in order to survive, Rucker suggests, true artificial intelligence that equals or surpasses the human brain could be developed. (Rucker discusses this same idea in his nonfiction work Infinity and the Mind.)

Rucker also uses the series to discuss his philosophical ideas, beliefs that he has described elsewhere as mysticism. "A person is just hardware plus software plus existence," the character Cobb Anderson declares in Software. Later, in Wetware, Anderson observes: "The bottom line is that we're all information processors."

Careers in Embedded Systems

So You Want to Be an EMBEDDED SYSTEMS ENGINEER | Inside Embedded Systems [Ep. 5]

A great option for those of us who really love making embedded microcontroller gizmos... They're everywhere!

Hackers Movie Stickers

Sass Stickers - All Three.png

With HackerBox 0119, 0120 and finally 0121, we've completed distribution of all eight very cool Hackers Movie Stickers from The Talking Sasquatch. As presented at the start of the series in HackerBox 0119, The Talking Sasquatch designed these stickers to share at DEF CON 33. He was also kind enough to share the artwork with us! They come with perfect timing given that September 2025 was the actual 30 Year Anniversary of the Hackers Movie. Since then... WTF Happened?

Hack the Planet

outro.png

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.