11
[ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station Instruction Manual Introduction The Arduino Weather Station is designed to help students understand how both digital and analog sensors work. This project brings together various concepts essential for understanding how sensors and Arduino works. Follow the instructions below to create a fun weather station. Have fun! Video: Materials List 3x Popsicle Sticks 1x Small Cup A Roll of Solid Core Shielded Wire (Network Cable works well) 24x Male-Male Jumper Wire and 5x Male- Female Jumper Wire LM35 Temperature Sensor Vibration Sensor

EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

Embed Size (px)

Citation preview

Page 1: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 1 | P a g e

EG Robotics Arduino Weather Station

Instruction Manual

Introduction The Arduino Weather Station is designed to help students understand how both digital and analog sensors work. This project brings together various concepts essential for understanding how sensors and Arduino works. Follow the instructions below to create a fun weather station. Have fun! Video:

Materials List

3x Popsicle Sticks 1x Small Cup

A Roll of Solid Core Shielded Wire (Network Cable works well)

24x Male-Male Jumper Wire and 5x Male-Female Jumper Wire

LM35 Temperature Sensor

Vibration Sensor

Page 2: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 2 | P a g e

LDR 5x 10K Ohm Resistors

Breadboard Medium/Large

16X2 LCD

Arduino USB Cable

Power Jack Batteries (9V)

10K Potentiometer

Suggested Tools

Page 3: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 3 | P a g e

Hot Glue Gun

Wire Strippers

Page 4: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 4 | P a g e

Arduino Weather Station Step One – Weather Station Structure The first step in making the Arduino Weather Station is to make the structure for it. This can be done in many different ways from costing close to nothing or with lasting better parts costing more. For designing an easy, cheap station use Popsicle sticks or even just sticks from a tree. The sticks are hot glued together to form a stand, with the base being wide enough to hold it stable and up right and the also be able to attach a small cup to it. The design we did looks like a standing coat hanger with a base and a tall middle pole. The cup used to collect rain must be able to hold water. You can use cheap paper waxed cups for this or use a more ecofriendly solution such as a used plastic bottle with the top cut off. We hot glued the water collecting cup to the pole of the weather station to create our structure.

Step Two – Positioning the Sensors Plan out where each of the 4 sensors will be placed. The water level sensor should of course be placed within the rain cup. The temperature sensor can be placed almost anywhere on the station. It is a good idea to have it suspended in the air to get a good reading of the air temperature. The LDR should be placed where it can detect the light levels accurately. And lastly the vibration sensor should be positioned so that it can shake in the wind. Mark out each sensor and where it will be positioned as this will give you a good idea of how long the wires need to be in order to reach from the breadboard to the sensors.

Step Three – Power the Arduino and Upload the Code Now that you have the weather station figured out, it’s time to turn it into an Arduino Weather Station. You’ll need to setup your Arduino before you can begin working with the sensors. You’ll need your Arduino, USB cable, power jack, power source (9v) all together to get started. First, check you’re your power source by plugging it into the Arduino and checking to see if the lights come on. Next attached it via USB to your computer. Start up the Arduino software and enter the following code and upload it: #include <LiquidCrystal.h>  int temppin   = 0; int windpin   = 2; int sunpin    = 1; int water1pin = 2; int water2pin = 3; int water3pin = 4; unsigned long duration;  LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  void setup() {   Serial.begin(9600);     lcd.begin(16, 2);     lcd.print("Starting....");     delay(2000);     lcd.clear();     pinMode(5, OUTPUT); 

Page 5: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 5 | P a g e

  }   void loop()                      {   delay(500);  analogRead(temppin);  delay(10);  int temp = analogRead(temppin);  int windstate = digitalRead(windpin);  duration = pulseIn(windpin, HIGH);  int sun = analogRead(sunpin);      float voltage = temp * 5.0;  voltage /= 1024.0;    float temperatureC = voltage * 100 ;   float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;  lcd.setCursor(0, 0);  lcd.print(temperatureF);  lcd.setCursor(5, 0);   lcd.print((char)223);    if (duration > 1) {           lcd.setCursor(8, 0);  lcd.print("Windy!!");   }    else { lcd.setCursor(8, 0);  lcd.print("No Wind");  delay(1000);     }   if (sun > 900) {           lcd.setCursor(0, 1);  lcd.print("Sunny!");  digitalWrite(5, LOW);    }         if (sun < 900 && sun > 400) {           lcd.setCursor(0, 1);  lcd.print("Cloudy");  digitalWrite(5, LOW);     }      if (sun < 500) {      

Page 6: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 6 | P a g e

     lcd.setCursor(0, 1);  lcd.print("Dark!");  digitalWrite(5, HIGH);     }         if (analogRead(water1pin) == 0) {           lcd.setCursor(8, 1);  lcd.print("No Rain!");     }       if (analogRead(water1pin) > 2 && analogRead(water2pin) == 0) {           lcd.setCursor(8, 1);  lcd.print("Rain 1in");     }       if (analogRead(water2pin) > 2 && analogRead(water3pin) == 0) {           lcd.setCursor(8, 1);  lcd.print("Rain 2in");     }       if (analogRead(water3pin) > 2) {           lcd.setCursor(8, 1);  lcd.print("Rain 3in");     }   }  (Need help installing Arduino software? Visit: http://arduino.cc/en/Guide/HomePage) When you have uploaded the code then you can start putting together the circuits!

Step Four – Attaching the LCD Get the LCD attached to the Arduino in order to test if the sensors are working as the build the Weather Station. The LCD can be placed on a breadboard or can be attached to the weather station. In our example we have it separate from the breadboard with jumper wires going to the breadboard. Put together the LCD by following the series of steps depicted in the image below. When you have completed the circuit turn on your Arduino and the LCD should power up. You may need to twist your potentiometer to get the contrast right in order to see the words on the LCD clearly. If you lack a potentiometer you can also replace it with a 10K & 1K Ohm resistor.

Page 7: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 7 | P a g e

Page 8: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 8 | P a g e

Step Five – Temperature Sensor Get started with the temperature sensor! The LM35 is an analog sensor that converts voltage into temperature. Take a look at the code to understand how the LM35 is used to convert a voltage into Celsius, then into Fahrenheit. For this sensor use Male-Female jumper wires to make it simple and easy. Hot glue the sensor onto the pole of the weather station. The following circuit will show you how to attach the temperature sensor to the Arduino. When it is attached it should give an accurate readout on the LCD.

Page 9: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 9 | P a g e

Step Six – Light Sensor Next work on the light sensor! You’ll need your LDR or Photocell, 10k Ohm Resistor and some Male-Female jumper wires. This circuit also reads the voltage and converts it to an analog value and from that value we can use it to know if it is sunny, cloudy, or dark. Take a look at the code to see how the input from the LDR is used to display different text on the LCD. You may need to modify the values for each to fit your LDR. Use the following circuit to get the LDR working. When it is working move your hand over it or turn the lights out to check if it is accurate. Hot glue it onto the weather Station pole in a full light position.

Page 10: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 10 | P a g e

Step Seven – Wind Sensor The wind sensor is a vibration sensor that works through a digital means instead of analog. It is either off or on 0 or 1. This sensor is used to detect vibrations and provides you with an output of No Wind or Windy. In this circuit we use a Pull-Down Resistor in order to avoid false readings. The resistor we use is a 1K but a 10K works just as well. Follow the circuit below to get the wind sensor working. Give it a flick with your finger to test if it is accurately detecting vibration or movement. When you have it working hot glue the wires to the top of your post allowing it to flow back and forth in the wind.

Step Eight – Water Level Sensors The water level sensors can give you an idea of how much it has rained. This is a very basic way of determining the water level. The water collected in the cup acts as a bridge for the electrons to flow from the negative lines to the positive line at the bottom of the cup. Each line should be glued or positioned down the side of the cup at different heights. You can choose the height you would like. If it doesn’t rain very much where you live then you should position then closer together. Make sure to change the code to match the height you have chosen. We once again use Pull-Down resistors in this circuit to avoid getting false readings.

Page 11: EG Robotics Arduino Weather Station Instruction …ARDUINO WEATHER STATION INSTRUCTION MANUAL] EG Robotics Manual | Interested LLC 2013 | 1 | Page EG Robotics Arduino Weather Station

[ARDUINO WEATHER STATION INSTRUCTION MANUAL]

EG Robotics Manual | Interested LLC 2013 | 11 | P a g e

Step Nine – Try it out! Your Arduino Weather station should now be complete. Test it out and make sure you have everything working! Before you place it outside make sure the all electrical components are covered properly to avoid high moisture or water from collecting on them. This Weather Station is meant for learning purposes and designed for students from 2nd to 5th grade. There are better and more complicated ways to make a real weather station, but this is a basic form to give students a way of learning analog and digital sensors as well as learning some programing and understanding the Arduino. If you have any comments, improvement suggestions, or issues please contact us! Thanks!