We will learn how to power the ESP8266/ESP32 development boards with solar panels. We will use rechargeable batteries (or you can use a 18650 lithium battery) and the TP4056 battery charger module. You can use the circuit which we will build in this project with any microcontroller that is powered at 3.3V.
Tag: Project 111a Powering ESP8266/ESP32 development boards with solar panels. Acoptex.lt
- Sketch: None;
- Libraries: None;
- Other attachments: None.
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
2.Mini Solar Panel (5/6V 1.2W) 2 pcs
3.Lithium Li-ion battery 18650 1 pc or rechargeable batteries size AA 1900 mAh 1.2V 4 pcs
4.Battery holder (depends on which batteries in use) 1 pc
5.TP4056 Lithium Battery Charger Module 1pc
6.Low-dropout or LDO regulator (MCP1700-3302E) 1pc
7.100uF 16V electrolytic capacitor
8.100nF ceramic capacitor
9. Jumper wires
10. Voltage divider for battery monitor (optional) – Resistor 2 pcs
If you power your ESP8266/ESP32 with solar panels, it will be handy to use the deep sleep to save power.
- The solar panels output between 5VDC – 6VDC with direct sun.
- The solar panels will charge the lithium battery through the TP4056 battery charger module. It is not just charging the battery but prevent overcharging too.
- The lithium battery outputs around 4.2V when fully charged.
- We need to use a low dropout voltage regulator circuit (MCP1700-3302E) to get 3.3VDC output from the battery.
- ESP8266/ESP32 development board will be powered through the 3V3 (3V) pin.
Understanding the solar panels
The term solar panel is used colloquially for a photo-voltaic (PV) module.
A PV module is an assembly of photo-voltaic cells mounted in a frame work for installation. Photo-voltaic cells use sunlight as a source of energy and generate direct current electricity. A collection of PV modules is called a PV Panel, and a system of Panels is an Array. Arrays of a photovoltaic system supply solar electricity to electrical equipment.
Photovoltaic modules use light energy (photons) from the Sun to generate electricity through the photovoltaic effect. Most modules use wafer-based crystalline silicon cells or thin-film cells. The structural (load carrying) member of a module can be either the top layer or the back layer. Cells must be protected from mechanical damage and moisture. Most modules are rigid, but semi-flexible ones based on thin-film cells are also available. The cells are connected electrically in series, one to another to a desired voltage, and then in parallel to increase amperage. The wattage of the module is the mathematical product of the voltage and the amperage of the module. The manufacture specifications on solar panels are obtained under standard condition which is not the real operating condition the solar panels are expose to on the installation site.
A PV junction box is attached to the back of the solar panel and functions as its output interface. External connections for most photovoltaic modules use MC4 connectors to facilitate easy weatherproof connections to the rest of the system. A USB power interface can also be used.
Module electrical connections are made in series to achieve a desired output voltage or in parallel to provide a desired current capability (amperes) of the solar panel or the PV system. The conducting wires that take the current off the modules are sized according to the ampacity and may contain silver, copper or other non-magnetic conductive transition metals. Bypass diodes may be incorporated or used externally, in case of partial module shading, to maximize the output of module sections still illuminated.
Some special solar PV modules include concentrators in which light is focused by lenses or mirrors onto smaller cells. This enables the use of cells with a high cost per unit area (such as gallium arsenide) in a cost-effective way.
Solar panels also use metal frames consisting of racking components, brackets, reflector shapes, and troughs to better support the panel structure.
Mini solar panel applications:
- Suitable for Charging Cellphone and Small DC Batteries
- Build Your DIY Powered Models, Solar Display and Solar Toys
Mini solar panel specifications:
- Power: 0.18W / 1W
- Output voltage: 5VDC-6VDC
- Material: Monocrystalline Silicon
Understanding the TP4056 Lithium Battery Charger Module
The TP4056 module has a red LED when it’s charging the battery and a blue LED when the battery is fully charged.
You can read more about it here.
Understanding the low-dropout regulator (LDO)
A low-dropout or LDO regulator is a DC linear voltage regulator that can regulate the output voltage even when the supply voltage is very close to the output voltage. The advantages of a low dropout voltage regulator over other DC to DC regulators include the absence of switching noise (as no switching takes place), smaller device size (as neither large inductors nor transformers are needed), and greater design simplicity (usually consists of a reference, an amplifier, and a pass element). The disadvantage is that, unlike switching regulators, linear DC regulators must dissipate power, and thus heat, across the regulation device in order to regulate the output voltage.
You can use MCP1700-3302E or HT7333-A for this project. We use MCP1700-3302E here.
Please see the specification of MCP1700-3302E here. It has these features:
- Extremely Low Operating Current for Longer Battery Life (1.6 uA typical);
- Very Low Dropout Voltage (178 mV at full load);
- Rated 250mA Output Current;
- High Output Voltage Accuracy (±0.4% typical);
- Over-Current and Over-Temperature Protection;
- Pin Compatible Upgrade for Bipolar Regulators & TC55 with Vin Max <6V;
- Requires only 1 µF Ceramic Output Capacitance.
Understanding the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)
You can read more about it here.
Signals and connections of the MCP1700-3302E
- Ground – ground pin.
- Vin – voltage input pin.
- Vout – voltage output pin which outputs 3.3V VDC. It will power the ESP32 or ESP8266.
Signals and connections of the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)
- TX – transmit pin. GPIO pin
- RX – receive pin. GPIO pin
- 3V3 (or 3V or 3.3V)- power supply pin (3-3.6V).
- GND ( or G) – ground pin.
- RST – reset pin. Keep it on high (3.3V) for normal operation. Put it on 0V to reset the chip.
- EN – Chip enable. Keep it on high (3.3V) for normal operation.
- Vin – External power supply 5VDC.
- D0-D8 – GPIO (General Purpose Input Output) pins
- D5-D8 – SPI interface
- D1-D2– I²C/TWI Interface
- SC (or CMD) – (Chip Select) – the pin that the master can use to enable and disable specific devices. GPIO pin
- SO (or SDO) – Master In Slave Out (MISO) – SPI communication. The Slave line for sending data to the master. GPIO pin
- SK (or CLK) – SCK (Serial Clock) – SPI communication.The clock pulses which synchronize data transmission generated by the master. GPIO pin
- S1 (or SD1) – Master Out/Slave In (MOSI). SPI communication. The Master line for sending data to the peripherals. GPIO pin
- S2 (or SD2) – GPIO pin
- S3 (or SD3) – GPIO pin
- VU (or VUSB) – external power 5VDC.
- A0 – ADC output.
- RSV – reserved
Step by Step instruction
1.Wiring of solar panels
Solar panels electrical connections are made in series to achieve a desired output voltage or in parallel to provide a desired current capability (amperes). As we want our batteries to charge faster, so we will use two mini solar panels in parallel.
1.Solder the (+) terminal of the one solar panel to the (+) terminal of the other solar panel. Do the same with the (-) terminals. After wiring solar panels in parallel you will get the same output voltage, and double the current (for the solar panels of the same size and maker).
2.Do wiring of the solar panels to the TP4056 lithium battery charger module as shown above. Connect the positive terminals to the pad marked with IN+ and the negative terminals to the pad marked with IN-.
3.Connect the battery holder positive terminal to the B+ pad, and the battery holder negative terminal to the B- pad.
4.The OUT+ and OUT- are the battery outputs. To power the ESP8266/ESP32 module through its 3V3 pin, we need a voltage regulator circuit to get 3.3 VDC from the battery output. We can not use a typical linear voltage regulator to drop the voltage to 3.3V as when the battery discharges to 3.7V it will stop working due to a high cutoff voltage. We will use a low-dropout regulator (LDO) in our case. It can be MCP1700-3302E or HT7333-A. The LDO should have a ceramic capacitor and an electrolytic capacitor connected in parallel to GND and Vout to smooth the voltage peaks. Do not forget that electrolytic capacitors have polarity. The lead with the white/gray strip should be connected to GND.
5.Connect the Vout pin to the 3.3V pin of the ESP8266/ESP32 module and GND pin to GND pin.
6.If you have your ESP8266/ESP32 module powered with batteries or solar powered, it can be very useful to monitor the level of the battery. You can read the output voltage of the battery using an analog pin. The batteries we are using outputs more than 3.3 VDC so we need to add a voltage divider to protect the ESP8266/ESP32 module analog pin from excessive voltage. The voltage divider formula is as follows: Vout = (Vin*R2)/(R1+R2)
To get the battery level on ESP32 module, you can simply read the voltage, for example, on GPIO33 using the analogRead() function – analogRead(33). You can also use the map() function, to convert the analog values to a percentage: float batteryLevel = map(analogRead(33), 0.0f, 4095.0f, 0, 100);
To get the battery level on ESP8266 module use A0 pin – analogRead(0). You can also use the map() function, to convert the analog values to a percentage: float batteryLevel = map(analogRead(0), 0.0f, 4095.0f, 0, 100);
We have learnt how to power the ESP8266/ESP32 development boards with solar panels.
Check for more DIY projects here.