Arduino Solar Panel: Connecting the Arduino to Solar Power
Arduino is a single-board microcontroller kit that’s used to build digital devices. At this point, it may seem like there’s no relation between solar panels and an Arduino board, but there is a way to solar power an Arduino. In certain countries where agriculture is the mainstay of the economy, people take news regarding weather predictions very seriously. However, the problem with this is that such weather forecasts are not accurate for remote areas far from weather forecasting stations.
To remedy this, farmers should have their weather forecasting stations. They consist of a couple of parts – the transmitter and receiver modules. The former is placed outside, where it measures the temperature and sends the readings via the RF transmitter to the other module. The latter is placed indoors, and its display unit shows the readings that the transmitter module sent. Both modules are powered by Arduino.
Where the solar panel comes in is the Arduino power consumption. An option would have been connecting the sensor to a wall socket via a cable, but that’s far from recommended. So, other options have to be considered to keep the module running and continuously send in feeds about the weather. A better option will be connecting the battery to the Arduino Uno. Still, it will be a short while before it’s depleted because the power led, USB interfacing chip and output voltage regulator will constantly draw power from the battery. This is why you need a rechargeable battery; this is where the solar panel comes in. You can also put the device on sleep mode if you want to reduce power consumption.
Why Use Solar Power to Power Arduino?
Owing to the fact that Arduino depletes the battery charge over time and needs to stay powered to function, renewable energy is the best bet to compensate for the power consumption. Solar power is cost-effective, easily accessible, and can be installed yourself if you have a rudimentary knowledge of electrical wiring. The solar cell in the panel trap energy from sunlight and converts it to electricity.
To ensure the battery doesn’t run out of juice, we recommend using a lithium-ion battery or nickel metal hydride battery.
To charge the latter, you should use the C/10 rule. This means charging at a capacity of 1/10th of its rated battery voltage. This equates to a charging duration of 16 hours. Considering that there’s an average of four hours of sunlight daily, charging the battery pack will take four days.
Let’s give you an example of the C/10 rule. Let’s use the 2xAA–sized 1300mAh battery capacity, for example. It has a rating of 1.2V per cell. This translates to a voltage output of 2.4V and 1300mAh. Since we’re applying the C/10 rule, that will be 1300mAh/10 = 130mAh. To charge this battery capacity, you’ll need a power output of 2.4-3V and, at most 130mAh. You can use a higher capacity than 130mAH, but while it will charge your Ni Mh or lithium-ion batteries faster, it will reduce their lifespan.
Before we dive into the process of using solar power to run the Arduino Uno, you should know the materials or tools you need to purchase.
Materials Needed for Connecting the Arduino to Solar Power
- Arduino Uno
- Arduino Nano
- 20×4 LCD display
- DHT11
- LCD I2C module
- Battery Holder
- 3.7 V Li-Ion Battery /2 AA Ni Mh Rechargeable Battery
- Solar Panel
- RF transmitter-Receiver pair
- Boost Converter
- Diode -IN4007
- Bread Board
- Li-Ion Battery charging board
- Jumper wires/Wires
- Scotch mounting pad and tap
- 22 AWG solid core wire ( for making antenna)
- Resistor 10K
- Glue gun
- Drill
- Soldering Iron and solder
- Hobby Knife
- Wire cutter/Stripper
Step-By-Step Process
Phase 1: Choosing the Most Suitable Solar Panel to Charge Arduino
How do you know the right solar panel voltage to keep the Arduino boards working simultaneously and adequately recharge the battery packs during peak sunlight hours? Let’s show you.
Firstly, the voltage of the solar panel should be the battery voltage multiplied by 1.5. Secondly, add the power consumption of Arduino and the PV charging current. To calculate the solar panel capacity, you need the following:
Since it has been established that the battery pack contains a pair of lithium-ion batteries or AA Ni Mh batteries and that’s an output of 2.4V
To choose the right solar panel, simply multiply the voltage (2.4V) x 1.5. This will give you 3.6V. Let’s round it up, and that’s 4V for the solar panel.
For the second calculation, let’s assume that the Arduino board consumes a current of 100mAh and it’s powered by a battery pack of 1300mAh. With C/10, that’s 130mAh, as we’ve determined earlier.
So the solar panel should be able to provide a PV current of 100mAh to power the board and a maximum power of 130 mAh to charge the battery. Let’s go with 120 mAh for the battery.
That’s 100mAh+120mAh = 220mAh. So, you’ll need a panel with solar cells that can give an output of 220mAh and 4V to get the job done.
Just in case you need to use a bigger panel, let us give you the compatible requirements for the panel and battery.
- 1.2 V (battery) = 2V (min) -2.5V (max)
- 2.4V (battery) = 3.5V (min) -4V (max)
- 3.6V (battery) = 5V (min) -6V (max)
- 6V (battery) = 7.5V (min) – 9V (max)
- 12V (battery) = 15V (min) – 18V(max)
Phase 2: Arduino Charging With the Battery Packs
Nickel Metal Hydride Battery
To use this rechargeable battery to provide juice for the board, you need about 5 volts of electric power. There are two ways to achieve that – a 4 AA battery pack or a 2 AA battery pack. Since it’s 1.2V per cell, the former will give a total voltage of 4.8V nominally, but in reality, it will exceed 5V when fully charged. We donned this for stability and long battery life.
On the other hand, the smaller battery pack will give you a total voltage of 2.4V which will be raised to 5V with the aid of a booster circuit. This is what we recommend.
To build a charging circuit for this battery, you’ll need the solar panel, the battery holder, batteries, wires, and the diode.
To make the charging circuit for the 4 AA battery pack:
- Use a solder to join the panel’s positive terminal to the corresponding terminal on the diode
- Then, connect the diode’s negative terminal to the battery’s positive terminal
- Finally, attach the panel’s negative terminal to the corresponding terminal on the battery.
For the 2 AA battery pack:
We’ll need a boost converter (also called the DC converter) for this because it steps up the current and gives the battery a bigger output voltage than the input voltage it gets. The boost converter should have specifications like:
- USB port
- Maximum transfer efficiency of 96%
- An input voltage that ranges between 0.9-5V of direct current
- A functional indicator light
- The batteries output ranges from 500-600mA
For the charge circuit:
- Use solder to attach the boost converter’s positive terminal to the corresponding terminal of the battery
- Repeat the same process for the negative terminals.
Lithium Battery
With this battery, it’s very important to have a stable charging voltage because of its reactive elements. However, with a solar charge controller, you don’t need to worry about this because the charge controller functions as a voltage regulator.
The Li-ion battery charging board should have specifications like the following:
- Charge accuracy – 1.5%
- Current adjustability: 1A
- Working temperature range; -10 – +85°C
- Input terminal: mini-USB
- LED light charging indicator – red (for charging) and blue (for charge completion)
- Input voltage range: 4.5-5.5V
- The voltage at full charge: 4.2V
To make the circuit connection with this battery:
- Use solder to attach the positive input terminals of both the battery holder and boost converter to the BAT+ of the charging board.
- Repeat the same process with the negative input terminals and the BAT- of the charging board.
- The output ports of the boost converter are in the USB terminal.
- Solder a red wire to the positive side (+) at the rear of the converter and join the black wire with the negative side (-).
Phase 3: Connect Your Transmitter
The transmitter device is made up of the DHT11 sensor, a useful solution for temperature and humidity measurement. You can also purchase a rainfall sensor and a Barometric Pressure Sensor. While the sensor reads the weather, it’s powered by Arduino, and this data is sent through the transmitter.
To connect the DHT 11, know where each of its four pins should go to.
- 1st pin is VCC
- 2nd pin is Data
- 3rd pin is NC
- 4th pin is GND
To connect the sensor to the Arduino powering it, do the following:
- Connect the VCC to 5V
- Connect the Data to D8
- Connect NC to No connection
- Connect GND to GND
- Then, the 10k resistor should be at the middle of the VCC and the data pin of the DHT11 sensor.
The next step is connecting the transmitter module to Arduino. The transmitter has three pins: VCC, Data, and GND.
- Connect the VCC to 5V.
- Connect the Data to D11
- Connect GND to GND
- Attach an antenna to the transmitter module to increase its coverage.
Phase 4: Constructing an Enclosure for the Transmitter Module
- A plastic box can be used for the enclosure
- Create a hole at the upper side of the box for placing the wires from the panel.
- Create small holes at the side of the box for ventilation
- Insert the circuit in the box
- Bring out the negative and positive wires in the battery charger
- Attach the panel’s positive terminal to the diode’s positive terminal
- Then, connect the diode’s negative terminal to the red wire taken out from the battery charger.
- Join the negative cable to the negative terminal of the panel.
- Get a Scotch mounting pad to hold the panel and battery holder.
- Connect the positive and negative terminals in the boost converter to the (+) and (-) of the breadboard circuit, respectively.
- Test it by exposing the panel to sunlight; the red light in every board should glow.
Phase 5: Connecting the Receiver
This module displays the weather readings via a 20×4 ICD or a 16×2 ICD. We recommend adding a 12IC LCD to reduce the quantity of connections you’ll need. It has four pins, namely GND, VCC, SDA, and SCL.
To connect the LCD to Arduino;
- Connect GND to GND
- Connect VCC to 5V
- Connect SDA to A4
- Connect SCL to A5
To connect the receiver module to Arduino:
- Connect VCC to 5V
- Connect Data to D11
- Connect GND to GND
Phase 6: Construct an Enclosure for the Receiver Module
- Get a cardboard box.
- Use a marker or pencil to draw an outline for the LCD display.
- Use the hobby knife to cut the marked area.
- Place the LCD display into the marked area.
- Use the glue gun to add some glue to the rear of the display to secure it in place.
- Then insert the breadboard circuit you prepared earlier when making an enclosure for the transmitter module.
- Create a hole at the back of the box for placing the DC adapter cable inside. This cable is responsible for powering the Arduino Uno.
Phase 7: Optimize Power Via Sleep Mode
Since the weather doesn’t change constantly but at intervals, you can put your device on sleep modes to enhance its power management. When a high amount of charging current isn’t drawn from the power source, the device can operate for a long period (we’re talking about several months). You can activate sleep modes by downloading a library that enables power-down modes. This enables remote monitoring because you can regulate the sleep duration of the device with the timer. A good example is the LowPower Library.
Follow the steps below:
- Visit GitHub to download the tool.
- Move the file to the folder named Arduino library on your PC
- Import the Arduino library in a code – LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF)
- Check out Lightweight Low Power Arduino Library for more information on the codes.
Prior to using the library to optimize power consumption, the Arduino board will draw 51.7mA if the display is on and 47mA if it’s off. However, after usage, it will reduce to 34.93mA if the display is on and 31.73mA if it’s off.
Considering Power-Saving Alternatives
The simplest way to ensure power management in the Arduino board is to bypass the voltage regulator. To do this, purchase a boost regulator circuit. Then, join its output terminal to the 5-volt pin (vin-pin). This helps to bypass the regulator on the board. You should also deactivate any unnecessary LED indicators. Lastly, consider using a Barebones board rather than Arduino.