bomonike

esp32.png

https://bomonike.github.io/esp332

This is at https://github.com/bomonike/bomonike.github.io/blob/master/esp32.md

Hardware

ESP32 MCU (MicroController Unit) is from Espressif Systems, a company based in Shanghai, China.

Espressif uses chips manufactured using the 40 nm process by TSMC in Taiwan, China.

Models:

Data Sheet : https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf

ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth.

ChatGPT is an artificial intelligence (AI) chatbot developed by OpenAI and released in November 2022. The name “ChatGPT” combines “Chat”, referring to its chatbot functionality, and “GPT”, which stands for Generative Pre-trained Transformer, a type of large language model (LLM). ChatGPT is built upon OpenAI’s foundational GPT models, specifically GPT-3.5 and GPT-4, and has been fine-tuned (an approach to transfer learning) for conversational applications using a combination of supervised and reinforcement learning techniques. ChatGPT was launched on November 30, 2022, and gained attention for its detailed and articulate responses spanning various domains of knowledge. However, a notable drawback has been its tendency to confidently provide inaccurate information. By January 2023, it had become the fastest-growing consumer software application in history, gaining over 100 million users and contributing to OpenAI’s valuation growing to US$29 billion. The introduction of ChatGPT has spurred competition in the field, leading to the accelerated development of Google’s chatbot Bard, initially based on LaMDA and later on PaLM, as well as Meta AI’s foundation model LLaMA,[citation needed] which serves as a basis for other chatbot creations. The chatbot is operated on a freemium model, where users on the original, free tier only have access to GPT-3.5, while ChatGPT Plus users also have access to GPT-4, albeit on a limited basis.

ESP32 supports Bluetooth and WiFi built-in. So ESP can be be updated via OTA (Over the Air) from a PHP server, send sensor readings via emails and WhatsApp messages.

Unique with ESP32 is its “Near WiFi” that enables multiple units to communicate with Espressif’s proprietary protocol.

ESP32 is 32 bit vs. 16 bit on the Arduino. So ESP32 has more granular PWM (Pulse Width Modulation) Analog-to-Digital (ADC) of 65,532 vs 4095 on the 12-bit Arduino.

The ESP32 has 18 x 12 bits ADC 18 Analog-to-Digital Converter (ADC) input channels (while the ESP8266 only has 1x 10 bits ADC).

You can decide which pins are UART, I2C, SPI, PWM:

10 Capacitive sensing GPIOs.

The following table shows what pins are best to use as inputs, outputs and which ones you need to be cautious. Pins highlighted in red are not recommended to use as inputs or outputs. Pins highlighted in green are OK to use. Pins highlighted in yellow are OK to use, but you need to pay attention because they may have an unexpected behavior mainly at boot.

GPIOInputOutputNotes
0pulled upOKoutputs PWM signal at boot, must be LOW to enter flashing modeRTC_GPIO11 T1 ADC2_CH1
1TX pinOKdebug output at boot
2OKOKconnected to on-board LED, must be left floating or LOW to enter flashing modeRTC_GPIO12 T2 ADC2_CH2
3OKRX pin HIGH at boot
4OKOKRTC_GPIO10 ADC2_CH0
5OKOKoutputs PWM signal at boot, strapping pin
6xxconnected to the integrated SPI flash(SCK/CLK)
7xx(SDO/SD0)
8xx(SDI/SD1)
9xx(SHD/SD2)
10xx(SWP/SD3)
11xx(CSC/CMD)
12OKOKboot fails if pulled high, strapping pinRTC_GPIO15 T5 ADC2_CH5
13OKOKT4
14OKOKoutputs PWM signal at bootRTC_GPIO116 T6 ADC2_CH6
15OKOKoutputs PWM signal at boot, strapping pinRTC_GPIO13 T1 ADC2_CH3
16OKOK
17OKOK
18OKOK
19OKOK
21OKOKI2C SDA
22OKOKI2C SCL
23OKOK
25OKOKRTC_GPIO6 DAC1 ADC2_CH8
26OKOKRTC_GPIO7 DAC2 ADC2_CH9
27OKOKRTC_GPIO17 T7 ADC2_CH7
32OKOKRTC_GPIO9 T9 ADC1_CH4
33OKOKRTC_GPIO8 T8 ADC1_CH5
34OKRTC_GPIO4 ADC1_CH6 input only
35OKRTC_GPIO5 ADC1_CH7 input only
36OKRTC_GPIO0 ADC1_CH0 input only
37OKADC1_CH1 input only
38OKADC1_CH2 input only
39OKRTC_GPIO3 ADC1_CH3 input only

PROTIP: ADC2 pins cannot be used when Wi-Fi is used. So, if you’re using Wi-Fi and you’re having trouble getting the value from an ADC2 GPIO, use an ADC1 GPIO instead.

esp-pins.webp

https://docs.espressif.com/projects/arduino-esp32/en/latest/tutorials/io_mux.html

Proect Video

https://www.youtube.com/watch?v=tc3Qnf79Ny8 Getting Started with ESP32 - Step-By-Step Tutorial Oct 28, 2021. by Tomasz Tarnowski working on a Mac with

Software

The ESP32 makes use of the C-language Arduino Framework & IDE.

MicroPython:

There is a uPyCraft IDE for

USB to UART Driver

https://github.com/xaverh/vscode-clang-format#installing-clang-format Clang-Format is a tool to format C/C++/Java/JavaScript/Objective-C/Objective-C++/Protobuf code from within Visual Studio Code at https://marketplace.visualstudio.com/items?itemName=xaver.clang-format

Parts List

For ESP32 and ESP8266 MCUs:

Tutorials

https://randomnerdtutorials.com/learn-esp32-with-arduino-ide/

https://makeradvisor.com/tools/esp32-dev-board-wi-fi-bluetooth/ $9.99

To build a Arduino Tutorial: Getting weather data from API https://www.dfrobot.com/blog-917.html

https://github.com/CircuitSetup/Expandable-6-Channel-ESP32-Energy-Meter CircuitSetup Expandable 6 Channel ESP32 Energy Meter