Overview
Finding the perfect spot in your yard for a new plant can be tricky. Does a nursery tag's "partial shade" mean harsh morning sun, or dappled light all day? Instead of guessing and risking your new greenery, you can build a simple, battery-powered data logger to measure the exact light levels (lux) in any spot in your garden over time.
By combining an Adafruit ESP32-S2 Feather with a highly accurate VEML7700 Lux sensor and a LiPo battery, you can track the sun's path and intensity throughout the day. To keep it weather-resistant outside without firing up a 3D printer or buying a specialized enclosure, the whole setup slips perfectly into a standard clear Rubbermaid food storage container straight from your kitchen.
Using Adafruit IO and a bit of code to manage power, this guide will show you how to log environmental data straight to the cloud. Best of all, there's zero soldering required thanks to the plug-and-play STEMMA QT system.
Using AI to help you pick the right plant (optional)
Once you’ve logged a few days or weeks of sunlight data, Adafruit IO allows you to easily export your history as a simple CSV file. You can then take this raw data and feed it into your favorite AI to act as a virtual master gardener. Just provide your downloaded light readings alongside your specific USDA hardiness zone (like my chilly Zone 4 or 5). The AI can analyze the exact peak sun hours and lux intensity of your garden's microclimate to generate a list of vegetables or perennials that would grow well in that exact spot.
How it works
This project relies on the power of Adafruit IO to log your garden's ambient light data, and custom code to keep your hardware running as efficiently as possible. The ESP32-S2 Feather wakes up at a set interval, connects to your home WiFi, reads the light levels from the VEML7700 sensor over a simple STEMMA QT cable, and sends that data directly to an Adafruit IO Dashboard before going back to sleep.
Placed in its clear, water-resistant Rubbermaid housing, it can safely sit in the dirt among your garden beds. You can then log into Adafruit IO to view a beautiful, continuous graph of your yard's sunlight over days or weeks, making it perfectly clear whether that corner is meant for sun-loving tomatoes or shade-tolerant hostas.
Deep Sleep?
When running a project on battery power outdoors, energy efficiency is critical. If the microcontroller and WiFi radio run continuously, a standard LiPo battery would drain in a matter of hours. By writing code that utilizes CircuitPython's deep sleep mode, the board essentially powers down between readings. It only wakes up for a few seconds to take a lux measurement and transmit it via WiFi. This software trick extends your battery life from hours to weeks, giving you long-term environmental data without constant recharging.
Either of the below batteries will work. Because we put this device into deep sleep, it really doesn't consume that much power. If you are doing a shorter test you can get away with an even smaller capacity battery.
Page last edited June 17, 2026
Text editor powered by tinymce.