Category Archives: ESP32

ESP32 PWM Example

This ESP32 PWM example explains how to use the Pulse Width Modulation (PWM) with the ESP32-WROOM32 DevKit.

ledcWrite(pinChannel, dutyCycle);
ESP32 can generate PWM on all IO pins. In the ESP32 analogWrite will not work, is different than the Arduino Uno. ESP32 uses 8, 10, 12, 15-bit resolution for PWM generation PWM value. Arduino Uses 8-Bit Resolution i.e.PWM range is 0-254.

Continue reading ESP32 PWM Example

ESP32 DevKit ESP32-WROOM GPIO Pinout

Introduction

ESP32-WROOM-32 is a powerful, generic Wi-Fi+BT+BLE MCU module that targets a wide variety of applications, ranging from low-power sensor networks to the most demanding tasks, such as voice encoding, music streaming and MP3 decoding.

ESP32 LED Blink Example
At the core of this module is the ESP32-D0WDQ6 chip*. The chip embedded is designed to be scalable and adaptive. There are two CPU cores that can be individually controlled, and the CPU clock frequency is adjustable from 80 MHz to 240 MHz. The user may also power off the CPU and make use of the low-power co-processor to constantly monitor the peripherals for changes or crossing of thresholds. ESP32 integrates a rich set of peripherals, ranging from capacitive touch sensors, Hall sensors, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C.

For more details Read ESP32-WROOM32 Data sheet

Continue reading ESP32 DevKit ESP32-WROOM GPIO Pinout

ESP32 Wroom32 DevKit Analog Read Example

Analog to digital conversion is the ability to read a voltage level found on a pin between 0  and some maximum value and convert that analog value into a digital representation . Varying the voltage applied to the pin will change the value read. The ESP32 has an analog  to digital converter built into it with a resolution of up to 12 bits which is 4096 distinct values. What that means is that 0 volts will produce a digital value of 0 while the maximum voltage will produce a digital value of 4095 and voltage ranges between these will produce a correspondingly scaled digital value. Continue reading ESP32 Wroom32 DevKit Analog Read Example

ESP32 Access point (AP) and Station web server with HTML using Arduino IDE

In this tutorial we are making ESP32 as both Station and Access point and web server. We have seen how to connect to WiFi Router and make web server in previous post.

What you will Learn?

  1. Making ESP32 as Access Point
  2. ESP32 as Station
  3. ESP32 as both Station and Access Point at the same time
  4. ESP32 as web server with HTML web page
  5. Using Java Scripts in ESP32
  6. Using CSS in ESP32

A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests, which are forwarded by their computers’ HTTP clients.

ESP32 Access point web server

Continue reading ESP32 Access point (AP) and Station web server with HTML using Arduino IDE

Web server on ESP32: How to update and display sensor values?

In many IoT Applications we monitor sensor data and we want to display it in wab page. Web page requires frequent refresh to get the update from ESP32. To solve this problem you have two options, first is refresh page with HTML Tag: ex. refresh at every 30 seconds.

<head>
<meta http-equiv=”refresh” content=”30″>
</head>
Disadvantage of using HTML refresh tag is, it flickers the screen and loads complete page again and again.

In this tutorial I will show you how to display ADC data and update without refreshing web page. You can do a lot of things with this. At the end we will see some advance applications of this. To make this possible we need to use javaScript Ajax.

Tools you need

only ESP32, Laptop and USB cable

What you will learn?

  1. ESP32 Ajax web page  to display and update sensor data without refresh.
  2. Getting data from ESP32 without page refresh and update it in web page dynamically. such as ADC values or temperature readings.

Continue reading Web server on ESP32: How to update and display sensor values?