Introduction: HackerBox 0043: Falken's Maze

Greetings to HackerBox Hackers around the world! HackerBox 0043 brings us embedded webcam streaming, capacitor circuits, micro servo pan-tilt assembles, and much more. This Instructable contains information for getting started with HackerBox 0043, which can be purchased here while supplies last. If you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for HackerBox 0043:

  • Configure the ESP32-CAM for Arduino IDE
  • Program a Webcam Demo for ESP32-CAM
  • Measure Ceramic Capacitors
  • Assemble an Analog LED Cycling Badge
  • Explore Micro Servos and Pan-Tilt Assemblies

HackerBoxes is the monthly subscription box service for enthusiasts of electronics and computer technology - Hardware Hackers - The dreamers of dreams.

HACK THE PLANET

Step 1: Content List for HackerBox 0043

  • ESP32-CAM Module
  • Arduino Nano 5V 16Mhz
  • Pan-Tilt Assembly with Dual Micro Servos
  • FT232RL USB Serial Adapter Module
  • USB 5V and 3.3V Power Module
  • Ceramic Capacitor Kit
  • WOPR Badge - Solder Kit
  • Two CR2032 Lithium Coin Cells
  • Miniature Solderless Breadboard
  • Female-Female DuPont Jumpers
  • MiniUSB Cable
  • Java Decal
  • Exclusive HackerBoxes Falken's Maze Game
  • Exclusive WarGames Inspired Decal

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • Computer for running software tools

Most importantly, you will 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.

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 really appreciate your taking a few minutes to read the FAQ.

Step 2: Go Right Through Falken's Maze

Falken’s Maze: Game Theory, Computer Science, and the Cold War Inspirations for WarGames

"A strange game. The only winning move is not to play. How about a nice game of chess?"

-1983 Movie WarGames

Step 3: ESP32-CAM Wiring Modes

The ESP32-CAM module combines an ESP32-S Module, an OV2640 camera, a microSD card slot, LED flash, and several I/O pins. The ESP32-CAM allows you to set up wireless video streaming, provide a web server interface, integrate a wireless surveillance camera into your home automation system, perform facial detection/recognition, and much more.

Install the Camera: The camera connector on the ESP32 is a white slot with a darker brown or black snap at the edge. The dark snap hinges down away from the PCB towards the white portion of the connector. Once opened, the flex connector is inserted into the white slot with the lens facing out. Finally, the dark snap is pressed back down into the slot connector. Note that the lens has a protective cover sheet than can be peeled off prior to use.

PROGRAMMING MODE

To program the ESP32-CAM, wire up the FT232RL USB Serial Adapter as shown. Be sure to set the power jumper on the FT232RL USB Serial Adapter to 3.3V. The short between the IO0 and GND pins is used to put the ESP32 into program mode. This wire can be removed to allow the ESP32 to boot into execution mode.

WEBCAM MODE

Once programmed, the ESP32-CAM only needs to have 5V and GND connected. The USB Power Supply module can be used or any other 5V supply capable of providing enough current.

SERIAL MONITOR SUPPORT

To run the ESP32-CAM while still connected to USB (for example, to view the serial monitor output) simply connect both of the modules as shown here at the same time, but then remove the IO0 ground once programming is complete. This will allow the ESP32 to execute and use the USB/serial connection while also providing enough current through the 5V pin to fully power the ESP32. Without the 5V supply, the 3.3V output of the FT232RL will not fully power the ESP32 and a "brownout" failure message with occur.

Step 4: ESP32-CAM Webcam Streaming Server

  1. Make sure the FT232RL module power jumper is set to 3.3V
  2. If not already installed, grab the Arduino IDE
  3. Follow Installation Instructions for the ESP32 Arduino IDE Board Support Package
  4. In IDE Tools, set Board to ESP32 Wrover Module
  5. In IDE Tools, set Partition Scheme to Huge APP
  6. In IDE Tools, set Port to the FT232RL USB Serial Adapter
  7. In IDE Files, open Examples > ESP32 > Camera > CameraWebServer
  8. Change camera model #define to "CAMERA_MODEL_AI_THINKER"
  9. Change SSID and Password strings to match your WiFi network
  10. Compile and upload the modified example
  11. Remove the IO0 jumper
  12. Confirm the 5V supply is also connected or ESP32 may "brownout"
  13. Open the Serial Monitor (115200 baud)
  14. Hit the reset button on the ESP32-CAM module
  15. Copy the IP address from the Serial Monitor output
  16. Paste the IP address into your web browser
  17. The ESP32-CAM webcam interface should display
  18. Click the "Start Stream" button in the webcam interface

Step 5: Ceramic Capacitors

A ceramic capacitor is a fixed-value capacitor where the ceramic material acts as the dielectric. It is constructed of two or more alternating layers of ceramic and a metal layer acting as the electrodes. The composition of the ceramic material defines the electrical behavior of the capacitor. (Wikipedia)

Circuit Basics has a useful discussion covering the measurement of capacitance including some examples of measuring capacitors using Arduino hardware and programs. Scroll down to the section heading "CAPACITANCE METER FOR 470 UF TO 18 PF CAPACITORS" for a demo that can be used with the type of ceramic capacitors in the Ceramic Capacitor Kit. While the demo depicts an Arduino UNO, use of the Arduino Nano can be used as well. After setting up the Arduino IDE to program the Arduino Nano, simply paste in "THE CODE FOR SERIAL MONITOR OUTPUT" from the linked page into the IDE and compile/download the pasted code into the Nano.

For additional information on configuring and programing the Arduino Nano, have a look at the online guide for the HackerBoxes Starter Workshop.

Step 6: WOPR Badge Kit

This WOPR Badge features eighteen LEDs with color-cycling controlled entirely by analog capacitor-timed oscillators. Prior HackerBox examples have used this type of analog circuit for similar LED flashing applications. The design reminds us that microcontrollers, as much as we love them, are not always required to obtain interesting results. The completed circuit board assembly may be worn as a blinky LED badge.


Kit Contents:

  • Custom WOPR Printed Circuit Board
  • Two CR2032 Coin Cell Clips
  • Six Red 3mm LEDs
  • Six Orange 3mm LEDs
  • Six Green 3mm LEDs
  • Three 9014 NPN Transistors
  • Three 22uF Capacitors
  • Three 1K ohm Resistors (brown-black-red)
  • Three 10K ohm Resistors (brown-black-orange)
  • Slide Switch
  • Two Split Ring

The design features three cascaded oscillators to control the LED color-cycling. Each of the 10K resistors and 22uF capacitors forms an RC oscillator that periodically pushes the associated transistor on. The three RC oscillators are cascaded in a chain to keep them cycling out of phase which makes the blinking appear random around the board. When the transistor is "on" current passes through its bank of 6 LEDs and their 1K current limiting resistor causing that bank of 6 LEDs to blink on.

This example includes a nice explanation of this analog oscillator concept using a single stage (one oscillator and one transistor).

Step 7: WOPR Badge Kit Assembly

VERY IMPORTANT NOTE ABOUT COMPONENT ORIENTATION: The badge looks best when assembled with the through-hole components on the "front side" of the PCB where the artwork of the WOPR is displayed. However, the component outlines are on the reverse side and these dictate the proper orientation of the components. This can be particularly confusing with regard to the TO-92 transistors, which should be inserted from the front of the PCB with the flat portion facing upward, which is flipped from the required orientation if inserted from the back of the PCB. The TO-92 transistors can also be laid with the flat surface against the PCB front as shown in the example.

Note that there are two different values of resistors. They are not interchangeable. Resistors are not polarized. They may be inserted in either direction.

Note that there are three "banks" of LEDs D1-D6, D7-D12, and D13-D18. Each bank should be all one color in order to balance the current load and also for a nice visual effect. For example, LEDs D1-D6 could all be (R)ED, D7-D12 all (G)REEN, and D13-D18 all (O)RANGE.

The capacitors are polarized. Note the "+" making on the PCB silkscreen. The "-" marking (and short pin) on the capacitor should be inserted into the OTHER hole.

The LEDs are also polarized. Note the flat side of the LED shown on the PCB silkscreen. The short pin (cathode or negative lead) of the LED should be in the hole closest to the "flat side" of the LED silkscreen.

Entirely tin all three pads for each of the coin cell clips with solder. Even though nothing gets soldered to the center pads, tinning helps to build the pad up to ensure a good contact to the respective coin cell.

After soldering, operate the switch several times to clear the contacts of debris or oxidation.

Take care not to short the two coin cell clips together while the WOPR Badge is being worn.

Step 8: Micro Servo Pan-Tilt Assembly

The Pan-Tilt Assembly consists of two micro servos, four molded plastic mechanical elements, and assorted hardware. The assembly can be purchased from Adafruit where you can also find a great guide illustrating how the assembly works.

The Arduino Servo Library can be used to control one of the micro servos to pan the assembly around its central axis and the other micro servo to tilt the assembly up and down. This Instructable provides a detailed example for positioning the two servos using Arduino code.

The Pan-Tilt Assembly can be used to position displays, lasers, lights, cameras, or just about anything. As usual, let us see what you come up with!

An interesting challenge, if you are up for it, is to add two slide controls (pan and tilt) to the web interface of the "CameraWebCamera" example that push position parameters to the ESP32-CAM firmware which in turn sets the two servos to position the webcam while streaming.

Step 9: Livin' the HackLife

We hope you have enjoyed this month's voyage into electronics and computer technology. Reach out and share your success in the comments below or on the HackerBoxes Facebook Group. Certainly let us know if you have any questions or need some help with anything.

Join the revolution. Live the HackLife. You can get a cool box of hackable electronics and computer tech projects delivered right to your mailbox each month. Just surf over to HackerBoxes.com and subscribe to the monthly HackerBox service.