Mirko Pavleski
Published © GPL3+

Barometer with Analog Scale (Ammeter)

An analog-style BMP180 barometer.

BeginnerFull instructions provided4,079
Barometer with Analog Scale (Ammeter)

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Ampermeter 1mA
×1
MyOctopus i2c Barometric Air Pressure Sensor BMP280
MyOctopus i2c Barometric Air Pressure Sensor BMP280
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematic

Code

code

Arduino
#include "Wire.h"    // imports the wire library for talking over I2C 
#include "Adafruit_BMP085.h"  // import the Pressure Sensor Library
Adafruit_BMP085 mySensor;  // create sensor object called mySensor


float pressure; //Variable for holding pressure reading

int out=0;
int ANALOGPRESSURE=0;

void setup() 
{
pinMode(6, OUTPUT);

mySensor.begin();   //initialize mySensor

test();
}

void loop() {

pressure=mySensor.readPressure(); //Read Pressure
ANALOGPRESSURE=map (pressure,90135,95653,0,255);//Absolute values
analogWrite (6,ANALOGPRESSURE);
delay (20000);
}

void test() {
for (int i=1;i<=255;i++)
{
analogWrite (6, i);  
delay (20);
}
for (int i=255;i>=1;i--)
{
analogWrite (6, i);  
delay (20);
}
delay (1000);
}

Credits

Mirko Pavleski

Mirko Pavleski

117 projects • 1164 followers

Comments