Solar powered NodeMCU & SDS011 dust sensor – Georgi's blog
Georgi's blog

Solar powered NodeMCU & SDS011 dust sensor


A year ago, when I decided to join the network (formerly, it turns out that first I had to solve a couple of problems. The design suggested by the community was not applicable for my environment by using such gray PVC elbows. Our flat has only a South – South-West view and using such housing for the sensor would lead to incorrect and elevated temperature readings because of the direct sunlight during the day. Second one was that it was almost impossible to power on the sensor as I would have to install more than 10 meters of cables between the power adapter and the setup (too many issues).

So, first problem was easy to solve. I just had to find a the right solar shield (Stevenson shield). This way I could garantее that all the readings form the temperature sensor will be real and will not be affected by the direct solar radiation. A week later and some time spent with the design software the shield was ready and I was good to go with the electronics setup. I will create separate post about the shield itself, as I think it could be helpful for others too.

Now to the subject. In order to solve my second problem I decided to go for a solar powered design. I found that a lot of people were very sceptic about such approach including people from the sensor community. My first step was to measure the power consumption from the NodeMCU with all sensors connected to it in a real operation mode. Fig.1 shows my current measurements in mA with reading period of 60 seconds for the SDS011 and Fig.2 shows single cycle from the same measurement.

Next, I had to calculate the effective or RMS current (I). I used the formula 1.4 for the root-mean-square or rms value of a time-varying quantity from Root Mean Square Value: So the following equation needs to be solved:

So I get for the RMS current 112.4 mA. My next step was to chose a decent battery that will keep the system running for at least a few days. My calculations sowed that having such a consumption with 10000 mAh battery the system should run theoretically for around 3 days and 17 hours. While I was looking for different Li-ion and Li-polymer pack I came to the idea to use some 10000 mAh power bank. So I bought a few Rivacase VA2037 10000mAh banks (Fig. 3), a cycle of fully discharge and fully charge one bank and then I started my tests.

As I expected initially the system run for about 3 and a half days in a row. Fig .3 shows the discharge curve of the same power bank after been working for half an year in outdoor environment and been exposed to negative temperatures (till -10°C) during the winter. The sensor was configured with “Measuring interval” set to 145 seconds which I believe is the value by default.

As you can see there is a degradation in the battery capacity and now it can sustain the same setup for about 2 days, 18 hours and 35 minutes. Not bad.

Then the need of solar panel came. Initially I tried to use one small 5W, 9V solar panel that I had on my shelf. By label it should be capable of supplying of 540mA. Which was not true unfortunately as the voltage dropped too low. Still after the Buck convertor I could read some 500mA @5V Exit running in at almost short circuit mode for the panel :).

Then I decided to buy a second panel and connect both in series in order to get higher voltage before the Buck converter. By the way the converter was included with the panel. It was using HC8816 (?) finding information of which I found to be very difficult. Yet there was some here.

From the link above it become clear that this IC is capable of delivering 2.1A @5V at the output having input rated from 4.75V to 30V. Which should be more than enough for the purpose of the project. Just one clarification – by some reason the Chinese guys has decided to use standard USB A plug for the input of the down converter board (LOL). On the pictures above the outputs are where the cables are (1 x 9V directly from the panel & 1 x 5V). Anyway it works I must admit.

So, I’ve build my own solar frame using two of those 5W solar panels.

Now having everything connected it was time to test it outside on my balcony. And there was a surprise. Fist discharge cycle went well, then on the 4th day the charging cycle came in to place. Unfortunately the sunlight form a single day was not enough with this particular setup to recharge the Li-polymer battery inside the power bank. Still the system continued its work during the night and on the next day the charging sequence started again. But it started almost from fully discharged battery. And when the sun goes down later afternoon the battery was charged till only 3.8V. Which was just enough to keep the sensors running till the next day. As you already suspected that very next day was cloudy. So bad luck. The battery went empty at some point of time. Which led me to try the system using a wall power adapter to recharge the power bank. It took some time before the battery was fully charged again and that was the time for the second surprise. It turns out the electronics inside the power bank wasn’t designed to run in a UPS mode so at the end of the charging process the 5V output was turned off. Then It goes back on for a second, then again back off and so on, and so on. The only way to make it running normally again was to unplug the power adapter from the power bank. Unfortune situation, indeed.

At that very moment I decided to open the case of the power bank and check with what am I dealing inside the box.

As it is seen from the pictures above the power bank is built using fully-integrated multi-function power management SoC IP5306 (U1) and the protection IC XB7608A (U2). There is not much that could be done here. So I came up with the idea to use a separate battery protection module for the charging process while keep using the existing boost converter form the power bank. I had a few TP4055 based modules around so a my next step was to insert one of these between the Li-polymer battery and the converting board.

As I expected this solve the problem. Now this power bank was working exactly as an UPS having uninterrupted both charging and power supplying the sensors simultaneously. There was just one drawback. This TP4056 board has limited to maximum charge current of 1000mA (by design). Here you can find more detailed information about how exactly this particular module operates while in the same time the IP5360 is capable of charging at 2100mA. Well that will be a task for some other time.

With some more time spent on having the bracket for the NodeMCU and the power bank printed everything was ready to be placed outside on a rod.

And here are some readings from the sensor from the first week of February, 2021. All empty spaces are because of lack of capability to fully charge the battery during the day – winter sun was too low and it was helping only for a couple of hours during midday, not to mention the clouds.

So my next goal will be with a bigger solar panel that I expect to receive soon. So the story will continue very soon. As to the Solar shield that I’ve build I’ll dedicate separate post about it in particular.

I hope that was helpful. I’m sure the setup can be improved in many ways. So don’t hesitate to place a comment or to get into discussion about it.

Update (24th of November, 2021):

If you’re interesting in the code changes that I’ve made to the original firmware you can check my repository at There s a discussion board open as well so feel free to comment, argue or add suggestions :)