Tag Archives: Raspberry Pi

Let Your Raspberry Pi Take Pictures of the Earth

How About Letting Your Raspberry Pi Take Pictures of the Earth?

Many many years ago, before cameras came to be associated with lenses, people captured images on film using a pinhole on the camera. This technique is still in use today. It’s called heliography and it requires long to very long exposure times – sometimes as much as 24 hours to six months. The results are rather stunning, as you can see.

Unless you have photography as a hobby, you may not be able to spare much time and may not have equipment suitable for heliography. However, taking pictures of the earth is quite an exciting project, and since you have Raspberry Pi, why not let the tiny Linux computer do it?

That is exactly what Dave Akeman planned to do. He created the Raspberry Eye-in-the-Sky project that sent Raspberry Pi and a bunch of components out into the atmosphere where the weather balloons go and burst themselves. The payload consisted of a Raspberry Pi, a camera and a tracker, powered by a few AA batteries. The pictures, taken while the camera was in the sky, are spectacular and amazingly crisp.

Dave changed the regulator on the Raspberry Pi and modified it so the computer could work on 3V instead of 5V, to allow the batteries to last longer. He embedded the entire electronics in a foam replica of the Raspberry Pi logo, with the camera peeping out from the bottom. The foam was for softening the landing of the package when it hit the ground after the balloon burst. Dave also put in a parachute so the package would come down smoothly.

Dave had to take permission from the CAA for the Hydrogen balloon that would carry his Raspberry Pi camera payload into the atmosphere. He used the latest Pi camera software and changed the code to make it take three types of images each at about one minute interval. One small image is taken for the first radio channel, one medium image for the second radio channel and one hi-resolution image is stored on the SD Card onboard. Additionally, Dave configured the camera to work in matrix-metering mode instead of spot metering, as this gave better resolution images.

The balloon and its camera payload went up one sunny morning, near Tetbury, UK. People from France, Holland and Northern Ireland monitored the Raspberry Eye-in-the-Sky broadcast. The image quality throughout the 3-hour flight time was excellent. The flight path, with the wind guiding it, had quite a few changes of direction and some loops. The package went up to about 24.5 miles in height finally landed near the city of Swindon about 22 miles away from Tetbury.

As the launch was delayed by more than 2 hours, the Raspberry Pi package missed the original predicted landing spot, since the wind pattern had changed in the meantime. In addition, a resident of Swindon found the package as it landed near him, and took it home. He then called up Dave after finding his telephone number on the package. That solved the initial mystery as to how the Raspberry Pi package travelled to another location after it had landed.

How to measure temperature with a Raspberry Pi

Looking for another project to make with a Raspberry Pi? You can use your Raspberry Pi to measure temperature. Not only at a single point, but also at maximum of 20 points simultaneously. Of course, you will need 20 individual sensors for doing that. Raspberry Pi will poll all the 20 sensors one after the other, and read the temperature from each of the sensors.

If you are wondering how complicated it would be to wire up 20 sensors to the Raspberry Pi, you can relax, since you need only three wires in all. One of the wires will carry power to the sensors, one wire will be the ground or return path and the third wire is a unique 1-wire interface to control the sensor and to read the temperature measured by it.

This wonder sensor is a High-Precision 1-Wire Digital Thermometer, DS18S20, with a measurement range of -55°C to +125°C (-67°F to +257°F), a thermometer resolution of 9-bits and an accuracy of ±0.5°C from -10°C to +85°C. Maxim Integrated makes this thermometer and the smallest size is a little larger than a matchstick head (TO-92).

Not only can this tiny fellow read the temperature, it stores them in its non-volatile memory and can present them either as °C or as °F. You can set temperature limits in its memory and DS18S20 will tell you when the temperature it is monitoring goes beyond the programmed limits. You can use this thermometer with the Raspberry Pi to control thermostats, industrial systems, consumer products or any thermally sensitive system.

At this point, you may be wondering if there is only one single wire for all the 20 sensors, how is the Raspberry Pi able to differentiate the twenty temperature readings. Maxim has programmed each of the sensors with a unique serial number, and when Raspberry Pi wants to read the temperature from a specific sensor, it simply asks for it by the serial number of that sensor. Only the sensor whose serial number the Raspberry Pi queries, sends the temperature data, all the others remain silent.

The Raspbian Linux distribution that you are using in your Raspberry PI already has all necessary kernel modules installed for accessing the 1-wire bus. The programming details are rather simple and you can refer to them here.

What else can you do with a DS18S20 and Raspberry Pi? You may be measuring temperature at a remote place, or there is no space for the extra power supply to the DS18S20. So, instead of supplying power separately, you could make DS18S20 “steal” power from the 1-Wire bus. For this, you must connect the VDD pin of the DS18S20 to ground. According to the datasheet, do not use the parasitic mode for measurements above 100°C, as the DS18S20 will not be able to sustain communications.

If you have programmed temperature limits for some of the DS18S20s, they will raise a flag if the temperature they are sensing goes beyond the set points. By polling for the flags, Raspberry Pi can know, which sensor is sensing temperatures beyond its set point.