Measure Wind Speed with Anemometer on ESP32 TFT Display
Wind Speed Measurement using Adafruit Anemometer Sensor on ESP32 TFT Touch Display. Display wind speed as mph or m/s on TFT Display of ESP32
- Suitable forB.Tech/Diploma ESP32/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this tutorial, we will display wind speed on TFT Display using
ESP32 & Anemometer
. The project uses an embedded board that combines a
3.5” touchscreen display
and
ESP32-WROVER Module
with a built-in 2M pixel OV2640 camera. We will connect the
Anemometer Sensor
externally to the analog pin of ESP32.
An
anemometer
is a device used for measuring
wind speed
and
direction
. The anemometer sensor we are using here is the
Adafruit anemometer
. The Adafruit anemometer is capable of measuring wind speeds up to
70 m/s
or
156 mph
. The 3.5″ TFT Touch Screen Display uses an
ILI9488 TFT LCD Driver
. The screen resolution is
320×480
. There are multiple external pins to connect the ESP32 display with sensors/actuators. This is the reason they are suitable for various
IoT applications
We will now see how we can use the ESP32 TFT Display along with the Anemometer Sensor to create a beautiful dynamic
widget
. The wind speed in miles per hour will be displayed on TFT Display along with the alert level.
Bill of Materials
Following are the list of components that you need for making this project. You can purchase all these components online.
S.N.
Components
Quantity
Purchase Link
ESP32+TFT Touch Display
Makerfabs Link
Adafruit Anemometer Sensor
Adafruit
Type C USB Cable
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
ESP32 3.5″ TFT Touch(Capacitive) with Camera
This is a beautiful
3.5” touchscreen display
, based on
ESP32-WROVER chip
, with a built-in
2M pixel OV2640 camera
. The combination of all these gives a perfect platform for multiple ESP32 Applications & Projects.
The TFT LCD driver is basically
ILI9488
& has a dimension of
3.5″
with
320×480
screen resolution. The
ILI9488 LCD
uses SPI for communication with the ESP32 chip. The SPI main clock could be up to
60M~80M
, make the display smooth enough for videos.
While the camera is not used, you can freely use all these pins with the breakout connectors. You can then connect the ESP32 display with sensors or modules & use it for any
IoT applications
. The ESP32 chip support Arduino or MicroPython programming
The board is having a
micro SD-Card slot
for attaching an external SD-Card. The SD Card can be used for storing files and images. There is a
type C USB Port
, basically a USB to UART converter for ESP32 programming. You can connect a Type-C data cable to the board & directly upload the code to the Board.
Specification
1. 3.5 inch display,
320×480
2. Capacitive/Resistive Touch
3. ESP32-WROVER Controller
WIFI/ BLE
Connection.
5. Onboard USB2UART convertor for ESP32 programming
6. 2M pixel OV2640 Camera
OV2640
supports output images up to 2 million pixels
8. LCD 3.5-inch Amorphous-TFT-LCD for mobile-phone or handy electrical equipment
9. LCD Driver: ILI9488
10. LCD Resolution: 320*480
11. Micro SD card slot on the board
NS2009
: A 4-wire resistive touch screen control circuit
FT6236
: single-chip capacitive touch panel controller Integrated Circuit
14. Power supply:
5V
, Type-C USB
Check some of our previous projects using this TFT Touch Screen Display:
ESP32 TFT Touch Display Video Games
ESP32 TFT Touch & Camera Projects
Adafruit Anemometer Sensor
The
Adafruit Anemometer Sensor
is a Three-cup type anemometer that is capable of measuring wind speed up to
70m/s or 156mph
. It is composed of a shell, the wind cup, and the circuit module.
The sensor is supplied with a length of
3 core cables
and three connections. A
black wire
to power and signal ground, a
brown wire
for power which can be anything from
7-24v DC
, and a third
blue wire
that provides measurements via
analog voltage
. The output analog voltage will range from
0.4V (0 m/s wind)
up to
2.0V (for 32.4m/s wind)
To learn more in detail about this sensor, check our previous post related to Anemometer Sensor:
Anemometer Sensor Arduino Guide
. You may use
Ultrasonic Anemometer
if you don’t want movable parts.
Specifications
Voltage Required:
7-24v
DC
Output:
0.4V
to
2V
Testing Range:
0.5m/s
to
50m/s
Start wind speed:
0.2 m/s
Resolution:
0.1m/s
Accuracy: Worst case
1 meter/s
Max Wind Speed:
70m/s
Pin details: Pin 1 –
Power
(brown wire), Pin 2 –
Ground
(black wire), Pin 3 –
Signal
(blue wire)
Hardware Connections for ESP32 TFT Display with Anemometer
As TFT Touch Display and ESP32-Wrover Module are internally connected to the PCB, we only require Anemometer Sensor Connection. Connect the Anemometer Sensor as per the diagram below.
Connect the VCC and GND Pin of Anemometer Sensor to external 9V & GND. Connect the GND of the external power supply to the GND of ESP32. Similarly, connect the Anemometer input pin to GPIO35 of ESP32.
Installing TFT_eSPI Library to Arduino IDE
This is a TFT graphics library for Arduino processors with performance optimization for STM32, ESP8266 & ESP32. The library is targeted at 32-bit processors. It supports “Four wire” SPI and 8 bit parallel interfaces. The library supports some TFT displays with drivers for ILI9163, ILI9225, ILI9341, ILI9488, ST7735 etc.
You can download the library from the
Github
directory. But the library requires some modification for our project. So here is an edited version of the library. You can download and add it to the library folder.
Download:
TFT_eSPI Library
Source Code/program
The code part requires a file called Alert.h to create a warning signal on the TFT Display.
Main Code
Open Arduino IDE and create a new file and paste the following code. You can save it with any name but with .ino extension.
#include "alert.h" // Out of range alert icon
#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>
// Meter colour schemes
#define RED2RED 0
#define GREEN2GREEN 1
#define BLUE2BLUE 2
#define BLUE2RED 3
#define GREEN2RED 4
#define RED2GREEN 5
#define TFT_GREY 0x2104 // Dark grey 16 bit colour
TFT_eSPI
tft
=
TFT_eSPI
(
)
;
// Invoke custom library with default width and height
uint32_t
runTime
=
99999
;
// time for next update
int
d
=
;
// Variable used for the sinewave test waveform
boolean
range_error
=
;
void
setup
(
void
)
{
Serial
begin
(
115200
)
;
tft
begin
(
)
;
tft
setRotation
(
)
;
tft
fillScreen
(
TFT_BLACK
)
;
tft
setTextColor
(
TFT_WHITE
TFT_BLACK
)
;
tft
drawString
(
"Wind Speed"
)
;
}
void
loop
(
)
{
float
sensorValue
=
analogRead
(
)
;
float
voltage
=
(
sensorValue
/
4095
)
*
;
float
wind_speed
=
mapfloat
(
voltage
0.4
32.4
)
;
float
speed_mph
=
(
(
wind_speed *
3600
)
/
1609.344
)
;
Serial
(
speed_mph
)
;
Serial
println
(
"mph"
)
;
// Test with a slowly changing value from a Sine function
//d += 4; if (d >= 360) d = 0;
// Set the the position, gap between meters, and inner radius of the meters
int
xpos
=
ypos
=
gap
=
radius
=
;
// Draw a large meter
xpos
=
/
ypos
=
gap
=
radius
=
;
//
In this tutorial, we will display wind speed on TFT Display using
ESP32 & Anemometer
. The project uses an embedded board that combines a
3.5” touchscreen display
and
ESP32-WROVER Module
with a built-in 2M pixel OV2640 camera. We will connect the
Anemometer Sensor
externally to the analog pin of ESP32.
An
anemometer
is a device used for measuring
wind speed
and
direction
. The anemometer sensor we are using here is the
Adafruit anemometer
. The Adafruit anemometer is capable of measuring wind speeds up to
70 m/s
or
156 mph
. The 3.5″ TFT Touch Screen Display uses an
ILI9488 TFT LCD Driver
. The screen resolution is
320×480
. There are multiple external pins to connect the ESP32 display with sensors/actuators. This is the reason they are suitable for various
IoT applications
We will now see how we can use the ESP32 TFT Display along with the Anemometer Sensor to create a beautiful dynamic
widget
. The wind speed in miles per hour will be displayed on TFT Display along with the alert level.
Bill of Materials
Following are the list of components that you need for making this project. You can purchase all these components online.
S.N.
Components
Quantity
Purchase Link
ESP32+TFT Touch Display
Makerfabs Link
Adafruit Anemometer Sensor
Adafruit
Type C USB Cable
Amazon
AliExpress
Connecting Wires
Amazon
AliExpress
ESP32 3.5″ TFT Touch(Capacitive) with Camera
This is a beautiful
3.5” touchscreen display
, based on
ESP32-WROVER chip
, with a built-in
2M pixel OV2640 camera
. The combination of all these gives a perfect platform for multiple ESP32 Applications & Projects.
The TFT LCD driver is basically
ILI9488
& has a dimension of
3.5″
with
320×480
screen resolution. The
ILI9488 LCD
uses SPI for communication with the ESP32 chip. The SPI main clock could be up to
60M~80M
, make the display smooth enough for videos.
While the camera is not used, you can freely use all these pins with the breakout connectors. You can then connect the ESP32 display with sensors or modules & use it for any
IoT applications
. The ESP32 chip support Arduino or MicroPython programming
The board is having a
micro SD-Card slot
for attaching an external SD-Card. The SD Card can be used for storing files and images. There is a
type C USB Port
, basically a USB to UART converter for ESP32 programming. You can connect a Type-C data cable to the board & directly upload the code to the Board.
Specification
1. 3.5 inch display,
320×480
2. Capacitive/Resistive Touch
3. ESP32-WROVER Controller
WIFI/ BLE
Connection.
5. Onboard USB2UART convertor for ESP32 programming
6. 2M pixel OV2640 Camera
OV2640
supports output images up to 2 million pixels
8. LCD 3.5-inch Amorphous-TFT-LCD for mobile-phone or handy electrical equipment
9. LCD Driver: ILI9488
10. LCD Resolution: 320*480
11. Micro SD card slot on the board
NS2009
: A 4-wire resistive touch screen control circuit
FT6236
: single-chip capacitive touch panel controller Integrated Circuit
14. Power supply:
5V
, Type-C USB
Check some of our previous projects using this TFT Touch Screen Display:
ESP32 TFT Touch Display Video Games
ESP32 TFT Touch & Camera Projects
Adafruit Anemometer Sensor
The
Adafruit Anemometer Sensor
is a Three-cup type anemometer that is capable of measuring wind speed up to
70m/s or 156mph
. It is composed of a shell, the wind cup, and the circuit module.
The sensor is supplied with a length of
3 core cables
and three connections. A
black wire
to power and signal ground, a
brown wire
for power which can be anything from
7-24v DC
, and a third
blue wire
that provides measurements via
analog voltage
. The output analog voltage will range from
0.4V (0 m/s wind)
up to
2.0V (for 32.4m/s wind)
To learn more in detail about this sensor, check our previous post related to Anemometer Sensor:
Anemometer Sensor Arduino Guide
. You may use
Ultrasonic Anemometer
if you don’t want movable parts.
Specifications
Voltage Required:
7-24v
DC
Output:
0.4V
to
2V
Testing Range:
0.5m/s
to
50m/s
Start wind speed:
0.2 m/s
Resolution:
0.1m/s
Accuracy: Worst case
1 meter/s
Max Wind Speed:
70m/s
Pin details: Pin 1 –
Power
(brown wire), Pin 2 –
Ground
(black wire), Pin 3 –
Signal
(blue wire)
Hardware Connections for ESP32 TFT Display with Anemometer
As TFT Touch Display and ESP32-Wrover Module are internally connected to the PCB, we only require Anemometer Sensor Connection. Connect the Anemometer Sensor as per the diagram below.
Connect the VCC and GND Pin of Anemometer Sensor to external 9V & GND. Connect the GND of the external power supply to the GND of ESP32. Similarly, connect the Anemometer input pin to GPIO35 of ESP32.
Installing TFT_eSPI Library to Arduino IDE
This is a TFT graphics library for Arduino processors with performance optimization for STM32, ESP8266 & ESP32. The library is targeted at 32-bit processors. It supports “Four wire” SPI and 8 bit parallel interfaces. The library supports some TFT displays with drivers for ILI9163, ILI9225, ILI9341, ILI9488, ST7735 etc.
You can download the library from the
Github
directory. But the library requires some modification for our project. So here is an edited version of the library. You can download and add it to the library folder.
Download:
TFT_eSPI Library
Source Code/program
The code part requires a file called Alert.h to create a warning signal on the TFT Display.
Main Code
Open Arduino IDE and create a new file and paste the following code. You can save it with any name but with .ino extension.
#include "alert.h" // Out of range alert icon
#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>
// Meter colour schemes
#define RED2RED 0
#define GREEN2GREEN 1
#define BLUE2BLUE 2
#define BLUE2RED 3
#define GREEN2RED 4
#define RED2GREEN 5
#define TFT_GREY 0x2104 // Dark grey 16 bit colour
TFT_eSPI
tft
=
TFT_eSPI
(
)
;
// Invoke custom library with default width and height
uint32_t
runTime
=
99999
;
// time for next update
int
d
=
;
// Variable used for the sinewave test waveform
boolean
range_error
=
;
void
setup
(
void
)
{
Serial
begin
(
115200
)
;
tft
begin
(
)
;
tft
setRotation
(
)
;
tft
fillScreen
(
TFT_BLACK
)
;
tft
setTextColor
(
TFT_WHITE
TFT_BLACK
)
;
tft
drawString
(
"Wind Speed"
)
;
}
void
loop
(
)
{
float
sensorValue
=
analogRead
(
)
;
float
voltage
=
(
sensorValue
/
4095
)
*
;
float
wind_speed
=
mapfloat
(
voltage
0.4
32.4
)
;
float
speed_mph
=
(
(
wind_speed *
3600
)
/
1609.344
)
;
Serial
(
speed_mph
)
;
Serial
println
(
"mph"
)
;
// Test with a slowly changing value from a Sine function
//d += 4; if (d >= 360) d = 0;
// Set the the position, gap between meters, and inner radius of the meters
int
xpos
=
ypos
=
gap
=
radius
=
;
// Draw a large meter
xpos
=
/
ypos
=
gap
=
radius
=
;
//
Technologies used
Hardware components
- ESP32
- ESP8266
- Arduino
- STM32
- SD Card
Software & tools
- Arduino IDE
- MicroPython
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.