Week 3 Testing

After looking more into my component from last time I realised some of the libraries that I downloaded for the coeds last time have test on them to check if the board is working correctly.

The first test was the BMP085 TEST. It gave me a sketch to run on my board to check to see if it was functioning correctly.

Adafruit_BMP085 bmp;

void setup() {
if (!bmp.begin()) {
Serial.println(“Could not find a valid BMP085 sensor, check wiring!”);
while (1) {}

void loop() {
Serial.print(“Temperature = “);
Serial.println(” *C”);

Serial.print(“Pressure = “);
Serial.println(” Pa”);

// Calculate altitude assuming ‘standard’ barometric
// pressure of 1013.25 millibar = 101325 Pascal
Serial.print(“Altitude = “);
Serial.println(” meters”);

Serial.print(“Pressure at sealevel (calculated) = “);
Serial.println(” Pa”);

// you can get a more precise measurement of altitude
// if you know the current sea level pressure which will
// vary with weather and such. If it is 1015 millibars
// that is equal to 101500 Pascals.
Serial.print(“Real altitude = “);
Serial.println(” meters”);


After i uploaded this sketch i checked the serial monitor and the message “could not find valid BMP085 senor” so just to make sure again it wasn’t me i checked the component with another test.

The second test I did was the sensorapi test.


/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
which provides a common ‘type’ for sensor data and some helper functions.

To use this driver you will also need to download the Adafruit_Sensor
library and include it in your libraries folder.

You should also assign a unique ID to this sensor for use with
the Adafruit Sensor API so that you can identify this particular
sensor in any data logs, etc. To assign a unique ID, simply
provide an appropriate value in the constructor below (12345
is used by default in this example).

Connect SCL to analog 5
Connect SDA to analog 4
Connect VDD to 3.3V DC
Connect GROUND to common ground

2013/JUN/17 – Updated altitude calculations (KTOWN)
2013/FEB/13 – First version (KTOWN)

Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);

Displays some basic information on this sensor from the unified
sensor API sensor_t type (see Adafruit_Sensor for more information)
void displaySensorDetails(void)
sensor_t sensor;
Serial.print (“Sensor: “); Serial.println(sensor.name);
Serial.print (“Driver Ver: “); Serial.println(sensor.version);
Serial.print (“Unique ID: “); Serial.println(sensor.sensor_id);
Serial.print (“Max Value: “); Serial.print(sensor.max_value); Serial.println(” hPa”);
Serial.print (“Min Value: “); Serial.print(sensor.min_value); Serial.println(” hPa”);
Serial.print (“Resolution: “); Serial.print(sensor.resolution); Serial.println(” hPa”);

Arduino setup function (automatically called at startup)
void setup(void)
Serial.println(“Pressure Sensor Test”); Serial.println(“”);

/* Initialise the sensor */
/* There was a problem detecting the BMP085 … check your connections */
Serial.print(“Ooops, no BMP085 detected … Check your wiring or I2C ADDR!”);

/* Display some basic information on this sensor */

Arduino loop function, called once ‘setup’ is complete (your own code
should go here)
void loop(void)
/* Get a new sensor event */
sensors_event_t event;

/* Display the results (barometric pressure is measure in hPa) */
if (event.pressure)
/* Display atmospheric pressue in hPa */
Serial.print(“Pressure: “);
Serial.println(” hPa”);

/* Calculating altitude with reasonable accuracy requires pressure *
* sea level pressure for your position at the moment the data is *
* converted, as well as the ambient temperature in degress *
* celcius. If you don’t have these values, a ‘generic’ value of *
* 1013.25 hPa can be used (defined as SENSORS_PRESSURE_SEALEVELHPA *
* in sensors.h), but this isn’t ideal and will give variable *
* results from one day to the next. *
* *
* You can usually find the current SLP value by looking at weather *
* websites or from environmental information centers near any major *
* airport. *
* *
* For example, for Paris, France you can check the current mean *
* pressure and sea level at: http://bit.ly/16Au8ol */

/* First we get the current temperature from the BMP085 */
float temperature;
Serial.print(“Temperature: “);
Serial.println(” C”);

/* Then convert the atmospheric pressure, and SLP to altitude */
/* Update this next line with the current SLP for better results */
Serial.print(“Altitude: “);
Serial.println(” m”);
Serial.println(“Sensor error”);

Again after uploading the sketch i checked the serial monitor. Ooops, no BMP085 detected. So Im pretty sure that my sensor is not functioning correctly and i have orderd an new one to come.

While I wait for a new component to come I started to think what I could do with this and I thought about a product that would react to the temperature and weather out side. So I was thinking of a stuffed animal that makes certain faces or movement depending on the weather. I also wanted to be able to check the results easily. And instead of me having to set it up every time on my laptop. So I found some tutorials online on how to connect the sensor to a Ethernet shield and get your results instantly streamed to a website that you can connect with your phone. So I have ordered a Ethernet shield to pair with my ardiuno board.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s