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!
29 Comments
5 years ago
I am still working on this thing. i've tried everything. just trying to get the wifiscan script to work and the monitor is only giving this as a result:
)⸮
⸮ܠ⸮)⸮M⸮⸮̀q⸮⸮!⸮)))⸮⸮⸮⸮!⸮⸮⸮⸮⸮9⸮L)⸮F⸮⸮R⸮⸮F⸮⸮v⸮⸮⸮⸮⸮C⸮⸮⸮9J0⸮⸮⸮⸮⸮Ԧ⸮F⸮⸮⸮⸮⸮F⸮z⸮⸮!⸮H⸮⸮⸮J⸮⸮⸮D⸮⸮Aވ⸮⸮F⸮⸮E⸮⸮⸮⸮⸮⸮&⸮L⸮⸮⸮F⸮⸮⸮8Ό⸮⸮⸮⸮⸮üݬ⸮⸮⸮bJ⸮
What could i possibly be doing incorrectly? I cant seem to find a bit of support on this.
6 years ago
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
6 years ago
Dont forget about HackerBox Reedit subthread
https://www.reddit.com/r/hackerboxes/
6 years ago
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?
Reply 6 years ago
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
Reply 6 years ago
I was stumped with the same problem. Your post saved me today, thanks!
6 years ago
https://leanpub.com/kolban-ESP32/
Great free book on ESP32
6 years ago
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?
6 years ago
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...
Reply 6 years ago
It looks good man. Nice write up too.
6 years ago
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. :-(
6 years ago
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);
}
Reply 6 years ago
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.
6 years ago
How do I flash the ESP32 with micropython?
Reply 6 years ago
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.
6 years ago
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
Reply 6 years ago
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...
Reply 6 years ago
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.
Reply 6 years ago
Awesome, I'll give that a shot. Thanks!
6 years ago
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.