IN Elektroda.pl gadgets a communication module will appear soon Wi-Fi and Bluetooth based on ESP32 . Compared to previously available modules ESP8266 The ESP32 has two 32b cores, one dedicated to supporting wireless communication. The comparison of ESP8266 with ESP32 shows new functionalities and greater possibilities at a similar price and power consumption.
Characteristics of ESP32 compared to ESP8266:
-number of cores: 2 (ESP8266: 1)
-WiFi + Bluetooth / BLE (ESP8266: WiFi)
-RAM: 512kB (ESP8266: 160kB - 96 + 64)
- number of GPIO pins depending on the version: ~ 32 (ESP8266: ~ 16)
- ADC channels quantity: 18 12b channels (ESP8266: 1 10b channel)
-Number of DAC channels: 2 8b channels (ESP8266: 0)
- the number of channels of the touch interface: 10 (ESP8266: 0)
- SPI, I2C, UART, I2S, CAN, IR, Ethernet MAC buses (ESP8266: SPI, I2C, UART, I2S)
-supporting cryptographic functions: SHA, AES, ECC / RSA, RNG
-16x PWM
Interfaces for the card SD and MAC Fast Ethernet allow for easy building of universal modules such as:
WiFi / BLE / Ethernet / microSD
The module is equipped with a system CP2102 being a USB UART converter, which allows, among others for programming the module from the Arduino level. There is a stabilizer on the module's board, which enables power supply with 5V, e.g. from a USB port.
Integration with the Arduino environment under Win10 control:
-we install the latest version of Arduino https://www.arduino.cc/ currently 1.8.3
-we install python 2.7 https://www.python.org/ selecting "Add python.exe to Path" during installation
- we install the Git client https://git-scm.com/downloads
- run Git GUI as administrator (right mouse button)
-select "clone existing repository"
- we give the source: https://github.com/espressif/arduino-esp32.git
-select the target as the path that you will find in Arduino-> File-> Preferences-> Sketchbook Location, at the end of the path add \ hardware \ espressif \ esp32, then click Clone
-We go to the created directories \ hardware \ espressif \ esp32 then \ tools and run get.exe
we observe the process of downloading and unpacking
- run the Arduino environment, select tools -> board and the option to select ESP32 Dev Module should appear, select the serial port that appeared in the system after connecting the board.
We can start working with ESP32!
The update consists in starting the Git GUI, selecting the created repository and selecting Remote-> Fetch from-> orgin and then restarting get.exe in \ hardware \ espressif \ esp32 \ tools \
Preparing to work with ESP32 is more complex than in the case of ESP8266, if you notice errors in the description or encounter problems with launching, let us know in this topic, together we should be able to overcome any obstacles.
DS18B20 Blynk Wi-Fi Thermometer - code redemption for ESP8266.
As in the previous material, we will try to send data from the temperature sensor to the blynk application on a smartphone. Unfortunately, the arduino thingspeak library does not currently support ESP32, but you can send thingspeak data with regular GET requests.
When you are adjusting your programs on ESP8266 to ESP32, you should, among others change:
#include to #include
Another change is the names of the pins, we change the naming convention:
D2, D3, D4, D5 etc. replace with ordinary 2,3,4,5 etc.
We change the program code for blynk from the previous example and we can receive data from the temperature sensor sent via WiFi on the application on our smartphone.
More information about blynk in the previous material: ESP8261 D1 mini .
Sample program code:
Main line 1-wire has been configured on the G13 pin, which we connect with the yellow wire of the DS18B20 sensor, the G13 pin is connected with the 4.7kom resistor with + 3.3V, the red sensor wire with 3.3V, and the black with GND.

After configuring the WiFi access program and the blynk token in the code, after compiling and running on ESP32 in the blynk application on the smartphone, the current temperature readings should appear. We managed to use the code described in the two previous materials: D1 mini module - ESP8266 and ESP8266-12E NodeMCU Amica + DS18B20
Internet radio on ESP32:
Let's try to leave Arduino for a moment and go a bit beyond the IoT application scheme in the form of a temperature sensor.
We will launch an internet radio player project on ESP32: https://github.com/MrBuddyCasino/ESP32_MP3_Decoder
The project is based on an earlier one that cooperated with ESP8266: https://github.com/espressif/ESP8266_MP3_DECODER
You can find projects extended with an external DAC and OLED display: https://www.youtube.com/watch?v=aSnZo7Biu5E
https://github.com/kodera2t/ESP32_OLED_webradio
According to the description on the website: http://esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html, download the MSYS2 toolkit, unpack the downloaded archive e.g. to C: \ msys32 and run C: \ msys32 \ mingw32.exe
We can close the environment window, in the location C: \ msys32 \ home \ username \ create a folder with the name e.g. esp
According to the description http://esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf, run cmd and go to the esp directory in the console
cd C: \ msys32 \ home \ username \ esp
We run the git tool installed during the integration with Arduino by issuing the command:
git clone --recursive https://github.com/espressif/esp-idf.git
then we enter the esp-idf directory:
cd esp-idf
and give the command
git submodule update --init
It remains to configure the paths as described: http://esp-idf.readthedocs.io/en/latest/get-started/add-idf_path-to-profile.html#add-idf-path-to-profile-windows
So in the C: /msys32/etc/profile.d/ directory we create a file, e.g. export_idf_path.sh
enter in the file:
export IDF_PATH = "C: / msys32 / home / username / esp / esp-idf"
Run C: \ msys32 \ mingw32.exe again and enter:
printenv IDF_PATH
The path should point to the location of esp-idf in the esp directory
For a change, let's use the GIT GUI and choose the option of cloning an existing repository:
source: https://github.com/MrBuddyCasino/ESP32_MP3_Decoder.git
destination: C: \ msys32 \ home \ username \ esp \ web_radio
choose remote-> fetch from-> orgin
Run C: \ msys32 \ mingw32.exe and go to the C: \ msys32 \ home \ username \ esp \ web_radio directory
We make the configuration:
make menuconfig

In the serial flasher config section, we provide the COM port number on which the ESP32 connected is available (to be checked in the device manager or Arduino environment):

In the Web Radio / BT Speaker section, set the WiFi access parameters and the type of audio output:

I chose the built-in 8bit DACs which will give quite poor sound quality, but you can use an external I2S DAC which should significantly improve the quality of the sound played.
We save the settings and exit the configuration tool, then issue the command:
make flash
After compilation, the result will be sent to ESP32 and run, the audio signal will appear on DAC pins G25, G26:

The boot button switches the stream sources defined in:
C: \ msys32 \ home \ username \ esp \ web_radio \ main \ playlist.pls
Bluetooth speaker on ESP32:
By doing again:
make menuconfig
we can change the configuration so that the https://github.com/MrBuddyCasino/ESP32_MP3_Decoder project works as a bluetooth speaker.
In the component config section, select Bluetooth:

In Bluetooth we choose Bluedroid Bluetooth stack enabled:

Then the Bluetooth clasics:

In the web radio section, select BT speaker mode, here we can change the name of the BT device:

After compiling and loading the code into ESP32:
make flash
e.g. in the smartphone we can search and connect to the ESP_SPEAKER device or with a different name, if you changed it during configuration.
Compared to the previous material about ESP8266, the launch of ESP32 may seem more complex, but it is worth learning new things and trying out the new functionalities offered by ESP32.
What ideas do you have for using your ESP32?

Characteristics of ESP32 compared to ESP8266:
-number of cores: 2 (ESP8266: 1)
-WiFi + Bluetooth / BLE (ESP8266: WiFi)
-RAM: 512kB (ESP8266: 160kB - 96 + 64)
- number of GPIO pins depending on the version: ~ 32 (ESP8266: ~ 16)
- ADC channels quantity: 18 12b channels (ESP8266: 1 10b channel)
-Number of DAC channels: 2 8b channels (ESP8266: 0)
- the number of channels of the touch interface: 10 (ESP8266: 0)
- SPI, I2C, UART, I2S, CAN, IR, Ethernet MAC buses (ESP8266: SPI, I2C, UART, I2S)
-supporting cryptographic functions: SHA, AES, ECC / RSA, RNG
-16x PWM
Interfaces for the card SD and MAC Fast Ethernet allow for easy building of universal modules such as:
WiFi / BLE / Ethernet / microSD
The module is equipped with a system CP2102 being a USB UART converter, which allows, among others for programming the module from the Arduino level. There is a stabilizer on the module's board, which enables power supply with 5V, e.g. from a USB port.
Integration with the Arduino environment under Win10 control:
-we install the latest version of Arduino https://www.arduino.cc/ currently 1.8.3
-we install python 2.7 https://www.python.org/ selecting "Add python.exe to Path" during installation
- we install the Git client https://git-scm.com/downloads
- run Git GUI as administrator (right mouse button)
-select "clone existing repository"
- we give the source: https://github.com/espressif/arduino-esp32.git
-select the target as the path that you will find in Arduino-> File-> Preferences-> Sketchbook Location, at the end of the path add \ hardware \ espressif \ esp32, then click Clone
-We go to the created directories \ hardware \ espressif \ esp32 then \ tools and run get.exe
we observe the process of downloading and unpacking
- run the Arduino environment, select tools -> board and the option to select ESP32 Dev Module should appear, select the serial port that appeared in the system after connecting the board.
We can start working with ESP32!
The update consists in starting the Git GUI, selecting the created repository and selecting Remote-> Fetch from-> orgin and then restarting get.exe in \ hardware \ espressif \ esp32 \ tools \
Preparing to work with ESP32 is more complex than in the case of ESP8266, if you notice errors in the description or encounter problems with launching, let us know in this topic, together we should be able to overcome any obstacles.
DS18B20 Blynk Wi-Fi Thermometer - code redemption for ESP8266.
As in the previous material, we will try to send data from the temperature sensor to the blynk application on a smartphone. Unfortunately, the arduino thingspeak library does not currently support ESP32, but you can send thingspeak data with regular GET requests.
When you are adjusting your programs on ESP8266 to ESP32, you should, among others change:
#include to #include
Another change is the names of the pins, we change the naming convention:
D2, D3, D4, D5 etc. replace with ordinary 2,3,4,5 etc.
We change the program code for blynk from the previous example and we can receive data from the temperature sensor sent via WiFi on the application on our smartphone.
More information about blynk in the previous material: ESP8261 D1 mini .
Sample program code:
Code: c
Main line 1-wire has been configured on the G13 pin, which we connect with the yellow wire of the DS18B20 sensor, the G13 pin is connected with the 4.7kom resistor with + 3.3V, the red sensor wire with 3.3V, and the black with GND.

After configuring the WiFi access program and the blynk token in the code, after compiling and running on ESP32 in the blynk application on the smartphone, the current temperature readings should appear. We managed to use the code described in the two previous materials: D1 mini module - ESP8266 and ESP8266-12E NodeMCU Amica + DS18B20
Internet radio on ESP32:
Let's try to leave Arduino for a moment and go a bit beyond the IoT application scheme in the form of a temperature sensor.
We will launch an internet radio player project on ESP32: https://github.com/MrBuddyCasino/ESP32_MP3_Decoder
The project is based on an earlier one that cooperated with ESP8266: https://github.com/espressif/ESP8266_MP3_DECODER
You can find projects extended with an external DAC and OLED display: https://www.youtube.com/watch?v=aSnZo7Biu5E
https://github.com/kodera2t/ESP32_OLED_webradio
According to the description on the website: http://esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html, download the MSYS2 toolkit, unpack the downloaded archive e.g. to C: \ msys32 and run C: \ msys32 \ mingw32.exe
We can close the environment window, in the location C: \ msys32 \ home \ username \ create a folder with the name e.g. esp
According to the description http://esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf, run cmd and go to the esp directory in the console
cd C: \ msys32 \ home \ username \ esp
We run the git tool installed during the integration with Arduino by issuing the command:
git clone --recursive https://github.com/espressif/esp-idf.git
then we enter the esp-idf directory:
cd esp-idf
and give the command
git submodule update --init
It remains to configure the paths as described: http://esp-idf.readthedocs.io/en/latest/get-started/add-idf_path-to-profile.html#add-idf-path-to-profile-windows
So in the C: /msys32/etc/profile.d/ directory we create a file, e.g. export_idf_path.sh
enter in the file:
export IDF_PATH = "C: / msys32 / home / username / esp / esp-idf"
Run C: \ msys32 \ mingw32.exe again and enter:
printenv IDF_PATH
The path should point to the location of esp-idf in the esp directory
For a change, let's use the GIT GUI and choose the option of cloning an existing repository:
source: https://github.com/MrBuddyCasino/ESP32_MP3_Decoder.git
destination: C: \ msys32 \ home \ username \ esp \ web_radio
choose remote-> fetch from-> orgin
Run C: \ msys32 \ mingw32.exe and go to the C: \ msys32 \ home \ username \ esp \ web_radio directory
We make the configuration:
make menuconfig

In the serial flasher config section, we provide the COM port number on which the ESP32 connected is available (to be checked in the device manager or Arduino environment):

In the Web Radio / BT Speaker section, set the WiFi access parameters and the type of audio output:


I chose the built-in 8bit DACs which will give quite poor sound quality, but you can use an external I2S DAC which should significantly improve the quality of the sound played.
We save the settings and exit the configuration tool, then issue the command:
make flash
After compilation, the result will be sent to ESP32 and run, the audio signal will appear on DAC pins G25, G26:

The boot button switches the stream sources defined in:
C: \ msys32 \ home \ username \ esp \ web_radio \ main \ playlist.pls
Bluetooth speaker on ESP32:
By doing again:
make menuconfig
we can change the configuration so that the https://github.com/MrBuddyCasino/ESP32_MP3_Decoder project works as a bluetooth speaker.
In the component config section, select Bluetooth:

In Bluetooth we choose Bluedroid Bluetooth stack enabled:

Then the Bluetooth clasics:

In the web radio section, select BT speaker mode, here we can change the name of the BT device:

After compiling and loading the code into ESP32:
make flash
e.g. in the smartphone we can search and connect to the ESP_SPEAKER device or with a different name, if you changed it during configuration.
Compared to the previous material about ESP8266, the launch of ESP32 may seem more complex, but it is worth learning new things and trying out the new functionalities offered by ESP32.
What ideas do you have for using your ESP32?

Cool? Ranking DIY