The old solar panel died and was of poor quality. To remedy, a new solar light housing was repurposed. This new unit has improved water sealing, a larger solar panel with more output and better off axis performance.
Wouldn't it be nice to have your real world mailbox send you a notification every time you receive snail mail? If you answered "yes" then this project is for you.
This project explores low power modes of the Particle Photon, uses solar power, the Particle cloud, Thingspeak and IFTTT. Below is the notification your receive when the mailbox door opens.
The Photon can operate under 4mA when in sleep mode and wake from an interrupt. We use this to reduce power consumption and attempt to run the project off solar power.
The Particle's on-board regulator is capable of operating reliably down to 3.6V. This is close enough that directly powering the Photon from a LiPo battery is worth trying though not all of the LiPo capacity can be used.
To start, we used a simple low cost solar LED motion light (appx. $10). These lights typically use an 18650 style lithium battery, have a solar cell and are in a small enclosure that could be easily re-purposed for our application. The back of the light claims the battery has 1200mAh capacity.
For mail sensing, a magnetic reed switch was attached to mailbox door. Reed switches are passive devices. In this case we use a normally open switch. Though normally open, the switch makes contact when the door is shut.
The Particle Photon is programmed to wake up on door opening, in this case a falling edge trigger. That is, when the voltage on the Particle pin drops to zero, it wakes up, connects to WiFi and publishes the notification code. The Particle is unable to discern programmatically a timed wake-up or a interrupt wake-up.
In order to detect what interrupt woke the Particle, the Photon checks the door status input pin. If low, it creates a semaphore to publish a "you've-got-mail" message. System threading had to be enabled to get the Photon to capture the door state at wake-up. Discovering how to reliably detect the pin state on wake was the most difficult trick to figure out.
Since the Photon's time is synced with the internet, the payload of the publish message includes the current time stamp of the event. With IFTTT the notification is sent to the phone and also states the time for easy recollection of when your mail arrived even if the notification is delayed.
To build the circuit, the LEDS were completely removed and a trace cut on the PCB to isolate the IR sensor circuit from power. That said from reverse engineering the PCB, the only part used for charging appears to be an isolation diode.
Thingspeak was utilized to log the voltage, RSSI and mail trigger count notifications. The Particle was set to sleep for 30 minutes between forced voltage and RSSI updates. Thus, you can see if the system is alive and monitor battery voltage/signal strength.
The solar light was disassembled. Remove the LED and control board. A TP4056 Lipo charger was added. Connect the solar panel to the micro USB power. Connect the battery to the battery terminals. Then connect the output wires to the Vin on the photon. This controller automatically shuts off when the battery is too low and does not allow the battery to overcharge.
You must add your Thingspeak key to your Particle Photon code. Once this is done, the data will come across in order. This code supports 8 channels, though only 3 channels are being used.
Above is a screen capture from the first few days of testing. You can see the discharge and charge cycles. Overall on sunny days the solar power is able to sufficiently power the system. It appears the unit is transmitting voltage and RSSI properly at 30 minute intervals.
Will the little solar cell be enough? Lets do some quick analysis and calculations.
Based on a quick glance at the data, it appears that the solar cell will be adequate for this project. The Particle is stated to work above 3.6V. For LiPo batteries, this will allow usage of approx 90% of the charged capacity. The chart below depicts the typical discharge curve of a LiPo at low current. The Particle will be operating well below .2C (75ma/1200mah) so directly powering the Photon from the battery is a good power efficient option. We should be able to extract 90% of the battery power before the voltage gets too low. Below 3.6V the Photon will either shut down or be unstable.
The solar cell specs are unknown, but based on dimensions, it is estimated to output around 50mA at full sun.
This appears to be very similar to the cell on the light.
PV watts was used to estimate power output. PV watts uses your location and weather information to estimate solar system output. PV watts will not calculate for low wattage systems such as this at only 0.25W, so we told PV watts we have a .25KW system at our location. Divide by 1000, or change the units to watts from KW to estimate the power of this single cell. This shows about 20 watt hours per month minimum, or about .65 watt hours per day and 353 watts per year if mounted in an ideal location. This seems adequate for our sensor.
It is worth mentioning that this app or react would fail if we set to update on data update. I suspect there is a bug, but a 10 minute update rate is sufficient for our project.
Add the following IFTTT recipe to IFTTT to receive notifications on your devices.