Devices & Components
Arduino Uno Rev3
10 jumper wires 150mm male
Resistor 10 kΩ
Battery Alkaline 9V
Basic 16x2 Character LCD - White on Blue 5V (with Headers)
Resistor 220 ohm
Solar Panel
Knob for Trimmer CA9
10 kΩ trimmer CA9 potentiometer
Arduino 9V Jack adapter
Software & Tools
Arduino IDE
Project description
Code
CODE
cpp
CODE PYRANOMETER
1Library originally added 18 Apr 2008 2 by David A. Mellis 3 library modified 5 Jul 2009 4 by Limor Fried (http://www.ladyada.net) 5 example added 9 Jul 2009 6 by Tom Igoe 7 modified 22 Nov 2010 8 by Tom Igoe 9 modified 7 Nov 2016 10 by Arturo Guadalupi 11 12 This example code is in the public domain. 13 14 http://www.arduino.cc/en/Tutorial/LiquidCrystalHelloWorld 15 16*/ 17 18// include the library code: 19#include <LiquidCrystal.h> 20 21// initialize the library by associating any needed LCD interface pin 22// with the arduino pin number it is connected to 23float metrisiA0; 24float tasi; 25float isxys; 26float isxyssolar; 27float entasi; 28const float emvado=0.000007875; 29const float R = 10000; 30const float ConvEftoisekato=17; 31const int rs = 12, en = 13, d4 = 4, d5 = 3, d6 = 2, d7 = 1; 32LiquidCrystal lcd(rs, en, d4, d5, d6, d7); 33 34void setup() { 35 // set up the LCD's number of columns and rows: 36 // Serial.begin(9600); 37 lcd.begin(16, 2); 38 // Print a message to the LCD. 39 lcd.print("kalimera"); 40} 41 42void loop() { 43 // set the cursor to column 0, line 1 44 // (note: line 1 is the second row, since counting begins with 0): 45 lcd.setCursor (0,1); 46 // print the number of seconds since reset: 47 metrisiA0 = analogRead(A0); 48 lcd.print(analogRead(A0)); 49 50 tasi= (5 * metrisiA0) / 1023; 51 Serial.print (" tasi "); 52 Serial.println (tasi); 53 isxys = tasi * tasi / R; 54 Serial.print (" isxys 1000"); 55 Serial.println(isxys * 1000); 56 //lcd.print (" isxys "); 57 //lcd.print (isxys); 58 isxyssolar = isxys * 100 / 17; 59 Serial.print (" isxyssolar 1000"); 60 Serial.println(isxyssolar * 1000); 61 62 entasi = isxyssolar / emvado; 63 Serial.print (" entasi"); 64 Serial.println(entasi); 65lcd.print(" entasi "); 66lcd.print(entasi); 67 delay (2000);
Documentation
DOCUMENTATION
DOCUMENTATION
REFERENCES.pdf
Comments
Only logged in users can leave comments