Use a motion sensor—usually a PIR module—to wake an ESP32 when someone moves through its field of view. The sensor detects motion, not how far away a person is. A practical build shows cached weather immediately, reconnects to Wi-Fi to refresh the forecast, then dims the screen or returns to sleep.
How the display works
The project has four jobs: detect movement, wake the ESP32, show weather, and reduce power use while the room is empty. After a motion trigger, firmware can initialize the display and show the last saved weather values while it reconnects and requests an update. A separate timer wake can refresh the cache periodically, even if nobody enters the sensor’s view.
- Motion: A PIR sensor signals a change in infrared radiation within its coverage area.
- Wake: The ESP32 resumes from light-sleep or starts again after deep-sleep, depending on the chosen mode.
- Immediate display: Show cached data so the screen need not wait for Wi-Fi.
- Refresh: Reconnect to the network, request weather for the configured location, and display the new values and update time.
- Idle: Dim or turn off a backlit display, or put the board back into an appropriate sleep mode.
The actual wake-to-display time depends on the selected board, sensor, display, and firmware; no published measurement establishes a response time for this particular combination.
Choose the sleep mode before wiring
Light-sleep and deep-sleep have different state-retention and wake behavior. Neither maintains Wi-Fi or Bluetooth connections. Espressif states: “Wi-Fi and Bluetooth connections are not maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.” See the ESP-IDF Sleep Modes documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- ESP32 is a safe, reliable, and scalable to a variety of applications
| Mode | What happens | What your firmware must do |
|---|---|---|
| Light-sleep | CPU and peripheral state is preserved when the chip wakes. | Resume work after wake and reconnect to Wi-Fi before requesting fresh data. |
| Deep-sleep | The CPU, most RAM, and many digital peripherals are powered down. Wake restarts through the boot process. | Reinitialize the display and other needed peripherals, reconnect to Wi-Fi, and restore any required values from persistent storage. |
Choose light-sleep when retaining state and a simpler resume path matter. Choose deep-sleep when its greater power-down is worth handling a restart and rebuilding the display and network state. Do not assume one mode always gives better battery life: the board regulator, sensor, display, and firmware all affect actual consumption, and a comparable runtime for this complete project has not been established.
Select a board and a valid wake input
Identify the exact ESP32 chip on your development board before choosing a GPIO. Supported wake sources and pins vary by chip target and configuration; a pin printed on the board is not automatically a valid deep-sleep wake pin. Espressif documents the relevant constraints in its sleep-mode reference and GPIO documentation. In particular, deep-sleep GPIO wake is limited to appropriate power-domain pins on supported targets, while EXT0 and EXT1 have RTC GPIO requirements. Check the documentation for your chip and configuration, then confirm that the required pin is actually exposed on your board.
Rank #2
- Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
- Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
- Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
- USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
- Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision
- Check the chip target and the wake method supported by the firmware framework you use.
- Confirm the chosen input is available for that wake method and is not already needed by the display or another peripheral.
- Check whether the display bus, regulator, and sensor remain powered in the selected sleep mode.
Connect and position a PIR motion sensor
A PIR module is a straightforward way to detect someone entering or moving through a room. Its digital output reports motion; it does not provide a person’s distance. Pets can also trigger it. Adafruit’s PIR sensor guide explains the detection principle and notes that characteristics and adjustments vary by module.
- Check electrical compatibility. Read the module’s output-voltage specification and ensure its output is safe for the ESP32 input. Do not assume every PIR module uses the same voltage.
- Choose the wake pin and trigger polarity. Wire the module’s digital output to a supported wake input. Configure the firmware for the signal level that represents a trigger for your module.
- Make the idle signal stable. Confirm the input rests at a defined level before sleep. Espressif warns that floating or unconnected wake inputs can cause inadvertent wake triggers.
- Aim for the approach path. Place the sensor so a person moving into the room crosses its field of view. Adjust module sensitivity and output hold time if those controls are available.
- Test the empty-room behavior. Leave the room empty and check whether the sensor stops retriggering. Reposition or tune it if pets, movement outside the intended area, or repeated triggers keep the display awake.
If the requirement is to wake only within a precise distance, a PIR sensor is the wrong kind of measurement: its motion signal does not report range. Choose a sensor designed to measure distance instead, and verify its interface and wake strategy separately.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
- Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
- Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
- Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
- Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.
Choose a display for viewing and power needs
E-paper and actively lit displays can both work, but their trade-offs differ. E-paper can remain readable without continuous backlighting, while refresh behavior and display-driver support still matter. A backlit screen can be easy to read in low light, but leaving it illuminated has a power cost. Wiring, the board’s available display interface, and what remains powered during sleep also affect the choice.
| Display approach | Useful when | Check before building |
|---|---|---|
| E-paper | You want a screen that remains visible without a continuously lit backlight. | Refresh behavior, supported driver, wiring, and whether the panel or controller has any sleep-power requirements. |
| Backlit display | You want an actively lit screen, particularly in a dim room. | How to switch off or dim the backlight while idle, plus bus compatibility and power use. |
Adafruit documents an ESP32-S2 e-ink weather display as a relevant implementation example. An integrated display board may simplify wiring, but check whether it exposes a compatible wake input or lets the sensor signal reach an appropriate pin.
Rank #4
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters
Fetch weather for a configured location
Use latitude and longitude to request conditions for the intended location. Open-Meteo documents current temperature, apparent temperature, precipitation, weather code, and wind, along with hourly forecast fields. Its documentation says current conditions are based on 15-minute weather-model data; they are not an instantaneous measurement from a thermometer beside the display. See the Open-Meteo API documentation.
Show the time of the latest successful update so readers can distinguish a fresh response from cached information. Handle network or API failures by keeping the last usable values and indicating when they were updated, rather than replacing them with blank or misleading data. An Adafruit ESP32-S2 weather-display example demonstrates requesting Open-Meteo data with configured coordinates.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Best Value
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Ultra-Low power consumption, works perfectly with the Arduino IDE
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- ESP32 is a safe, reliable, and scalable to a variety of applications
Put the wake, refresh, and idle behavior together
Structure the firmware around a clear sequence rather than making the motion event wait for a network request before giving feedback.
- On startup or timer wake, initialize the sensor and display, load the last saved weather values, and refresh them if the network is available.
- Before sleeping, set the PIR input’s wake configuration and verify its idle level. Save any values that must survive a deep-sleep restart.
- On motion wake, initialize the display if the chip restarted, show the cached values, then connect to Wi-Fi and request updated weather.
- On request success, update the displayed fields and timestamp, then save the new cache if it must survive deep-sleep.
- On request failure, retain the previous values and make their age clear on screen.
- After the room is idle, dim or switch off a backlight if applicable, then return to the selected sleep mode. A timer wake can maintain the cache on a schedule independent of motion.
Keep the weather display honest about what it shows: model-based conditions for a configured location, with a timestamp, rather than a live local sensor reading unless you add an actual thermometer.
Quick Recap
Tune and troubleshoot the finished build
- It wakes immediately or repeatedly: Check for a floating input, wrong trigger polarity, an unstable idle level, or movement within the sensor’s field of view.
- It never wakes: Verify that the selected GPIO supports the exact wake source on the exact chip target, that the module output reaches the expected logic level, and that the firmware is waiting for the correct polarity.
- The display stays blank after deep-sleep: Treat wake as a restart and initialize the display and its bus again before drawing.
- Weather does not update: Check Wi-Fi availability, configured coordinates, request handling, and the last-success timestamp. Continue displaying cached information when the request fails.
- Battery runtime is disappointing: Measure the assembled board in its actual sleep and wake cycle. The board regulator, sensor, display, and frequency of triggers can change consumption, so no generic battery-life number is reliable for every build.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

