HackerBox Core Workshop
by HackerBoxes in Circuits > Microcontrollers
5577 Views, 18 Favorites, 0 Comments
HackerBox Core Workshop
The HackerBox Core Workshop is designed to provide a foundation for engaging in advanced electronics projects such as the monthly HackerBox subscription boxes. The workshop features hands-on experiments with four different microcontroller platforms: the RP2040, ESP32, ATmega328P, and nRF52. These platforms were selected to leverage a range of development tools and various programming languages. Furthermore, a broad selection of input/output components are provided for exploring various interfaces and applications of the microcontroller platforms.
Explore Python, C/C++, and Embedded Assembly coding. Scan wireless networks and experiment with packet sniffing tools for both Bluetooth and Wi-Fi. Stream digital audio to and from a variety of endpoints. Prototype an Arduino on breadboard platform from a bare microcontroller chip. Explore Radio-Frequency Identification (RFID) and Near Field Communication (NFC) Technologies. Experiment with various application areas including graphic displays, wireless communications, human-machine interface, media streaming, security, and machine intelligence. Expand your electronics toolset with supplies and components selected to support a variety of future hardware projects.
HackerBoxes is the monthly subscription box for enthusiasts of electronics and computer technology - Hardware Hackers - The Dreamers of Dreams.
Supplies
This Instructable contains information for working with the HackerBox Core Workshop. Full workshop contents are listed on the product page where the Core Workshop is also available for purchase.
A soldering iron, solder, and basic soldering tools are generally needed to work on HackerBoxers. A computer for running software tools is also required. Have a look at the HackerBox Basics Workshop and the HackerBox Soldering Workshop for tools and a wide array of introductory activities that may be considered helpful prerequisites to the Core Workshop.
You will definitely also need 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.
Core Workshop Version
HackerBox Core Workshops purchased prior to August 2025 were version 1 and follow the legacy guide in the PDF file attached below. Version 2 Core Workshops sold after August 2025 are marked "v2" on the box label and follow the present Instructable as their guide.
Downloads
Ultimate Pico RP2040
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:
- 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
- Load the Sketch File > Examples > 1. Basic > Blink
- Verify operation of the Blink Sketch with the onboard LED (GP0)
128x128 OLED Display Module
As presented in a very helpful tutorial, this 1.5 inch 128×128 pixel OLED display module uses the SH1107 driver chip. The display module features an I2C communication interface for ease of use with ESP32, RP2040, nRF52m, or AVR Arduino microcontrollers.
ESP-WROOM-32 Development Board
The ESP32 is a dual core 32-bit System-On-Chip. It has Wi-Fi, Bluetooth, and 512KB of RAM built-in. The clock frequency can go 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
- Attach the ESP32 Dev Board to a computer using a USB-C cable
- A solid red light will illuminate - nothing else
- Install the Arduino IDE (if you don't already have it)
- In the IDE, use the Boards Manager to search for ESP32 (by Espressif Systems)
- Select that board package and hit install
- From the top menu, select Tools > Board > esp32 > ESP32 Dev Module
- Select Tools > Port (COM port that appears when the ESP32 is connected and turned on)
- Open the sketch File > Examples > Basics > Blink
- Add the line #define LED_BUILTIN 2 at the top of the sketch
- 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
- Open the sketch: File > Examples > WiFi > WiFiScan
- Compile an upload the sketch to the Dev Board
- Open Tools > Serial Monitor
Sniffing Wireless Packets
PCM5102A I2S Audio Module
The PCM5102A (specifications and datasheet from Texas Instruments) Digital Audio Module is configured to receive Inter-Integrated Circuit Sound (I2S) data streams from an ESP32 or other micrcontroller.
Prior to Wiring in the PCM5102A Module
The four jumpers on the back side of the PCM5102A module must be set using four blobs of solder as shown here. 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).
PCM5102A Module Microcontroller Integrations
- ESP32 - see Audio Examples below
- RP2040 - see the Raspberry Pi Synthy Kit in Step 3 Here
ESP32 I2S Audio Examples
PCM5102A I2S Digital Audio (from Internet):
- Install Arduino Library ESP32-audioI2S
- Grab the TestESP32i2s.ino sketch attached here
- Set the SSID and Password Strings in the sketch to your network
- Set Tools > Partition Scheme > Huge APP
- Compile the sketch and upload to the ESP32 target
- Plug headphones or amplified speakers into the PCM5102A
PCM5102A I2S Digital Audio (from MicroSD Card):
- Place an MP3 file on a Micro SD card (card must be formatted as FAT32)
- Use the same TestESP32i2s.ino sketch as above
- Comment out the line starting: audio.connecttohost
- Uncomment the line: audio.connecttoFS(SD, "song.mp3");
- Change song.mp3 to the name of your mp3 file
- Compile the sketch and upload to the ESP32 target
Stream Bluetooth Audio to the ESP32 Acting as an Audio Sink
- Install Arduino Library ESP32-A2DP
- Open File > Examples > ESP32-A2DP > bt_music_receiver_arduino_i2s_3.ino
- Change three variables for pin numbering (I2S_SCK, I2S_WS, I2S_SDOUT) to match your wiring
- Connect audio source (e.g. mobile device) to "speaker" named MyMusic
Downloads
ATmega328P
The ATmega328P (manufacturer specs and datasheets) is extremely well know for being the widely-used MCU at the heart of the Arduino UNO and the Arduino Nano.
It is a high-performance Microchip picoPower 8-bit AVR RISC-based microcontroller. It combines 32 KB ISP Flash memory with read-while-write capabilities, 1024B EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented Two-Wire serial interface, SPI serial port, a 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts.
Once configured as a Arduino, the I/O pins can be referenced within your Arduino sketches by the pin identifiers in the dotted-line boxes of the image above. Pinout graphic from Maker Portal.
DIY Arduino on a Breadboard
Insert the MCU onto a solderless breadboard taking note of the semi-circular "pin 1" indicator at one end of the IC. The hole numbers on the breadboard do not mater and can be ignored. What maters are the relative connections to the pins of the MCU as well as the two ground and two 5V power rails.
The other components are the 16MHz crystal along with its two 22pF ceramic capacitors. These three components are not polarized and can be inserted into the breadboard in either orientation. The crystal, and its capacitors, are connected to the XTAL1 and XTAL2 pins of the MCU.
The 10K resistor (stripes: brown, black, orange) connected between pin 1 (RESET) of the MCU and 5V can also be inserted in either direction. This PULL-UP resistors keeps the MCU out of its reset state. Since the RESET pin is active low, the MCU goes into reset when the pin is grounded. Pulling the pin to high (5V) makes sure the MCU is not ever in its reset state and instead is always running.
The black and red wires going to the MCU (two of each) are power and ground to supply the MCU with 5V. Note two important things about the power rails: They are not yet powered in this configuration (nothing to attached to them to supply power). And also the two grounds are connected together and the two 5V rails are connected together. Make sure you make these connections.
Burn the Arduino Bootloader Using USBasp
Starting code execution on a computing machine is often referred to as "booting" the computer. In this context, "boot" is short for "bootstrap" or "bootstrap loader" and derives from the phrase "to pull oneself up by one's bootstraps".
Referring specifically to an Arduino (as well as many embedded MCU or microprocessor systems), the bootloader is a chunk of code that is stored in a specific memory space on the Arduino board. The bootloader runs first when the system starts up and can usually do at least two things. First, it can start execution of a program previously burned into another area of the machine's memory. Second, it can receive a new program image (usually over USB/serial port from a PC) and them store that program into the machine's memory for running (usually now and in the future).
Prior to burning a bootloader into an MCU, it is usually good for nothing and doesn't even know how to listen to its serial port for a new program. So let's make sure we put an Arduino bootloader onto our ATmega328P chip which sort of turns it from "just a chip" into an Arduino.
Wire up the USBasp
The USBasp is an in-circuit serial programming adapter that support installing bootloaders and firmware on common AVR microcontrollers, such as those used in Arduino-compatible boards. Note that the USBasp comes with a grey ribbon cable and a ten-to-six pin adapter PCB, neither of which is really needed for this activity. Instead, we can simply use SIX male-female DuPont jumper wires to connect the USBasp to our breadboard as shown above.
Use the Arduino IDE
Select:
Tools > Board > Arduino/Genuino Uno
Tools > Programmer > USBasp
And finally, select:
Tools > Burn Bootloader
Add USB Serial Interface
Once the ATmega328 chip has a bootloader, the firmware can be reprogrammed through the serial port just like on a typical Arduino module. We do however need an interface between the MCU serial port (UART RX and TX pins) and the USB port on the PC. For this USB-serial interfacing, the FT232BL USB serial adapter module is wired up to the breadboard using four female-to-male DuPont jumper wires as shown in the diagram above.
Note 1: The USBasp has now been removed from the breadboard.
Note 2: A momentary pushbutton has been added between the reset pin and the GND rail.
Let's call this button the "reset button". When it is pressed, the reset pin of the MCU is shorted to GND which puts the chip into reset (not running). When the button is released, the 10K pullup resistor will pull the reset pin of the MCU back up to 5V which will take the chip out of reset (letting it run - or boot up).
IDE Programming via FT232BL
In the IDE under Tools > Port, select the COM port that appears when you plug the FT232BL module into the PC and disappears when you unplug the module.
Hold down the reset button before hitting the program icon in the IDE. When the IDE shows that it is starting the actual upload, wait a couple of seconds and release the reset button. If the programming attempt fails, the reset-release timing may take a bit of experimentation. For a brief period after coming out of reset (a little over a second), the bootloader will wait to see if new code comes through the serial port for it to receive and program into the MCU. If that doesn't happen, it will go ahead and boot the code already stored in the MCU from the last programming event.
Auto Reset (Advanced Option)
Wouldn't it be nice to not worry about the reset button when programming the chip? You may notice that some MCU modules have sequence and timing requirements for button presses when programming the MCU, while some MCU modules seem to do the programming automatically without button presses. This isn't just random nor is it magic. A small circuit is added on some modules that uses one or more of the serial handshake signals from the PC to reset (and sometimes set bootstrapping pins on) the MCU whenever a code download is performed over the serial-USB interface.
For the ATmega328 chip, the auto reset circuit is quite simple. We just need a 0.1uF (100nF) capacitor. One side of the capacitor is connected to the RESET pin of the MCU. The 10K pullup resistor on the RESET pin must be left in place. The reset button can be removed, but you might as well keep it in place if its already there.
The other side of the capacitor is connected to the CTS (clear to send) or DTR (detect terminal ready) output from the USB-serial adapter module.
How does the auto reset circuit work? CTS and DTR are configured to both go low whenever a serial code download is coming from the PC. Either of these being coupled to the RESET pin of the MCU will drive the MCU into reset (remember the RESET pin is active low). Then, the capacitor charges back up to VCC (through the 10K pullup resistor) causing the RESET pin to see 5V again (after a very small delay). This releases the MCU from reset and lets the bootloader start just as the PC starts sending the new code image to be flashed.
SuperMini NRF52840
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.
Firmware Update
At this point you probably want to jump to the next Step and set up the SuperMini NRF52840 as a nRF bluetooth sniffer.
However, you can drop any NRF52840 compatible UF2 file 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.
NRF Sniffer
To install the nRF Sniffer firmware onto the SuperMini nRF52840:
- Download this UF2 file
- 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.
PN532 RFID/NFC Module
The PN532 (datasheet) is a highly integrated transceiver for contactless communication at 13.56 MHz. The integrated circuit features an 80C51 microcontroller core. The PN532 supports reading and writing RFID tags, as well as NFC functionality and wireless communications.
The module supports highly integrated Near Field Communication at 13.56MHz. A mode switch on the module easily selects between I2C, SPI, and UART modes. An integrated level shifter supports a working voltage of either 3.3V or 5V. Operation of the module is simplified using the Adafruit PN532 Library.
Hack Life Academy
An academy is an institution of higher learning, research, or honorary membership. The term traces back to Plato's school of philosophy, founded approximately 385 BC at Akademia, a sanctuary of Athena, the goddess of wisdom and skill. The word derives from the Athenian hero, Akademos. In the 17th century, British, Italian, and French scholars used the term "academia" to describe institutions of higher learning. The term has come to mean the cultural accumulation of knowledge, its development, and transmission across generations. It also refers to the keepers, educators, and practitioners of such knowledge.
In the academic spirit of accumulating skill and wisdom, we welcome you to subscribe to HackerBoxes. Join us every month for new discoveries in electronics, computation, communications, and information security. Visit HackerBoxes.com to sign up for your monthly HackerBox subscription. In the meantime, wear your HackerBox achievement patch with pride and share your successes and questions in the comments below. Please email support@hackerboxes.com anytime you have a question or need some assistance.