Page 1
Welcome! Thank you for purchasing our AZ-Delivery ESP32 Lolin32. On the following pages, you will be introduced to how to use and set up this handy device. Have fun!
Table of Contents Introduction....................3 Specifications....................4 The pinout.....................5 How to set-up Arduino IDE................6 Installing the ESP32 Board in Arduino IDE..........10 Sketch examples..................12 Example with DS18B20................12 Example with BME280................18 - 2 -...
Introduction Lolin32 is the ESP32 development board. Like other ESP32 boards, it also has a 32-bit dual-core microcontroller which operates at 240MHz, has 4MB of flash storage. It can be programmed in a range of languages, such as microPython, LUA, mod. C/C++ in Arduino IDE, just like any other microcontroller.
How to set-up Arduino IDE If the Arduino IDE is not installed, follow the link and download the installation file for the operating system of choice. The Arduino IDE version used for this eBook is 1.8.13. For Windows users, double click on the downloaded .exe file and follow the instructions in the installation window.
Page 7
For Linux users, download a file with the extension .tar.xz, which has to be extracted. When it is extracted, go to the extracted directory and open the terminal in that directory. Two .sh scripts have to be executed, the first called arduino-linux-setup.sh and the second called install.sh.
Page 8
Almost all operating systems come with a text editor preinstalled (for example, Windows comes with Notepad, Linux Ubuntu comes with Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text editors are perfectly fine for the purpose of the eBook. Next thing is to check if your PC can detect an Atmega328p board.
Page 9
If the Arduino IDE is used on Windows, port names are as follows: For Linux users, for example, port name is /dev/ttyUSBx, where x represents integer number between 0 and 9. - 9 -...
Installing the ESP32 Board in Arduino IDE To install ESP32 add-on in Arduino IDE first open Arduino IDE, than go to File > Preferences: In Additional Boards Manager URLs box enter the next URL: https://dl.expressif.com/dl/package_esp32_index.json Than go to Tools > Board > Boards Manager and search for ESP32 and press the install button for esp32 by Espressif Systems.
Page 11
Now, the board can be selected in the boards menu: WEMOS LOLIN32 board is used in this project. Now, the ESP32 board is ready for code to be uploaded. - 11 -...
Sketch examples The ESP32 Lolin32 needs a micro USB cable to allow a computer to program and communicate with the microcontroller. Example with DS18B20 // Measure the temperature of your pool or pond with DS18B20 // and report it in your local WiFi...
Page 14
// Sensor Serial.println("Dallas DS18B20 Temperature "); // Start up the library sensors.begin(); void loop() { // Sensor // call sensors.requestTemperatures() to issue a global temperature // request to all devices on the bus Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE");...
Page 16
The output should be as in the following image: Note: Set baud rate to 115200. - 16 -...
Page 17
WiFi works even when the micro USB cable is not connected. Simply enter the IP address in your browser followed by /Sensor. When not connected to the computer, the Serial Monitor of the Arduino IDE does not get the information. - 17 -...
Example with BME280 #include <Wire.h> #include <SPI.h> #include <Adafruit_Sensor.h> #include <Adafruit_BME280.h> #define BME_SCK 18 //use these pins for hardware SPI #define BME_MISO 19 #define BME_MOSI 23 #define BME_CS 5 Adafruit_BME280 bme; // I2C //Adafruit_BME280 bme(BME_CS); // hardware SPI //Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI unsigned long delayTime;...
Page 19
Wire.begin(26,27); //add this line for I2C with SDA=26 and SCL=27 status = bme.begin(); //default is 0x77; otherwise bme.begin(0x76) if (!status) { Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!"); Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(),16); Serial.print(" ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");...
Page 21
Note: This works for I2C on pins 26 and 27 and could also be used (with minor modifications) for SPI. Sketch and Libraries are from Adafruit (US). - 21 -...
Page 22
Internet. If you are looking for the high quality microelectronics and accessories, AZ-Delivery Vertriebs GmbH is the right company to get them from. You will be provided with numerous application examples, full installation guides, eBooks, libraries and assistance from our technical experts.
Need help?
Do you have a question about the ESP32 Lolin32 and is the answer not in the manual?
Questions and answers