Home > Power Circuits >Charging Circuits > How to design a solar detector using tilt sensors

How to design a solar detector using tilt sensors

Source: InternetPublisher:清宁时光 Keywords: detector tilt sensor Updated: 2023/12/25

The detector evaluates the likely magnitude of solar energy through the intensity of light in a given direction to efficiently charge the battery.

background

In order to use solar panels to charge batteries to run some devices in my home office, I placed the solar panels in the best possible locations based on my predictions without collecting reliable data. So I thought of a cheap and easy-to-use mechanism to determine the ideal location for charging a solar panel based on the intensity of light in a given direction. Since the energy produced by solar panels is closely related to the amount of solar radiation, I am able to use this device to charge my batteries more efficiently and sustainably. Therefore, I use the light intensity value as a proxy to approximate the magnitude of the solar energy. You can see the formula I used to calculate solar energy below.

After running the code to calculate the solar energy from the light intensity values ​​collected by the 10 mm photoresistor, I conducted experiments with the battery and solar panel to determine the thresholds for solar charging performance levels: low, medium, and high. Also, to show the performance level, I used different LED colors for each direction - red (low), yellow (medium), green (high).

Not surprisingly, it is crucial to position the device vertically to accurately detect light intensity, so I used a tilt sensor (mercury sensor) to check if the device moved to a tilted position. And, to notify the user when the device moves to a tilted position, I added a buzzer to the device.

After completing the design on a breadboard and testing the code, I designed a PCB with a unique circular shape (light intensity and solar detector with tilt sensor) to create a flexible and easy-to-use device that supports four orientations.

poYBAGJ4yFGATMOAAAQymUbP2jw443.png

Step 1: Design and Solder Light Intensity and Solar Detectors with Tilt Sensor PCB

pYYBAGJ4yE2AcWD8AAPlC7O6-3U077.png

First, by using a soldering iron, I connected the headers, 220Ω resistor, 1K resistor, 10mm photoresistor, power jack, 5mm red LED, 5mm yellow LED, 5mm green LED, buzzer and tilt sensor (mercury sensor).

Component list on PCB:

A1 (Arduino Nano connector)

P1, P2, P3, P4 (10mm photoresistor)

buzzer (buzzer)

Tilt sensor (tilt sensor)

R (5mm red LED)

Y (5mm yellow LED)

G (5mm green LED)

R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13 (220Ω resistor)

R14, R15, R16, R17, R18 (1K resistor)

J1 (power jack)

pYYBAGJ4yEmASqZFAAgkAPsp4y8907.png

poYBAGJ4yEWAQxWOAAOMFcETJsg093.png

Step 2: Calculate approximate solar energy

[ E = A * r * H * PR ] is the formula I use to approximate solar energy levels, where:

A is the area of ​​the solar panel,

r is efficiency,

H is the average solar radiation,

PR is the performance ratio or coefficient (generally 0.75).

// Define the solar panel (SP) specifications which differ amid different brands. So, change these variables with that of your solar panel.

#define SP_area 0.0088

#define SP_efficiency 6.2

#define SP_coefficient 0.75

float Solar_Panel_Energy(float Area, float Efficiency, int Radiation, float Coefficient) {

// Calculate the possible magnitude of solar energy by using the light intensity values ​​as a substitute for radiation.

float Energy = Area * Efficiency * Radiation * Coefficient;

return Energy;

}

Don’t forget to change the solar panel specifications – area, efficiency and performance ratio – which can vary depending on the solar panel brand.

To calculate the possible magnitude of solar energy, I use light intensity values ​​instead of solar radiation in the formula.

Of course, this method does not provide an accurate solar value, but an indicator that determines the threshold (low, medium, high) used to detect solar charging performance in a given direction.

Note: I determined the thresholds for each level by testing with my solar panel: I observed the time elapsed to fully charge a 3.7V lithium polymer battery at a given light intensity and estimated solar value.

Step 3: Program the Arduino Nano

Define indicators for each direction (red, yellow, green).

Define LDR pins for each direction to collect light intensity values.

Define the buzzer pin and tilt sensor pin.

Define solar panel (SP) specifications of different brands. So, change these variables with your solar panels.

Define thresholds experimentally.

In the get_Light_Intensity() function, light intensity data is collected from the photoresistor.

In the Tilt() function, you will be notified if the device moves to a tilted position.

Enable threshold detection (low, medium, high) for each direction.

In the Indicate_Thresholds() function:

Prints the selected direction and its solar value.

Adjust threshold indicators (LEDs) based on solar energy values ​​in each direction.

pYYBAGJ4yECAb4MGAALedrxiaNc971.png

poYBAGJ4yD2ADgV3AAFABE0pBRo748.png

Connect and adjust

// Connections

//Arduino Nano:

// direction_1_LOW

// D4 ---------------------------

// direction_1_MODERATE

// D3 ---------------------------

// direction_1_HIGH

// D2 ---------------------------

// direction_2_LOW

// D7 ---------------------------

// direction_2_MODERATE

// D6 ---------------------------

// direction_2_HIGH

// D5 ---------------------------

// direction_3_LOW

// D8 ---------------------------

// direction_3_MODERATE

// D9 ---------------------------

// direction_3_HIGH

// D10 ---------------------------

// direction_4_LOW

// D13 ---------------------------

// direction_4_MODERATE

// A4 ---------------------------

// direction_4_HIGH

// A5 ---------------------------

// Buzzer

// D11 ---------------------------

// Tilt Sensor

// D12 ---------------------------

// direction_1_LDR

// A0 ---------------------------

// direction_2_LDR

// A1 ---------------------------

// direction_3_LDR

// A2 ---------------------------

// direction_4_LDR

// A3 ---------------------------

Once you've finished and uploaded the code to the Arduino Nano, connect it to the board.

pYYBAGJ4yDaAfiFPAAQQZe2UbX8103.png

feature

1) Display estimated solar energy in each direction on serial monitor

poYBAGJ4yDOAFJpBAAIYPMeTCto287.png

2) For each direction, observe the performance of solar charging via metrics adjusted according to the solar threshold (level):

Red - low

Yellow - medium

green - high

poYBAGJ4yC6Afx-oAATsASe6hPk897.png

3) Finally you will be notified if the device is moved to a tilted position to use the vertical beam to charge the battery more efficiently.

pYYBAGJ4yCqAB6s3AAPMinl9V8A238.png

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号