Luqmaan Baboo
Published © MIT

Atmospheric Pressure Measurement Using XinaBox ☒CHIPs

Create a project that measures the atmospheric pressure in under 20mins using XinaBox ☒CHIPs.

EasyFull instructions provided19 minutes57
Atmospheric Pressure Measurement Using XinaBox ☒CHIPs

Things used in this project

Hardware components

SW01
XinaBox SW01
☒CHIP Temperature, humidity and atmospheric pressure sensor based on the BME280 from Bosch.
×1
PU01
XinaBox PU01
☒CHIP USB (Type A) Power Supply
×1
IP01
XinaBox IP01
☒CHIP USB Programmer based on FT232R From FTDI Limited
×1
OD01
XinaBox OD01
☒CHIP 128x64 Pixel OLED Display
×1
5V USB Power Supply
Power Bank or similar product
×1
XC10
XinaBox XC10
☒CHIP Bus Connectors
×4
XinaBox CC01
☒CHIP version of Arduino Uno based on ATmega328P
×1

Software apps and online services

Arduino IDE
Arduino IDE
Development environment for programming

Story

Read more

Code

Pressure_display.ino

Arduino
Simple code to indicate atmospheric pressure on an OLED display.
#include <xCore.h>    // include core library for xCHIPS
#include <xSW01.h>    // include pressure sensor library
#include <xOD01.h>    // include OLED display library

xSW01 SW01;

float atm_pres;       // variable containing the pressure

void setup() {
  // put your setup code here, to run once:

  // initialize pressure variable to 0
  atm_pres = 0;

  // start i2c commnication
  Wire.begin();

  // start pressure sensor
  SW01.begin();

  // start OLED display
  OLED.begin();

  // clear display
  OD01.clear();

  // delay for normalization
  delay(2000);
}

void loop() {
  // put your main code here, to run repeatedly:

  // read pressure constantly
  SW01.poll();

  // retrieve pressure and store it
  atm_pres = SW01.getPressure();

  // print pressure on OLED display
  OD01.set1X();
  OD01.println(" ATMOSPHERIC PRESSURE");
  OD01.println("");
  OD01.set2X();
  OD01.println("");
  OD01.print(" ");
  OD01.println(atm_pres);

  delay(5000);    // update display every 5 seconds
}

Credits

Luqmaan Baboo

Luqmaan Baboo

9 projects • 2 followers
Electrical Engineering Student with a fascination for automation.

Comments