BMP085 – Barometric Pressure Sensor

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Want to keep track of the weather you  of course need the temperature which can be measured be using e.g. the TMP36. This is not enough we also need to know the barometric pressure to be able to do some weatherforecast. This pressure can be measured with  the BMP085 (datasheet); mounted on a breakout board (that can be found at Sparkfun) will be a good idea if you want to be able to connect it to your Arduino. An extra feature of the BMP085 is that it can also measure the temperature.

At Sparkfun you can find some useful links and Bildr has a nice example of how to connect the breakout board and get useful information from it.

It don’t have the BMP085 myself so I cannot tell you my experiences. I’ll write about it some time when I bought and installed one myself.



Is there light? LDR sensor input

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

You can imagine it is helpful to know when it gets dark in or around the house. Knowing this you could turn on the lights automatically.  There are different sensors you can use to measure light intensity. At the moment I have some LDR (light dependent resistor)  elements to do some tests.

An LDR has a  high resistance when no light is sensed, the resistance will decrease when the sensor is illuminated (see also).

A basic test scenario is to connect an LDR together with a 10K Ohm resistor to your Arduino.

Together with the code snippet below you can experiment with more or less light. I don’t know whether the printed values are close to reality but you can give it a try.

/* Photocell simple testing sketch.

Connect one end of the photocell to 5V, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground

For more information see
Modified by M.A. de Pablo. October 18, 2009.
Thanks to Grumpy_Mike for equations improvement.

int photocellPin0 = 0;     // the cell and 10K pulldown are connected to a0
int photocellReading0;     // the analog reading from the analog resistor divider
float Res0=10.0;		  // Resistance in the circuit of sensor 0 (KOhms)
// depending of the Resistance used, you could measure better at dark or at bright conditions.
// you could use a double circuit (using other LDR connected to analog pin 1) to have fun testing the sensors.
// Change the value of Res0 depending of what you use in the circuit

void setup(void) {
  // We'll send debugging information via the Serial monitor

void loop(void) {
  photocellReading0 = analogRead(photocellPin0);   // Read the analogue pin
  float Vout0=photocellReading0*0.0048828125;	// calculate the voltage
  int lux0=500/(Res0*((5-Vout0)/Vout0));	     // calculate the Lux
  Serial.print("Luminosidad 0: ");		     // Print the measurement (in Lux units) in the screen
  Serial.print(" Lux\t");
  Serial.print("Voltage: ");			     // Print the calculated voltage returned to pin 0
  Serial.print(" Volts\t");
  Serial.print("Output: ");
  Serial.print(photocellReading0);		   // Print the measured level at pin 0
  Serial.print("Ligth conditions: ");		// Print an approach to ligth conditions
  if (photocellReading0 < 10) {
    Serial.println(" - Dark");
  } else if (photocellReading0 < 200) {
    Serial.println(" - Dim");
  } else if (photocellReading0 < 500) {
    Serial.println(" - Light");
  } else if (photocellReading0 < 800) {
    Serial.println(" - Bright");
  } else {
    Serial.println(" - Very bright");

Ladyada has a page with information about photocells, light, lux and Arduino. This page has a great sample scheme including a code example.