While trying to help my son with schoolwork, I searched for simple and cheap micro controller tutorial and found the ESP32 series of products. For $15, I bought a starter kit that included the micro controller on a development board, a nice OLED display, 10amp relay board, solderless breadboard, various sensors, LEDs, switches, resistors, and hookup wires. (It also included a non-functional USB cable that caused me some lost time)
A few things that stood out to me that made the ESP32 attractive were:
- Can use the Arduino IDE, which means it has huge support and examples, and geared toward the beginner
- Code is compatible with Arduino devices, which means all the existing projects built on Arduino devices can be used. (lots of these on the Internet)
- Has wifi built in
- Has bluetooth built in
- Has lots of I/O pins that can be used for inputs, outputs, ADC, DAC, serial, etc.
- inexpensive
I was amazed at how fast and easy it was to get started. The development board is powered from the USB port of your computer, and requires no additional wiring to load programs. The hardest thing is adding in ESP32 library to the standard Arduino IDE, which is as simple as searching and clicking “install”.
Libraries added to Arduino IDE to expand functionality.
When libraries are installed, lots of example projects are imported and show up in the File > Examples menu. This was super useful!
Hundreds of example projects automagicly show up!
Using the sample projects, I was able to create the following
- display information on the OLED display using the 2-wire SPI interface
- turn on/off LEDs connected to pins of development board
- read states of buttons connected to pins of development board
- connect the built in wifi radio to my home’s wifi and internet connection
- install time library and sync micro controller’s local time using NTP via internet
- run a web server that reads state of a local IO. –can connect multiple web clients and each one can change state of the local IO, and each client is updated w/ changes.
So– all of the above is amazing to me– So much advanced functionality for $15, and it is all relatively easy to implement. When I started learning electronics 30 years ago, all the tools were much harder to use and the information was much harder to obtain.
One of the things I am struggling with is the context of all the examples I find. After my brain locked up trying to understand what to do, I decided to give ChatGPT a chance, and it provided me super useful help first try.
I asked for help and pasted in the code I didn’t understand, and it picked the code apart piece by piece and explained how each part worked:
I could tell the date/time format codes used in the sample were standardized, but I couldn’t find the document that described what they were. I asked ChatGPT for more help, and it gave me exactly what I was looking for on the first try:
After I read the info it provided, I learned this format has been around longer than personal computers!