Introduction: HackerBoxes 0015: Connect Everything

CONNECT EVERYTHING: This month, HackerBox Hackers are exploring the newly introduced ESP32. With dual core processor, Wi-Fi, and Bluetooth, the ESP32 shows incredible promise for connecting all the things. This Instructable contains information for working with HackerBoxes #0015. If you would like to receive a box like this right to your mailbox each month, now is the time to subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for this HackerBox:

  • Understanding the features of the Espressif ESP32 SoC
  • Programming the ESP32 with ESP-IDF, Arduino, and/or microPython
  • Interfacing over I2C to an OLED display matrix
  • Controlling a chained ring of RGB LEDs
  • Contributing to ESP32 project descriptions
  • Biohacking with Caffeine

HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are hobbyists, makers, and experimenters. And we are the dreamers of dreams.

Step 1: HackerBoxes 0015: Box Contents

  • HackerBoxes #0015 Collectable Reference Card
  • ESP32 DevKitC
  • OLED Display 0.96inch 128x64 pixels
  • Ring of 24 RGB WS2812 LEDs
  • Matrix Keyboard 4x4
  • Stereo 3.5mm Breakout
  • USB to microUSB Cable
  • Female-Female DuPont Jumpers 10cm
  • Four Pack of Go Cubes
  • Exclusive ESP32 Connect Everything Decal
  • Exclusive Hack The Planet Branded Decals

Some other things that will be helpful:

  • Soldering iron and solder
  • Smart Phone or Tablet
  • Computer for running development tools

Most importantly, you will need a sense of adventure, DIY spirit, and hacker curiosity. Hardcore hobbyist electronics aren't always easy, but when you persist and enjoy the adventure, a great deal of satisfaction may be derived from persevering and getting your projects working. Just take each step slowly, mind the details, and don't hesitate to ask for help.

Step 2: Biohack With GoCubes Chewable Coffee

To prepare for getting everything connected, let's boot up the wetware.

Yes, Razor and Blade suggest the soft drink of the 3133t h4x0r for those late night hacks, but that was twenty years ago. This month, we contacted the Bro Scientists over at Nootrobox, Inc. and said little more than "Hackers Love Coffee" before we were taking delivery of a heroic load of GoCubes.

Do you really know Caffeine? Despite being legal and readily available, caffeine is a powerful stimulant drug. If you are not a coffee drinker, you might to pass your GoCubes on to a friend.

Another word of warning, this time regarding the taste. While GoCubes look like gummy candy, they do not taste like candy. They taste like real, strong coffee because that is exactly what they are. This realization can be shocking to the mouth, so we suggest realizing it beforehand. Not candy.

Want more? Nootrobox also hooked us up with a special HackerBoxes coupon to share. Biohack the Planet!

Step 3: ESP32 SoC (system on a Chip)

Notice: The ES32 is "the new hotness" and many of the tools and example programs are still in flux. It was no easy feat to get our hacky paws on these DevKits in such a large quantity because they are still mostly being provided to developers. Accordingly, this month the HackerBox call to "bring your hacker spirit" truly becomes a call to action. We have the opportunity to literally create some of the first examples, projects, and explanations for other hobbyists who will be flocking to the ESP32. We will also be doing some pioneering, finding some bugs, and we will need to be extra patient and understanding. Keep an eye on this instructable because it will evolve as our community collectively discovers, and hopefully creates, new opportunities with the Espressif ESP32.

The ESP32 SoC (datasheet) is amazingly small and amazing powerful as we can see in the table comparing the ESP32 to its predecessor, the 8266, and also to a typical Arduino UNO. The ESP32 is very likely to become the go-to chip for electronics hobbyists in the coming months and years.

The ESP32 is a single chip 2.4 GHz Wi-Fi and Bluetooth combo solution. It is highly integrated, requiring less than ten external components. The ESP32 integrates the antenna switch, RF balun, power amplifier, low noise receive amplifier, filters, and power management modules. As such, the entire solution occupies minimal Printed Circuit Board (PCB) area.

Step 4: ESP32 DevKitC Module

Despite being such a new device, the ESP32 is already being integrated into a number of modules and development boards. A current list of these can be found on the ESP32 Wikipedia entry.

Espressif (maker of the ESP32) has provided us with the ESP32-DevKitC based on the ESP-WROOM-32 module. The schematic of the ESP32-DevKitC is shown here.

An ESP32 forum is available for us to stay on the bleeding edge of developments related to this new device.

Step 5: ESP32 IoT Development Framework

The ESP-IDF (IoT Development Framework) is the official development framework for the ESP32 chip. It is still a little cumbersome, but it gets the job done. Follow the link above and scroll to the section titled "Setting Up ESP-IDF" where you can follow the guide specific to your computer's operating system (Linux, OSX, or Windows) to install the IDF. Continue through the steps to building and flashing one or more of the examples.

The Getting Started Guide for the ESP32-DevKitC from Espressif also walks through some examples with the ESP-IDF. It is worth having a look at.

Step 6: Arduino ESP32

Since most of us are very familiar with the Arduino ecosystem and IDE, this may be the easiest way to work with the ESP32. This Arduino extension is still pretty new, so we've run into some glitches, but these should get worked out in near future.

The Arduino ESP32 github repository starts with installation instructions for LInux, OSX, and Windows. Click to that link and follow the instructions that correspond with the operating system on your computer.

This video steps through the process for adding the ESP32 hardware support to the Arduino IDE.

Step 7: MicroPython on the ESP32

Even MicroPython has been ported to the ESP32.

To try it out, follow the instructions at the micropython-esp32 repository.

This video on microPython for the ESP32 is excellent.

Step 8: IoT Weather Widget

The weather widget is a popular ESP8266 project which we can implement using the ESP32 wired in a tiny OLED display.

The OLED display is128x64 pixels in only 0.96 inches. It features an I2C with a 4pin connection to the SSD1306 (datasheet) driver chip.

Step 9: LED Ring

This project uses the RMT peripheral of the ESP32 to control WS2812 RGB LEDs.

The included LED ring is made up of a chained ring of 24 WS2812B. This ring can, of course, be used with any Arduino using the standard WS2812 libraries. The RMT project can also be used to control the ring from the ESP32. The ESP32 implementation should be extended to support controlling the color or "motion" over bluetooth or an HTTP interface.

Step 10: Keypad

The Arduino Playground Matrix Keypad Tutorial is a good starting point for working with this type of keypad.

Suggested applications:

Combine with OLED display to implement a simple retro game: SnakeByte, Space Invaders, or the like.

Combine with ESP32 to make an IFTTT (Amazon Dash) Button like this one.

Control the RGB LED ring.

Step 11: Future ESP32 Projects

As we've mentioned, this is only the beginning for the ESP32. We expect to see a flood of projects using this device. Here are some to consider contributing your efforts on:

Leverage the ten capacitive touch inputs of the ESP32.

Generate sound effects, or even stream music, using the DAC outputs of the ESP32 and a 3.5mm audio breakout.

Configure the ESP32 as an MQTT broker.

Implement a Bluetooth to Wi-Fi gateway.

Step 12: Hack the Planet

Thank you for sharing our adventures with the new ESP32 chip. Connect Everything! If you have enjoyed this Instrucable and would like to have a box of electronics projects like this delivered right to your mailbox each month, please join us by SUBSCRIBING HERE.

Reach out and share your success in the comments below and/or on the HackerBoxes Facebook page. Certainly let us know if you have any questions or need some help with anything. Thank you for being part of HackerBoxes. Please keep your suggestions and feedback coming. HackerBoxes are YOUR boxes. Let's make something great!

Comments

author
MichaelH539 made it! (author)2017-03-05

A little late on this one, but I took jasper_fracture's weather
widget and added an LCD for displaying additional info as well as a GPS
receiver to get current location. The GPS location is passed to the api
to get the current weather instead of having to hard code the
city/state.

I have attached shots of each status captured by the
LCD, as well as a zip file containing the .ino file and libraries needed
for the program. This entire project was built with items received in
the Hackerboxes (HB0008, HB0010, and HB0015). The only part I added
outside of what was received in the Hackerboxes was a 10K potentiometer. Can't wait to get the next box!!

Connecting.JPGWiFi_Connected.JPGIP_Address.JPGNo_Signal.JPGRetrying.JPGInitial_LAT_LON.JPGCurrent_Weather.JPGLAT_LON.JPGUltimate_Weather_Widget_Breadboard.jpgUltimate Weather Widget Files and Libraries.zip
author
AshetynW (author)MichaelH5392017-05-06

I loaded up your entire library, but there seems to be an issue that i'm hoping you maybe able to assist with. When compiling the Ultimate_Weather_Widget, i receive this error:

C:\Users\*user*\Documents\Arduino\libraries\esp8266-weather-station-master\ESP8266wifi.h:27:26: fatal error: avr/pgmspace.h: No such file or directory

Do you know anyway to keep this issue from happening? i've tried to just #include the pgmspace.h file but still says not found. any help would be greatly appreciated!

author

Nice little project Michael ! Too bad there wasn't a leftover 10K pot from one of those boxes :)

author
MikeM515 made it! (author)2017-04-27

Made a little weather widget. Learned a lot making it. Added a real time clock that I bought and had not used. Updating RTC with NTP also.

IMG_20170427_201143897.jpgIMG_20170427_201148222.jpgIMG_20170427_201156679.jpgIMG_20170427_201205702.jpg
author
MustBeArt (author)2017-04-06

I've created a 3D-printable enclosure for the 4x4 Matrix Keypad, to make it panel mountable and prevent the pins from shorting out. Here's the Thing on Thingiverse:

http://www.thingiverse.com/thing:2229746

01_complete.jpg
author
AmanA40 made it! (author)2017-03-12

LED ring is done! .. Made a tiny HTTP server on the ESP32 thanx to Arduino libraries and took commands through the browser :)

Untitled.pngVID_20170312_175404.mp4
author
AnandS80 (author)AmanA402017-03-25

Looks cool!!! Is it possible to share corresponding Arduino code?

author
AmanA40 (author)AmanA402017-03-12

Video can be seen @

https://drive.google.com/open?id=1eKpftUusHSui2uL3d_r71eRHScg2utifhw

author
AnandS80 made it! (author)2017-03-25

Implemented Snake Game using ESP32 and Oled Display.

Video:

Arduino Code: https://github.com/AnandVetcha/HackerBox/tree/master/Box15/Snake_ESP32

Snake_ESP32.jpg
author
AmanA40 made it! (author)2017-03-12

@jasper_fracture - You rock! ..

20170311_224019-COLLAGE.jpg
author
jasper_fracture (author)AmanA402017-03-13

Thanks Aman! Your weather widget looks good! :)

author
Ctglodek (author)2017-02-28

Dont forget about HackerBox Reedit subthread

https://www.reddit.com/r/hackerboxes/

author
AlexandreS15 (author)2017-02-05

Is anyone having trouble with the thing not appearing on a Mac at all? I mean, the serial port driver. My ESP8266 from the Auto Sports box works just fine, but this one fails to show up. Is it using another serial-usb driver?

author

Ok, answering myself, there we go. My unit came with the CP1202 Usb-to-uart chip. The drivers are here: http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx#mac

author
DavidK561 (author)AlexandreS152017-02-28

I was stumped with the same problem. Your post saved me today, thanks!

author
mainegeek (author)2017-02-05

Has anyone gotten the Weather Widget working? It looks like the ESP32 libraries don't have a Ticker.h. I also found I had to change most of the #include <ESP8266WiFi.h> to #include <WiFi.h> but I still can't compile because of Ticker. Any thoughts? Am I missing something?

author

Maine -

We posted our project so far on our site. It's very basic and still buggy, but it works. It's probably enough to help get you going.

http://jasperfracture.com/basic-weather-widget-for-ssd1306-and-esp32/

author
calderra (author)jasper_fracture2017-02-27

I downloaded the jasperfracture code and got it working- If anyone gets an error like "A fatal error occurred: Failed to connect to ESP32: Invalid head of packet ('p')" you can either spend a long time tweaking things in the code according to this link https://esp32.com/viewtopic.php?f=13&t=334 OR you can just hold down the "BOOT" button during upload. I'll try to get in and post some code improvements when I can, but having the temp display is already neat.

author
SkynetEngineer made it! (author)jasper_fracture2017-02-11

I followed your build Jasper Fracture. Seems to be working and updating. Now I need to make it switch info screens.

2017021195160818.jpg
author

Looks good!

It is still throwing seemingly random exceptions during the client.readStringUntil(), and I am having some difficulty tracking it down. I did find what appeared to be a related issue reported from about a week ago. I'm working on cleaning up the code and also going back to using the static buffer instead of the heap related buffer.

author

Thanks. I got it to work on the ESP32. It's not 100% but it isn't bad either. I'll give you details on reddit.

Check this out:

author
djcc2012 (author)mainegeek2017-02-09

Very nice. I like the oversize breadboard.

author
mainegeek (author)djcc20122017-02-10

Haha, thanks. I didn't like how cramped things were on 1 breadboard.

author
bitsandwitts (author)2017-02-18

https://leanpub.com/kolban-ESP32/

Great free book on ESP32

author
SkynetEngineer (author)2017-02-11

Hey Hackers, I'm finally starting this box today.. I too was pleasantly shocked to see the 32 in this months subscription. If you have time, head over to Amazon and give the Espressif 32 a review and let them know you received it in your Hackerbox subscription. Doing this on a regular basis will let companies know that giving deals to Hackerbox is the best way to get their products noticed, and keep us in goodies! Also good to get the Hackerbox word out. There was only 1 review for the ESP32 DevKitC when I left mine this morning.
Ok, on to the project. Why is there no schematic of the led ring connections? Or am I just missing it?

author
xample (author)2017-02-09

Skipped the micropython for now and hooked up the ESP32 with a GPS receiver to make a nice little GPS tracker.

https://chrisdonohue.technology/2017/02/09/gps-tra...

IMG_20170209_105715.jpg
author
mainegeek (author)xample2017-02-10

It looks good man. Nice write up too.

author
djcc2012 (author)2017-02-09

I think my ESP32 may have just died. My PC stopped finding it as a port
using the Arduino IDE. It has 1.35v on the 5V pin. I didn't think I did
anything special and didn't see any blue smoke, but it is no longer
working as far as I can tell. :-(

author
AlexandreS15 (author)2017-02-05

I got this example working on pin 5, but I don't know which one would be the onboard pin:

int ledPin = 5;

void setup()

{

pinMode(ledPin, OUTPUT);

Serial.begin(115200);

}

void loop()

{

Serial.println("Hello, world!");

digitalWrite(ledPin, HIGH);

delay(500);

digitalWrite(ledPin, LOW);

delay(500);

}

author
mainegeek (author)AlexandreS152017-02-05

I don't think you can blink the internal LED. I did like ruthsarian and used a LED from a previous box and attached it between IO5 and ground.

author
gt0taku (author)2017-01-30

How do I flash the ESP32 with micropython?

author
nickzoic (author)gt0taku2017-01-31

Should just work, once you've got a build working run 'make deploy'. We haven't got releases of binary builds coming out yet but hope to soon.

author
ptrebilcox-ruiz (author)2017-01-29

Anyone have an image of the back of their LED ring? I figure I just need to solder connections to the flat strips on the back of it, but I don't want to assume that and be wrong (breaking it). Thanks

author

That's what I did, then I used the NEOPIXEL example to connect it straight to a Genuine Uno. as I mentioned in the reddit community I am putting up githubs of the examples I use and projects I create (not many yet... been busy. Autosport is the only one I have really dedicated any time to... and that was just an afternoon.)

https://www.reddit.com/r/hackerboxes/comments/5qvi...

author

While I haven't received mine yet, I have used these rings before and it should have pads 5v DIN/DOUT GND with the 5v being on the outside data in/out in the center and gnd on the inside ring. At least that is how the 15 different ones I already have are labeled. The best results i've had is by tinning the wire with a little extra then putting it on the ring and with the soldering iron heating it up just enough to get it back to a liquid state. DON'T try to do all 3 at the same time.

author

Awesome, I'll give that a shot. Thanks!

author
TimGTech (author)2017-01-30

I have my ESP32 up and running. I opted to go the Arduino IDE route being I already had it and Python loaded and ready to go. BTW - If anyone is having any troubles getting started, the Sparkfun hookup guide is great too. Although its for their version, it's basically the same setup process.

https://learn.sparkfun.com/tutorials/esp32-thing-h...

I ran the WiFiScan example and that detected my SSID's ok. However, the Basic Client example would not connect to either of my AP's (Verizon Wireless Router and a Ubiquity AP). The WiFiMulti.addAP used in the BasicClient example must not like them But I kicked on the HotSpot on my cell phone and it connected to it just fine. I used one of the others that uses WiFi.begin to connect to the AP's and they all connect fine using it.

Now onto getting this ESP32 working with Cayenne. If I get that going I will post back here.

author
neobigd (author)2017-01-27

I'm super stoked to have a ESP32 in this HackerBox, been trying to get my hands on one since they came out. Looking forward to working with this new board/chip...on some GoCubes!!!

author
ChaseWoofer (author)neobigd2017-01-29

I'm so jelly, I haven't received mine yet. I just received 4 of the ESP-32S chips i ordered through Amazon along with the breakout board (this will be my first attempt at soldering a chip onto a board, kinda nervous about doing it). So glad I'll be able to play with this one already assembled on the board once I get it in the mail.

author
JoshK95 (author)2017-01-28

using OSX - Having one heck of a time getting the esp-idf example app to compile. I try 'make menuconfig' and get the following

NTCH-A114-NQ2LV:myapp jkittle$ make menuconfig
cc -DCURSES_LOC="<curses.h>" -DKBUILD_NO_NLS -Wno-format-security -DLOCALE -c -o mconf.o mconf.c
error: unable to open output file 'mconf.o': 'Permission denied'
1 error generated.
make[1]: *** [mconf.o] Error 1
make: *** [/Users/jkittle/esp/esp-idf/tools/kconfig/mconf] Error 2
NTCH-A114-NQ2LV:myapp jkittle$

author
djcc2012 (author)2017-01-28

I ran the WiFiScan example using the Arduino IDE. It works very well. In the IDS set the upload speed to 115200, the same as Serial Monitor speed. It defaults to an upload speed of 926100.

--------------

scan start
scan done
2 networks found
1: NETGEAR63 (-38)*
2: HP-Print-6D-Officejet Pro 8600 (-74)*

-------------------

author
ruthsarian (author)2017-01-28

Got my box yesterday and tried running the blink example via the ESP-IDF. It kept uploading just fine, or so it said, but that little red LED on board just wouldn't blink.

After a night's sleep I went back and realized that I should see what PIN it's actually blinking. (GPIO 5). Not the on-board LED! Connected an LED between IO5 and GND and it blinks.

I'm too used to arduino boards with the on-board LED being the one that blinks with the blink example.

Looking at the ESP32-DevKitC schematic that's part of this article, it looks like that RED LED is part of the power supply section and it's not connected to any PIN. The only way it'll ever blink is if you add a switch to the power going into the ESP32 and rapidly turn it on and off.

author
NoviceAttempts (author)2017-01-27

I would love to get the community to do a collection of reaction videos to the Go Cubes. So, once you get your HackerBox shoot a quick video of yourself trying a GO Cube, let us know what you think of it, and post it here. I'll do the same once I get mine. This'll either be fun, or super boring.

author

Got my box, tried out the Go Cubes....they are definitely as advertised, and they are not for me.
Check out my reaction video: https://youtu.be/19ig_gRuvMc

author
NoviceAttempts (author)2017-01-27

Check out my unboxing video: https://youtu.be/5_pKndOpHFQ

author
SuperMechaCow (author)2017-01-27

Hey guys! Be sure to check out the subreddit community we're trying to build up!

https://www.reddit.com/r/hackerboxes/