The ESP32 is the newest* super powered IoT/Arduino board you are going to want in your arsenal.
I have long been a fan of the ESP8266, especially the cheap Chinese NodeMCU boards, so when I saw the faster, more capable ESP32 had Arduino compatibility, I had to give it a try!
* Yeah, it’s been talked about since 2015, but really it’s not been convenient to play with until now 🙂
ESP32 Arduino Power House
How big and capable? It’s a 32 bit board, dual-core running at … wait for it … 160mhz (or as high as 240mhz)!
There’s 128KB of ROM, 416KB SRAM, and Flash memory is external (I think mine is 4MB, max 64MB).
So it is fast, has a bunch of memory, and does wifi. Cool?
One downside of the ESP8266 was its lack of pins. Not a problem here, there are 36 GPIO pins, including:
- Up to 16 channels ADC
- 2x 8-bit DAC (actual analog!)
- 16x PWM
- 10x capacitive touch sensing
- 2x UART
- 2x I2C
- 4x SPI
- 2x I2S
Yeah, it’s not the first 32 bit board out there, but this is still serious business for Arduino IoT fans!
While I have friends who swear by the Teensy boards, I just don’t see the point in them now the ESP32 is packaged in a convenient, wifi-enabled board.
Oh, and there is more – It doesn’t just do wifi by the way, as well as wifi it also has Bluetooth/BLE!
Buying an ESP32
The board I purchased was the $15 Espressif ESP32 board from Adafruit.
Sparkfun also have a board, and I am sure there will be many more out there.
The chip is causing a lot of buzz so I have no doubt the dev board clones will be coming thick and fast too.
Arduino with the ESP32
Like with many third-party Arduino boards, you need to add hardware definitions, but right now it is still early in the development so you need to get the files from the git repo.
Download and uncompress and place in your Hardware folder.
Within the tools folder you will find a get.py python script that will install the compiler etc.
How to Connect to Wifi on the ESP32
The wifi on the ESP32 is fast and is SSL compatible, which is nice because Maker Hacks just went 100% HTTPS 😉 There is a secure HTTP client available here that follows 301 redirects, as yet I haven’t got it working (I think I messed up my libraries) but I will update when I do get it running.
ESP32 has plenty of memory so can cope with the large strings that make up web pages, JSON/XML data, and everything we throw at internet of things devices nowadays.
Let’s try some code, shall we?
In this example we will connect via wifi to a website and switch on an LED when stuff is happening. Nothing too strenuous 🙂
Just to make it extra fancy I placed a 3d printed Stormtrooper head over the LED 😉