Off-grid Solar PV Panel project: Difference between revisions

From Sensors in Schools
Jump to navigation Jump to search
Line 93: Line 93:


[[File:Screen Shot 2023-04-10 at 5.00.47 pm.png | 900px | https://www.dropbox.com/s/si91tj3sehc2aeh/Read%20PV%20Values%20on%20Arduino.mp4?dl=0 ]]
[[File:Screen Shot 2023-04-10 at 5.00.47 pm.png | 900px | https://www.dropbox.com/s/si91tj3sehc2aeh/Read%20PV%20Values%20on%20Arduino.mp4?dl=0 ]]
== Python - Reading Solar PV Voltage using Python ==

Revision as of 07:11, 10 April 2023

First Lesson

Building a small scale Solar PV system using an Arduino

Arduino IDE Installation and Configuration on a Raspberry Pi

link = https://www.dropbox.com/s/bwohfh2eh7ys14d/Arduino%20IDE%20installation3.mp4?dl=0

Arduino LED Blink Program

  • Program lights up Arduino UNO on-board LED connected to pin 13 for 1 second.

link = https://www.dropbox.com/s/26b8stvdtpjz26c/Arduino%20LED%20Blink.mp4?dl=0

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

*/

// the setup function runs once when you press reset or power the board

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level) = 1 = 5V supply
  delay(1000);                       // wait for 1 second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW = 0 = 0V supply
  delay(1000);                       // wait for 1 second
}

Arduino UNO - Safety

  • Wear eye protection.
  • Always get a teacher to inspect your circuit before powering up.
  • Wear cotton shirts and pants and closed shoes.
  • Even low voltages can cause burns because wires can heat up if shorted.

https://www.dropbox.com/s/7lq5vcwjz6jwlyy/Safety%20with%20Circuits.mp4?dl=0

Arduino UNO - Building a LED Blink Circuit on a Breadboard

  • Build an external LED Blink Circuit for the Arduino UNO.

link = https://www.dropbox.com/s/omux7g4zvstistp/Blink%20LED%20Circuit.mp4?dl=0

Arduino UNO - Building a Mini-Solar PV Circuit

  • Demonstration on how to build a small PV circuit that charges a battery on an Arduino UNO.
  • The circuit incorporates a Voltage Divider circuit.
  • Click on Image below to download and watch video.

https://www.dropbox.com/s/3ugfnajegfk5rmb/Mini%20Solar%20PV%20Circuit.mp4?dl=0

Raspberry Pi - Python Introductory Lesson

  • Install software to help program in Python
  • Explore some simple python coding and learn about indentation to delineate code blocks

https://www.dropbox.com/s/l9zzp8i0i359zox/Python%20Introduction.mp4?dl=0

Raspberry Pi and Arduino Serial Communication

  • Write code for the Arduino UNO to send data to the Raspberry pi using Serial communication.
  • Write code in Python on the Raspberry Pi to receive data from the Arduino UNO using Serial communication.
  • Raspberry Pi requires the installation of:
    • sudo apt install python3-pip - pip to install python packages
    • python3 -m pip install pyserial - pySerial Library

https://www.dropbox.com/s/bfw4oixvsmudwk2/Python%20Serial%20Intro.mp4?dl=0

Python code for Raspberry Pi to receive serial communication from the Arduino UNO

import serial

if __name__ == '__main__':
    ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
    ser.reset_input_buffer()
    
    while True:
        if ser.in_waiting > 0:
            line = ser.readline().decode('utf-8').rstrip()
            print(line)

Arduino UNO - Reading the Voltage of the Small Solar PV Panel

  • Learn how to read voltage readings from a small Solar PV panel connected to an Arduino UNO using a voltage divider circuit and analog pin A2.


https://www.dropbox.com/s/si91tj3sehc2aeh/Read%20PV%20Values%20on%20Arduino.mp4?dl=0

Python - Reading Solar PV Voltage using Python