I wanted to create a post to explain all the steps involved in a "small" project because I think that it is rarely explained this way.
This story start with a similar project that I already created and that was up and running since may 2019. This project is outside, reliably posting data on the cloud since but it was powered by an external power supply and I wanted to revisit this project with a battery approach in mind.
This time, I wanted to create the same project but using Solar Energy
The DesignI decided to use an ESP-07 as my micro-controller instead of a Wemos.
But this board has no pins so, my first challenge was to be able to build my circuit using a standard breadboard.
I had to create a small breakout board for that purpose (I know, I could have bought a board but I decided to build mine by myself). I used my CNC and created this breakout board
Once the breakout board was created, I was able to plug it on a bread board to create my electronic circuit.
Here is my circuit on a breadboard
You can see the small breakout board that I made and the Node MCU on the side. The ESP-07 do not have any USB to Serial interface so I had to use another approach. I use the Node MCU to program the ESP-07.
I based this idea on a video that I found on Brian Lough's YouTube channel. this link brings you to the video that I used to build my board. Its a GREAT video and the explanation is clear and simple to understand.
Go and check this video
The new challenge was to install the Node MCU on a breakout board so I can upload a new sketch on the ESP-07 once it is soldered on a board.
To do this, I used 6 external pins as you can see in this image:
The pins are:
- VCC and GND
- TX and RX
- GPIO 0 and RST
Then I had to create another breakout board, this time, the purpose was to use a NodeMCU to reprogram the ESP-07 or ESP-12 after the circuit was complete. I create this breakout board
This out of the way, I was able to create the main circuit.
Here is an image of the circuit:
I have a couple of arrows because I wanted to explain certain details
Board DetailsElement 1: On the left, the breakout board used for the "Power Management" of the solar panel and the battery is the TP4056. (ref: https://www.best-microcontroller-projects.com/tp4056.html). In the technical details, we can see that the R3 can be changed to control the current used to recharge the battery.
Because the battery that I use is a 400 mah Lithium Ion, I had to change the resistor for a 3K resistor as you can see in the next image.
Finally, as you can also see in the image, I overlapped the TP4056 over my personal board but before, I soldered 4 surface mount resistors that are now, in sandwich between the TP4056 and the main board. in the next image, you can see the footprint of the TP4056 that overlaps the 4 resistors
Element 2: At the top of the image, there is an MCP-1701A chip. this is an LDO voltage regulator that takes the voltage from the battery and regulates it at 3.3v with a couple of micro-amp of consumption when not used.
Element 3: The voltage divider identified is calculated to allow a max of 1v in in the ADC when the battery reaches 4.2v ... fully charged.
Element 4: At the lower left, we have the micro-switch that I use to change to boot up mode from :configuration to web client
Element 5: At the bottom, another voltage divider, this time, used to "read the LED". When the TP-4056 charges the battery, a small red led is lid. I planned soldering a wire to get this information and post 1 when the battery is charging. in that version of the project, this pin is not used.
Element 6: The last part, at the right, is the famous BME280. A great mini I2C temperature-humidity-pressure sensor that I love.
The Solar PowerThe power comes from 2 5 volts small solar panels, plugged in parallel, that I placed on each side of the existing enclosure at around 15 degree angle.
Because of the snow, here in Quebec, I am not able to use 45 degrees, witch could be better, because the snow would have been able to pile up and block more light.
Once my board was received, I soldered all the components and uploaded my sketch, did many tests and the results was good enough so I started to design the parts that will allow me to insert this board into the existing enclosure.
Obviously, I ran many tests outside, on a breadboard then all soldered, for many weeks, and the behaviour was exactly as expected.
The result is, "A Dashboard" just like I wanted. I live in Quebec and we are in the winter season. As you can see in the image, it is actually -20.69 outside but, the temperature dropped around -25 at 7 am this morning. Now it is sunny (check the KPA measure of the barometric pressure :-) ) and you can see that the battery voltage is raising.
I use https://io.adafruit.com/ as my MQTT main website for a couple of years now ant it is a great solution for that kind of project.
Note: the voltage is not 100% accurate, I use the internal ADC to calculate the voltage but I noticed the the accuracy change with the temperature. It is good enough for me, I want to see the voltage trend rather than a precision voltage measure.
YouTube video for that projectIf you want to see the 3D print, the montage and more, please check my YouTube video
ConclusionNow that the project is finished and working, I am so satisfied that I intend to make more "battery powered" devices.
Sorry if I don't share my STL, Schema and sketch, this post was more of an overview of a project than a detailed solution to build "this".
Comments