0% found this document useful (0 votes)
22 views11 pages

Sumanth Mi MPC Lab

The document outlines an experiment to design and implement a solar panel monitoring system using an Arduino platform, which measures voltage, current, and power output. Key components include a solar panel, Arduino Uno, ACS712 current sensor, LM044L voltage sensor, and an LCD display for real-time data visualization. The procedure involves assembling the components, programming the Arduino, and testing the system under various light conditions to collect data.

Uploaded by

bluewear333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views11 pages

Sumanth Mi MPC Lab

The document outlines an experiment to design and implement a solar panel monitoring system using an Arduino platform, which measures voltage, current, and power output. Key components include a solar panel, Arduino Uno, ACS712 current sensor, LM044L voltage sensor, and an LCD display for real-time data visualization. The procedure involves assembling the components, programming the Arduino, and testing the system under various light conditions to collect data.

Uploaded by

bluewear333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

GURU GASIDAS VISWAVIDYALAYA-

CG,BILASPUR

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING
MICROPROCESSOR AND MICROCONTROLLER

SUBMITTED BY :
P . Sumanth
SUBMITTED TO: 22030144
RAJIV DEY B.Tech (ECE)5th Sem
Objective

The objective of this experiment is to design and


implement a solar panel monitoring system using an
Arduino platform. The system will monitor and record
various parameters of a solar panel, such as voltage,
current, and power output, using specific components
like the ACS712 current sensor, LM044L voltage sensor,
and Arduino Uno.

Components Used

1. Solar Panel; The primary source of energy for the


system. It converts sunlight into electrical energy.
2. Arduino Uno (Simulino Uno): The microcontroller
platform for reading sensor data, processing it, and
displaying the results.
3. ACS712ELCTR-058-T: An analog current sensor used
to measure the current generated by the solar panel.
4. LM044L: A voltage sensor used to measure the
voltage output of the solar panel.
5. LCD Display: To visualize the real-time data of
voltage, current, and power generated by the solar
panel.
6. Resistor (Res): Used for current limiting or for circuit
stability.
7. Breadboard and Wires: For connecting and
assembling the components.
Theory

Solar Panel
A solar panel generates DC electricity by converting
solar energy into electrical energy. The power output of
the panel depends on various factors such as the
intensity of sunlight, the angle of incidence, and the
efficiency of the solar cells.

ACS712 Current Sensor


The ACS712 current sensor is used to measure the
current output from the solar panel. It outputs an analog
voltage proportional to the measured current, which is
then read by the Arduino.

LM044L Voltage Sensor


The LM044L voltage sensor is used to measure the
voltage output of the solar panel. The output voltage
from the sensor is then fed to the Arduino.
Arduino Uno
The Arduino Uno is used to process the analog signals
from the ACS712 and LM044L sensors. It performs
calculations such as determining the power output of the
solar panel (P = V × I) and displays the data on an LCD
screen.
Circuit Diagram

The circuit is connected as follows:

1. Solar Panel: The positive and negative terminals of


the solar panel are connected to the circuit.
2. ACS712 Current Sensor: The input of the ACS712 is
connected to the positive terminal of the solar panel,
while the output is connected to the Arduino's analog
input pin (A0).
3. LM044L Voltage Sensor: The input of the voltage
sensor is connected to the output of the solar panel, and
the output is connected to the Arduino’s analog input pin
(A1).
4. LCD Display: The LCD display is connected to the
Arduino to show the real-time data of voltage, current,
and power.
5. Resistor: A resistor may be used in series to ensure
current stability and prevent overcurrent situations.

Arduino Code

#define RS 13 // Register Select


#define E 12 // Enable
#define D4 11 // Data pins (D4-D7)
#define D5 10
#define D6 9
#define D7 8

void lcdSendCommand(uint8_t cmd) {


digitalWrite(RS, LOW); // Command mode
digitalWrite(D4, (cmd >> 4) & 0x01);
digitalWrite(D5, (cmd >> 5) & 0x01);
digitalWrite(D6, (cmd >> 6) & 0x01);
digitalWrite(D7, (cmd >> 7) & 0x01);
digitalWrite(E, HIGH);
delayMicroseconds(1);
digitalWrite(E, LOW);
delayMicroseconds(100); // Give time for the LCD to
process

digitalWrite(D4, cmd & 0x01);


digitalWrite(D5, (cmd >> 1) & 0x01);
digitalWrite(D6, (cmd >> 2) & 0x01);
digitalWrite(D7, (cmd >> 3) & 0x01);
digitalWrite(E, HIGH);
delayMicroseconds(1);
digitalWrite(E, LOW);
delayMicroseconds(100); // Give time for the LCD to
process
}

void lcdSendData(uint8_t data) {


digitalWrite(RS, HIGH); // Data mode
digitalWrite(D4, (data >> 4) & 0x01);
digitalWrite(D5, (data >> 5) & 0x01);
digitalWrite(D6, (data >> 6) & 0x01);
digitalWrite(D7, (data >> 7) & 0x01);
digitalWrite(E, HIGH);
delayMicroseconds(1);
digitalWrite(E, LOW);
delayMicroseconds(100); // Give time for the LCD to
process

digitalWrite(D4, data & 0x01);


digitalWrite(D5, (data >> 1) & 0x01);
digitalWrite(D6, (data >> 2) & 0x01);
digitalWrite(D7, (data >> 3) & 0x01);
digitalWrite(E, HIGH);
delayMicroseconds(1);
digitalWrite(E, LOW);
delayMicroseconds(100); // Give time for the LCD to
process
}
void lcdInit() {
pinMode(RS, OUTPUT);
pinMode(E, OUTPUT);
pinMode(D4, OUTPUT);
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT);

delay(20); // Wait for LCD to power up

lcdSendCommand(0x33); // Initialize in 8-bit mode


lcdSendCommand(0x32); // Switch to 4-bit mode
lcdSendCommand(0x28); // 4-bit mode, 2 lines, 5x7
matrix
lcdSendCommand(0x0C); // Display on, cursor off
lcdSendCommand(0x06); // Increment cursor
lcdSendCommand(0x01); // Clear display
}

void lcdPrint(char* str) {


while (*str) {
lcdSendData(*str++);
}
}
#define SENSOR_PIN_VOLTAGE A1
#define SENSOR_PIN_CURRENT A0

void setupADC() {
// Set the ADC prescaler and enable ADC
ADMUX = 0; // Set the input channel (A0 by
default)
ADCSRA |= (1 << ADEN); // Enable ADC
ADCSRA |= (1 << ADPS2) | (1 << ADPS1); // Set ADC
prescaler to 64
}

uint16_t readADC(uint8_t pin) {


// Select the channel (A0-A7)
ADMUX = (ADMUX & 0xF0) | (pin & 0x0F);
ADCSRA |= (1 << ADSC); // Start conversion
while (ADCSRA & (1 << ADSC)); // Wait for conversion
to finish
return ADC; // Return the 10-bit result
}
void setup() {
lcdInit(); // Initialize LCD
setupADC(); // Initialize ADC
lcdPrint("THE BRIGHT LIGHT");
delay(2000);
lcdPrint("SOLAR MONITORING");
delay(2000);
}

void loop() {
// Read the voltage sensor (pin A1)
uint16_t sensorValueVoltage =
readADC(SENSOR_PIN_VOLTAGE);
float voltage = (sensorValueVoltage * 5.0) / 1023.0; //
Convert to voltage
voltage *= 5; // Actual voltage reading in volts

// Display voltage on LCD (Row 3, Column 0)


lcdSendCommand(0xC0); // Set cursor to row 3,
column 0
lcdPrint("Voltage = ");
lcdPrint(String(voltage).c_str());
lcdPrint("V");

// Read the current sensor (pin A0)


uint16_t sensorValueCurrent =
readADC(SENSOR_PIN_CURRENT);
float currentVoltage = (sensorValueCurrent / 1024.0) *
5000; // Convert to voltage in mV
float current = (currentVoltage - 2500) / 185; // Convert
to current in Amps

// Display current on LCD (Row 4, Column 0)


lcdSendCommand(0x94); // Set cursor to row 4,
column 0
lcdPrint("Current = ");
lcdPrint(String(current).c_str());
lcdPrint("A");

delay(2000); // Wait for 2 seconds


}

Procedure

1. Assembly of Components:
- Connect the solar panel to the ACS712 and LM044L
sensors as per the circuit diagram.
- Attach the LCD display to the Arduino.
- Ensure that the Arduino Uno is connected to the
computer via USB for power and programming.

2. Programming the Arduino:


- Upload the provided Arduino code to the Arduino
Uno using the Arduino IDE.

3. Testing the System:


- Place the solar panel in a well-lit area or expose it to
sunlight.
- Observe the data being displayed on the LCD
screen. The voltage, current, and power values should
update every second.

4. Data Collection:
- Monitor the readings displayed on the LCD display
and record the values for voltage, current, and power
under different light conditions (e.g., cloudy, sunny, or
overcast).
Result;

You might also like