How to connect solar panel to Arduino Uno board?

I have an Arduino sketch in which I receive data from a DHT22 sensor. If the temperature is higher than 22, a LED lights on and then is turned off after one second. Also, if the humidity is over 40, another LED turns on, and off after 1 second. At the moment, the arduino is connected to the laptop. I would need to connect a solar panel to the arduino, to see the leds turning on and off when the board isn't connected to the computer.
I have a solar panel which has an internal battery of 3.7V.
How could I connect the solar panel to the project?

I am also attaching the project code:

#define DHTPIN 3           // Analog Pin sensor is connected to
#include "DHT.h"
#define DHTTYPE DHT22  
DHT dht(DHTPIN, DHTTYPE);
int incomingByte;      // a variable to read incoming serial data into


void setup() {
  Serial.begin(9600);
    dht.begin();
  pinMode(4, OUTPUT);

  delay(500);               //Delay to let system boot
}

void loop() {
  read_temp_umid();
  if (Serial.available() > 0) {
    // read the oldest byte in the serial buffer:
    incomingByte = Serial.read();
    // if it's a capital H (ASCII 72), turn on the LED:
    if (incomingByte == 'H') {
      digitalWrite(4, HIGH);
    }
    // if it's an L (ASCII 76) turn off the LED:
    if (incomingByte == 'L') {
      digitalWrite(4, LOW);
    }
  }
  
}




void read_temp_umid()
{
    float temperature = dht.readTemperature();
    float humidity = dht.readHumidity();


     if(humidity >40 ) {
    digitalWrite(4, HIGH);

    delay(1000);
    digitalWrite(4, LOW); //turn LED LOW AFTER 1s


  // turn the ledPin ON
 } else {
   digitalWrite(4, LOW);   
  // turn the ledPin OFF
  }



  
     if(temperature >22 ) {
    digitalWrite(2, HIGH);   
            delay(1000);//turn LED LOW AFTER 1s
    digitalWrite(2, LOW);
  // turn the ledPin ON
 } else {
   digitalWrite(2, LOW);   
  // turn the ledPin OFF
  }



    String message = "temperatura ";
    String toprint = message + temperature +";" ;
    Serial.print(temperature);


    String message2 ="umiditate ";
    String toprint2 = message2 + humidity + ";";
    Serial.print(humidity);


    delay(1000);//read every second
}

I am also attaching the connections to the board:

The dht22 sensor is connected to the port 3 on arduino, while the LEDS to the 2 and 4 ports. I attached the VCC cable on the 3.3V of the Arduino.

we would need to understand exactly what this is.

Assuming you have a self contained device that can charge the battery and you have a 3.7V output (what power is available) ? then you need a boost converter to bring that up to 5V so that you can power your Arduino.

This is how the solar panel looks and its internal battery. Could I power the Arduino on the 3.3V with this solar panel and battery?


Arduino 5V device. Battery is less than 5V. Need a boost converter. I doubt the results will be up to par.

You need a lot more electronics: this 18650 Li-Ion cells don't like to be discharged under about 3V.. If you don't take precautions to discharge them further you will waste your battery very soon.
then a Li-Ion can be charged to about 4.2V. As a solarpanel is a currentsource you can get higher voltages. Maybe even enough to charge 2 of those 18650's in series.. which gives you a voltage of 6-8.4V.. This can be connected direct to the powerinput of the Arduino Uno.

definitely needs a boost converter and a link to the device would be useful.
for example, we don't know if you can charge at the same time you power something?

the solar panel is from a set of christmas leds; I connected it to the arduino board and it just lights up the "ON" led from the arduino board. Is it possible to power the arduino and to test the functionality of the board with this solar panel? Or else, how could I connect an additional 1.5V battery?

without the specs you just risk to fry your arduino... where did you connect it ?

on the GCC and with the minus and on the 3.3V with the plus from the solar panel

Is that a pin of your arduino?

yes, it is the ground on the left side:

I read GND not GCC :wink: ( the GNU Compiler Collection ??)

what the spec states about the 3.3V pin:

A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.

does not look like a power pin.... does it?

At a minimum the solar cell should be connected to a TP4056. Use a diode on the + side to prevent current backflow during nighttime use, into the solar cell and damaging the solar cell. Out of the TP4056 you'll need a boot converter to make 5V.

The TP4056 works great between 5 and 8 volts. I put 6V, when I tried this, worked well.

Such a set up will run the battery for about 4 months and then you'll need to replace the battery.

If you want to do it right, that's a different story.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.