Adding MQTT To A Solar Powered PIR Light

The size and price of the ESP wifi modules have quickly made them into one of the preferred building blocks for IoT devices. Unfortunately they are not particularly well suited for very low power applications.  [LittlePetieWheat] wanted to add MQTT to a cheap PIR solar light, so he paired an ESP with an Attiny85 to hold it to a strict power budget.

Most of these lights contain some sort of no-name microcontroller that monitors the analog PIR sensor, and turns on the LEDs as required. [LittlePetieWheat] replaced the PIR sensor with one that gives a digital output for simpler interfacing. The Attiny serves as the low power brains of the project. Its tasks include reading the solar panel and battery voltages, and PIR output. When movement is detected by the sensor, it activates a clever little latching power circuit to power on the ESP01 just long enough to send a MQTT message. The LEDs are only turned on if there is no power coming from the solar panel. The solar power is stored in a 18650 battery.

The Attiny85 might not be a powerhouse, but it is perfect for simple, low power applications like this. We’ve also seen it pushed to its limits by running tiny machine learning models, or receiving software updates over I2C.

10 thoughts on “Adding MQTT To A Solar Powered PIR Light

  1. Solar heat and flags of plastic sticky tape. What could go wrong? Fourth of July flag waving with fireworks! At least a sticky black mess if ever opened again.

    1. The point is to save power. The attiny runs all the time but drawing very little current. When it detects motion it powers on the esp to do the networking stuff then shuts it down again. The attiny draws far less current than the esp would do if it was monitoring the pir

Leave a Reply to Colin MallettCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.