https://bomonike.github.io/esp332
This is at https://github.com/bomonike/bomonike.github.io/blob/master/esp32.md
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.
GPIO | Input | Output | Notes | |
0 | pulled up | OK | outputs PWM signal at boot, must be LOW to enter flashing mode | RTC_GPIO11 T1 ADC2_CH1 |
1 | TX pin | OK | debug output at boot | |
2 | OK | OK | connected to on-board LED, must be left floating or LOW to enter flashing mode | RTC_GPIO12 T2 ADC2_CH2 |
3 | OK | RX pin | HIGH at boot | |
4 | OK | OK | RTC_GPIO10 ADC2_CH0 | |
5 | OK | OK | outputs PWM signal at boot, strapping pin | |
6 | x | x | connected to the integrated SPI flash | (SCK/CLK) |
7 | x | x | (SDO/SD0) | |
8 | x | x | (SDI/SD1) | |
9 | x | x | (SHD/SD2) | |
10 | x | x | (SWP/SD3) | |
11 | x | x | (CSC/CMD) | |
12 | OK | OK | boot fails if pulled high, strapping pin | RTC_GPIO15 T5 ADC2_CH5 |
13 | OK | OK | T4 | |
14 | OK | OK | outputs PWM signal at boot | RTC_GPIO116 T6 ADC2_CH6 |
15 | OK | OK | outputs PWM signal at boot, strapping pin | RTC_GPIO13 T1 ADC2_CH3 |
16 | OK | OK | ||
17 | OK | OK | ||
18 | OK | OK | ||
19 | OK | OK | ||
21 | OK | OK | I2C SDA | |
22 | OK | OK | I2C SCL | |
23 | OK | OK | ||
25 | OK | OK | RTC_GPIO6 DAC1 ADC2_CH8 | |
26 | OK | OK | RTC_GPIO7 DAC2 ADC2_CH9 | |
27 | OK | OK | RTC_GPIO17 T7 ADC2_CH7 | |
32 | OK | OK | RTC_GPIO9 T9 ADC1_CH4 | |
33 | OK | OK | RTC_GPIO8 T8 ADC1_CH5 | |
34 | OK | RTC_GPIO4 ADC1_CH6 input only | ||
35 | OK | RTC_GPIO5 ADC1_CH7 input only | ||
36 | OK | RTC_GPIO0 ADC1_CH0 input only | ||
37 | OK | ADC1_CH1 input only | ||
38 | OK | ADC1_CH2 input only | ||
39 | OK | RTC_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.
https://docs.espressif.com/projects/arduino-esp32/en/latest/tutorials/io_mux.html
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
PlatformIO Extension: https://platformio.org/platformio-ide
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
For ESP32 and ESP8266 MCUs:
https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/
The BME280 reports just Temperature, Humidity, Pressure.
Short USB-C to microUSB cable
ESP32 runs on 3.3V vs. 5V on the Arduino. See https://www.youtube.com/watch?v=F7tIs21Ar9s So to connect the two technologies together, a linear regulator converts the excess voltage into heat. It litteraly burns 1.7V. Get the $9.95 Step-Down Voltage Regulator at https://www.pololu.com/product/2830
ESP32 Arduino Tutorial: Getting weather data from API and https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
https://www.instructables.com/Get-Weather-Data-Using-Python-and-Openweather-API/
$79.99 https://www.udemy.com/course/mastering-hardware-protocols-with-esp32-and-arduinos/
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