Thursday, May 22, 2014

Weather Station: Day 4- May 22

We started our day by downloading the arduino software from arduino.cc using the Macs. We first downloaded the arduino environment and then connected the arduino to the Mac with a USB cord. We opened the arduino Application and tested the connection with the blink example. Once we uploaded the program the light on the arduino blinked every two seconds and we were successful.

Then Mike taught us about the arduino and circuits. We made a circuit with a photocell, a resistor, bread board, and the arduino. He showed us how the information was read on his computer with the arduino software. We could see the changes in the results when the amount of light hitting the photocell changed.

Next, we plugged the arduino into the raspberry pi with a USB cord. Then we had to figure out how to get them to communicate. We found a MagPi issue (issue 7) which explained how to do this in the link: http://www.themagpi.com/issue/issue-7/article/raspberry-pi-arduino/ 
We first had to install the Arduino IDE and Firmata which is the library for communicating with software on the host computer (in this case it is the raspberry pi). Then we had to install pyFirmata which allows Firmata to talk to Python and able to talk to the raspberry pi.

We also found a helpful link that had code that told the arduino to talk to the raspberry pi. Every two seconds, the arduino sent "Hello Pi" to the raspberry pi! We finally got them to communicate which has been one of our difficult goals. This is the link we used for that: http://blog.oscarliang.net/connect-raspberry-pi-and-arduino-usb-cable/

Now that we know how to build a circuit, and get the raspberry pi and arduino to communicate, we are now trying to read the temperature from an LM34. The data sheet for this LM34 temperature sensor is: https://www.jameco.com/Jameco/Products/ProdDS/155192.pdf The arduino sends the temperature to the raspberry pi in Volts. Then we will have to convert it to degrees. We set up the circuit but the code is giving us difficulty for now. Below shows the circuit that we are trying to make to read temperature.



On the bright side, the new Weather Station has now arrived!!














No comments:

Post a Comment