HackerBox 0043: Falken's Maze

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.

6 People Made This Project!

Recommendations

  • Puzzles Speed Challenge

    Puzzles Speed Challenge
  • "Can't Touch This" Family Contest

    "Can't Touch This" Family Contest
  • CNC Contest 2020

    CNC Contest 2020

29 Discussions

0
nirvajamz
nirvajamz

7 months ago

My issue seems to be resolved. I decided to shell out the $10 for an additional ESP32 board with camera, and stuffed the new camera in the original board. I no longer have the issue of a 7 minute time limit. The original camera must be defective, or succumbs to the heat the chip produces during operation. Oh well!

0
nirvajamz
nirvajamz

7 months ago

I am having issues with webcam performance. I can't quite make out what the issue is. I can get the board connected to wifi, although it takes many tries and resets of the board to activate, the stream starts successfully, and after a reliable 7 mins the feed starts to falter and cuts out. The serial monitor, even with verbose debugging, only states "esp_camera_fb_get(): Failed to get the frame on time!", and the capture stops. This relegates the device to little more than a knock-off toy of mild amusement, to be abandoned, than a useful hacker device. It does this with both the onboard wifi, as well as an external antenna. I am perplexed. Online research was not helpful. Anyone have any thoughts to share?

0
lmperkins
lmperkins

Question 11 months ago

I'm having the same issue with the serial monitor.
- the code loaded fine
- without the 5v power attached I get a brownout warning on the serial monitor
- when I attach the 5v power and reset I get nothing on the serial monitor (not even the dots some folks have mentioned)
- I've selected the proper camera type and double checked my network setting
Any suggestions to get things working? Thanks a lot.

0
lmperkins
lmperkins

Answer 11 months ago

I got this the serial monitor working once I found out I needed to have both the 5volt and 3volt connections in place. This gave me an IP address, but I'm only seeing the black screen as described by several other users. Reloading the driver and sketch doesn't seem to help.

0
LED Freak 101
LED Freak 101

1 year ago

I have tried and tried but I can not get the camera to work. Can anyone help with this?

0
LED Freak 101
LED Freak 101

Reply 1 year ago

Okay so I got it to load the code but no IP in the serial monitor. Any hints?

0
Detillio
Detillio

Reply 1 year ago

Double check that you performed step9 and entered your SSID and network password correctly in the example program. First time I misspelled part of mine and it wouldn't connect.

0
LED Freak 101
LED Freak 101

Reply 1 year ago

I did that but all I get once I disconnect the power from Serial interface and connect the 5Vdc USB interface is dot after dot after dot in the Serial monitor. With the Serial interface connected useing the onboard 3Vdc at least I can see it but it brown outs as disscribed in the video.

0
ParityBit1
ParityBit1

Reply 11 months ago

Hi, I had the same problem (dot after dot in Serial Monitor), what I did is changed the wifi for 2.4Ghz instead of the 5Ghz I have and got it connected. Let me know if that worked.

0
LED Freak 101
LED Freak 101

Reply 1 year ago

So I replaced the 5Vdc power supply and now in serial it says camera is detected but not supported. Camera probe failed wit h error 0X20004

0
LED Freak 101
LED Freak 101

1 year ago

I just watched War Games the movie and it wasn't half bad. I would be interested in knowing how much his computer would have cost back in the day though, I'm sure it would have been very expensive. Its free if you have Amazon Prime.

0
TimGTech
TimGTech

1 year ago

I've gotten around to getting my ESP-32 CAM working just fine. Is there any rotate function 90 degrees? What seems like should be the right side up is apparently sideways. Not a big deal though. This thing is cool! ;)

0
Pete Lefferson
Pete Lefferson

1 year ago

Please help me identify the IP address from the Serial Monitor output. I see a full screen of program code but don't recognize the IP address that I need.
Thank you

0
Creaturish
Creaturish

Reply 1 year ago

If you're still having issues, you could use a network scanner instead.
(I used an app called Fing)
Saw a new generic device on my network manufactured by Espressif.
In Fing the IP is clearly listed along with the MAC address.

1
Detillio
Detillio

1 year ago

I am able to get the EPS32 cam programmed and I can connect to the webserver, but when I start the stream I don't get any video. Just a red X. Serial monitor shows it's connected to my Wifi and it generates a constant stream when you click start stream, but no images.

2
Creaturish
Creaturish

Reply 1 year ago

I'm having the same issue!
Going to keep troubleshooting.. it's been frustrating!

Serial monitor says:
...
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://10.0.0.236' to connect

Though I'm still getting the red "x" when connected to the web server as well...

Update: I got it working!

I removed then reinstalled the eps32 board package.
Then re-uploaded the sketch to the board.
Also, make sure this line is commented out in the code:
//#define CAMERA_MODEL_WROVER_KIT

The little camera is not too bad! :D
Here's my dog being a ham:

Capturebb.PNG
0
AustinB114
AustinB114

1 year ago

The pan-tilt assembly kit you have pictured is not the one in the box. Even after trimming the horns they don't line up for the screws.

0
Detillio
Detillio

Reply 1 year ago

I had the same problem. I was able to trim down one and shave it to fit and the other I had a spare that fit on mine. it's not ideal, but it works.

0
HowardW29
HowardW29

1 year ago

Still haven't figured out what the issue is with the serial port, but it appears not to be specific to this project. I've compiled and installed a few other examples of ESP32 code on the web, one as simple as "Hello, World", and all produce noisy junk on the serial output.

0
kitplummer
kitplummer

1 year ago on Step 9

I just can't seem to get my ESP32 module programmed. Just keep getting "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header".

Googling reveals a bunch junk, revolving around holding the "BOOT" button, which this module doesn't have, or wiring in a cap. Ugh. Double-checking my wiring now.