Published On Jul 4, 2023
Super easy to build 1600 Watt Solar panel #4 Stop Energy Loss with Arduino and Help from ChatGPT
Link to the 1st solar panel video: • Super easy to build 1600 Watt Solar p...
Link to the 2nd solar panel video: • Super easy to build 1600 Watt Solar p...
Link to the 3th solar panel video: • Super easy to build 1600 Watt Solar p...
Support me on patreon: / thediyscienceguy
Link to My teespring store front: https://www.teespring.com/stores/the-...
Follow me on Facebook: / thediyscienceguy
Follow me on Instagram: / thediyscienceguy
Music: Stalling by Topher Mohr and Alex Elena
The Arduino code:
/*The DIY Science Guy Solar Panel Hot Tub Temp System*/
#include (Smaller than symbol) LiquidCrystal.h (Greater than symbol)
LiquidCrystal lcd(12,11,5,4,3,2);
#include (Smaller than symbol) Wire.h (Greater than symbol)
unsigned char degree[8] = { 0b00011, 0b00011, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000 };
const int analogInPinA0 = A0;
const int analogInPinA1 = A1;
const int SensorValueLow_1 = 529;
const int SensorValueDiff_1 = 64; // differance between high and low sensor value
const int TempValueDiff_1 = 82.9; // differance between high and low Temp value
const int TempValueLow_1 = 1.9;
const int SensorValueLow_2 = 521;
const int SensorValueDiff_2 = 69; // differance between high and low sensor value
const int TempValueDiff_2 = 82.9; // differance between high and low Temp value
const int TempValueLow_2 = 1.9;
int sensorValue_1 = 0;
int sensorValue_2 = 0;
double Temp_1 = 0;
double Temp_2 = 0;
const int ledPin = 7;
void setup() {
lcd.begin(20,2);
pinMode(ledPin, OUTPUT);
}
void loop() { sensorValue_1 = analogRead(analogInPinA0);
Temp_1 = sensorValue_1-SensorValueLow_1;
Temp_1 = Temp_1/SensorValueDiff_1;
Temp_1 = Temp_1*TempValueDiff_1;
Temp_1 = Temp_1+TempValueLow_1;
sensorValue_2 = analogRead(analogInPinA1);
Temp_2 = sensorValue_2-SensorValueLow_2;
Temp_2 = Temp_2/SensorValueDiff_2;
Temp_2 = Temp_2*TempValueDiff_2;
Temp_2 = Temp_2+TempValueLow_2;
if(Temp_2 (Greater than symbol) Temp_1+5){
digitalWrite(ledPin, LOW);
}
else if (Temp_2 (Smaller than symbol) Temp_1+2)
{digitalWrite(ledPin, HIGH);
}
lcd.setCursor(0,0);
lcd.print("V/T 1");
lcd.setCursor(6,0);
lcd.print(sensorValue_1);
//lcd.print(analogInPinA0);
lcd.setCursor(11,0);
lcd.print(Temp_1);
lcd.setCursor(0,1);
lcd.print("V/T 2");
lcd.setCursor(6,1);
lcd.print(sensorValue_2);
//lcd.print(analogInPinA1);
lcd.setCursor(11,1);
lcd.print(Temp_2);
delay(500);}