The camera works! Here is me thinking:
The reddish hue is due to this being an IR camera.
Monday, May 12, 2014
Hardware
In my last post I discussed how to log into the Pi with SSH, and start taking data. Today, we will dig into the code and see what this program is actually doing.
We start by importing Adafruit libraries for these sensors. This allows us to use basic functions to talk to and control the sensors and not have to "reinvent the wheel" every time we need to do something. I have taken screenshots of the rest of the code, and I have made comments in red describing what the program is doing.
And that's how it works! Here is a link to the data log
However, as I look at this, I realize that I need to do more work to get useful information from the accelerometer and magnetometer.With some work you can do some pretty cool things with this information.
Here are some leads...
Sunday, May 11, 2014
Setting up SSH
Hey everyone,
We have made quite a lot of progress on the Raspberry Pi. I've got it sensing GPS, pressure, temperature, compass heading, and taking HD pictures along the way. So I'm going to walk you through what I've done. Today I will start with opening an SSH connection and running the data logging program.
SSH
To make the Pi easier to work on, I've been using SSH. This allows me to control the Pi from the command line over the university network. The benefit to this is that I don't need two keyboards, two mice, a monitor, and an extra USB hub; and all that can make it a pain to set up and take down. All I need to do is hook my Pi up to the network. I hope to be able to network the Pi straight to my laptop, which would make it easy to start collecting data even in a remote area -- but I haven't gotten that far yet. Here is how to log on to the Pi via SSH.
First, if you are using a Windows machine, you will need to download Putty. Putty will open up and look something like this:
Then, you will want to enter the IP address of the Pi. (137.28.116.63)
If for some reason the IP address has changed, you can look it up on the Pi itself by using the command.
sudo ifconfig
in the Raspberry Pi terminal. Yes, unfortunately, you will need to set up the monitor, keyboard, and mouse for this... The result will look like this: (I highlighted the IP address)
Once you have the IP address, you can enter it in the "Host Name (or IP address)" field.
Next, you will be directed to a login page on the PuTTY terminal. It might first give you a warning pop-up, but you can disregard this. Log in like this:
login as: pi password: balloon
Note: when you type the password, it won't appear on the screen -- this is normal.
And then you're in!
To work your way around the command prompt, you will need to know some basic Linux commands. It might look intimidating at first, but the basics really aren't that bad. First, it might be helpful to change from a black to white background, otherwise blue is very difficult to see. You can do this by right clicking the top window bar, select "Change Settings...", go to Window, then Colours, and change "Default Background" to white.
To look at the current directory (directory is a computer sciency name for folder), use the command ls. This helps you keep track of where you are in the computer, and what files are in that current folder.
The code that I am using for this project is in the "Adafruit-Raspberry-Pi-Python-Code" directory. To navigate to it I use "cd", which stands for "change directory". Below, I use this command and then ls again to show the contents of Adafruit-Raspberry-Pi-Python-Code. (Note, you don't need to type the whole address, simply type the first couple letters and then hit the tab button. The computer will complete the rest.)
The code we are using is in "PiBalloon"
Before you run the program, we have to do a couple of strange things to get it to work. For some reason, the GPS doesn't often work without resetting it first, so that is what we will do.
So that's all there is to it. To run the program, type:
sudo python DumpInfo.py
The program will start taking data from all the sensors and taking pictures every couple of seconds and dumping that data into a comma-separated values (CSV) spreadsheet. To stop taking data, press CTRL+C. You can disconnect the Pi from the SSH connection if you wish, and it will continue to take data. When you next access it from the command line, you will need to do something different to stop the data collection. Type...
sudo killall DumpInfo.pyTo look at the data you just took, open the file DataLog.csv in the PiBalloon directory using the "cat" command.
You will also notice some new JPG files in the directory. Those are the pictures that the Pi took. I don't yet know how to view them over SSH, but you can view them from the Raspbian GUI
That's all for today!
Will
Saturday, April 12, 2014
First Two Sensors: LSM303 and BMP180
This week our goal was to get the first two sensors up and running. We got the circuit wired up for the BMP180 (the pressure sensor), and tried to find it on the Pi using "i2cdetect -y 1". We hadn't soldered the pins into the breakout board yet, so our information was shotty, but after soldering we got things working.
In order to start collecting readings, we downloaded the Adafruit Raspberry Pi Python Code Library onto the Pi. There wasn't a library for the BMP180, but there is a library for the BMP085, which is a similar board, so we used that, and it seems like it worked.
Below: Data from the BMP180. The errors came from some loose wires.
I was happy to find that this same library included code for the LSM303 sensor as well. We wired that in parallel with the other board into the I2C connections and then...
We have something! But.. It seems like the Magnetometer isn't working quite right as it won't change from its "-4096" value. It stays here even when we put a magnet near it. I'm still not to sure how to read the accelerometer data, but it seems like it is responding logically as I move it around. We will have to come back to this later to figure out what is wrong.
Nonetheless, we finally have two chips wired in and communicating with the Pi. This is good! The pressure sensor seems to be giving reasonable data, and the LSM303 is well... communicating. Of course, we will need to figure that problem out. Eventually we will need to make a program that will take both of these data readings, along with the GPS readings and both camera pictures, and store them in a sort of a table. When the balloon goes up, we want to be able to run this program that will keep collecting data every few seconds or so. Then we will need to be able to extract this data so that we can analyze it in a practical way.
Next step.. try to get the GPS up and running, and then the cameras. I think I will table the LSM303 problems for now until I can talk to some computer scientists who are willing to help. When we have all that going, then we can do some programming to interface them all together to be able to continuously take data.
Monday, April 7, 2014
First Steps...
I was previously only familiar with the Arduino, so it was a bit of a shock to me to find out that the Pi is more of a computer than a micro controller. I had not concidered that I would need a mouse or keyboard, so this took some figuring out.
I started the process of installing the operating system at home on my TV. I used an RCA cable for video, and this worked for a little while, but once Raspbian had finished installing, I got a black screen. I figured this had something to do with the cable type, so thankfully the friendly folks at the LTS Help Desk loaned me an HDMI to DVI cable, so that I can connect to the school's monitors. Once I got hooked up to the school's monitors, I was in action.
My first step was to place a disk image onto the SD card. I followed the instructions according to the Raspberry Pi Quick Start page. I installed Raspbian and set Linux to boot into the graphical user interface (GUI) that makes the home screen look very similar to a windows screen.
I followed instructions on this page in order to use the I2C bus to take data from our sensors. All looks good so far... Can't wait to get some sensors running and take some IR photographs!
I started the process of installing the operating system at home on my TV. I used an RCA cable for video, and this worked for a little while, but once Raspbian had finished installing, I got a black screen. I figured this had something to do with the cable type, so thankfully the friendly folks at the LTS Help Desk loaned me an HDMI to DVI cable, so that I can connect to the school's monitors. Once I got hooked up to the school's monitors, I was in action.
My first step was to place a disk image onto the SD card. I followed the instructions according to the Raspberry Pi Quick Start page. I installed Raspbian and set Linux to boot into the graphical user interface (GUI) that makes the home screen look very similar to a windows screen.
I followed instructions on this page in order to use the I2C bus to take data from our sensors. All looks good so far... Can't wait to get some sensors running and take some IR photographs!
Saturday, April 5, 2014
The Beginning!
Hello World! This is a blog that will document my adventure into the Raspberry Pi world. With the help of Dr. Hupy from the University of Wisconsin: Eau Claire's geography department, we will be sending a Raspberry Pi armed weather balloon up into the stratosphere to take some data and bring back some killer pictures from over 110,000 feet in the sky.
To put into perspective how high 110,000ft really is, an average pressurized cabin commercial airline flight is at 30-40,000 ft. The pressure at this height is .162psi (compared to about 14psi at ground level). At this pressure, human blood will literally boil at our body temperature. The temperature is about -51 degrees Fahrenheit... not a great place for people. But it is a great place for electronics!
Starting this project, I have absolutely no experience with the Raspberry Pi. In fact I have very little experience with electronics all together. I haven't done research before, nor have I done any serious computer programming outside of a class. I've never built circuits outside of a breadboard that have been used for any practical purpose. I expect to learn a lot from this project about electronics, computing, and research in general! I do however have some experience from a couple of Physics classes in circuits and electronics.
So here is what we have to start. A lot of stuff!!
Raspberry Pi Board
Raspberry Pi Camera Board
Pi NoIR Camera Board
Small Breadboard
perma proto board
Pi Cobbler
LSM303 Compass/Accelerometer
BMP 180 Pressure Sensor
Adafruit Ultimate GPS v3.1
GPS antenna
SMA to uFL #851 (not sure what this does yet)
I am noticing that I don't have any sort of I2C temperature sensor. It might be fun to build my own...
To put into perspective how high 110,000ft really is, an average pressurized cabin commercial airline flight is at 30-40,000 ft. The pressure at this height is .162psi (compared to about 14psi at ground level). At this pressure, human blood will literally boil at our body temperature. The temperature is about -51 degrees Fahrenheit... not a great place for people. But it is a great place for electronics!
Starting this project, I have absolutely no experience with the Raspberry Pi. In fact I have very little experience with electronics all together. I haven't done research before, nor have I done any serious computer programming outside of a class. I've never built circuits outside of a breadboard that have been used for any practical purpose. I expect to learn a lot from this project about electronics, computing, and research in general! I do however have some experience from a couple of Physics classes in circuits and electronics.
So here is what we have to start. A lot of stuff!!
Raspberry Pi Board
Raspberry Pi Camera Board
Pi NoIR Camera Board
Small Breadboard
perma proto board
Pi Cobbler
LSM303 Compass/Accelerometer
BMP 180 Pressure Sensor
Adafruit Ultimate GPS v3.1
GPS antenna
SMA to uFL #851 (not sure what this does yet)
I am noticing that I don't have any sort of I2C temperature sensor. It might be fun to build my own...
Subscribe to:
Comments (Atom)




