MrNacho
Published

Mobile Weather Station for Your Smartphone

Mobile station for weather exploration with ATttiny85 and BME280 for your smartphone.

BeginnerFull instructions provided3 hours29

Things used in this project

Hardware components

ATtiny85
Microchip Technology ATtiny85
×1
Arduino UNO
Arduino UNO
×1
OLED Display, Blue on Black
OLED Display, Blue on Black
×1
Gravity: I2C BME280 Environmental Sensor
DFRobot Gravity: I2C BME280 Environmental Sensor
×1
Micro USB Male Adapter
×1
Capacitor 10 µF
Capacitor 10 µF
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1
Wires
×1
Female Right Angle 6-pin Header
Digilent Female Right Angle 6-pin Header
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

case_1_uFh1zlnBII.stl

Cover

To create a small case for our system, I used Tinkercad to draw a case and print it in a 3D printer.

Schematics

Circuit diagram of the station

This is a very easy circuit to recreate. At first solder the ATtiny85, the OLED display and the BME280 onto the PCB. I soldered female pin headers to flash the ATtiny after it is on the PCB.

After finishing the first task, you can now solder the wires according the circuit diagram. Please prepare on the PCB two wires for VCC and GND of the Micro USB.

To get the smartphone work for us as a power supply, we need to activate the OTG. That means, that our smartphone can act as a host, if there is a male USB inserted into the female USB port of the phone. Therefore we need to connect the ID of the Micro USB Male Adapter with its GND.

After the soldering

First test

How to program the ATtiny85 with an Arduino Nano

I have used a Arduino Nano to program the ATtiny85 with the Arduino IDE. To not explode the frame out of this instruction, please see this site to program your ATtiny with your Arduino Nano.

https://arduinodiy.wordpress.com/2012/02/28/program-an-attiny-with-an-arduino-nano/

Code

Code for the system

Arduino
After building up the circuit, I have coded this script to get the system run. The libraries I have used are: TinyWireM.h, Tiny4kOLED.h and MyBME280.h
#include <TinyWireM.h>
#include <Tiny4kOLED.h>
#include <MyBME280.h>

#define BME280_I2cAdd 0x76 //I2C-Adresse

MyBME280 BME(BME280_I2cAdd);

float t, d, f;


void setup() {
    
  oled.begin();
  oled.clear();
  oled.on();
  TinyWireM.begin();
  BME.init();
}

void loop() {
  t = BME.readTemp();
  d = BME.readPress();
  f = BME.readHumidity();

  oled.setFont(FONT6X8);
  oled.setCursor(0, 0);
  oled.print("Temp.: ");
  oled.print(t);
  oled.println(" 'C");
  oled.print("Druck: ");
  oled.print(d);
  oled.println(" mBar");
  oled.print("Fcht.: ");
  oled.print(f);
  oled.println(" %");
  oled.println(" . . . . . . . . . . ");
  oled.println(". . . . . . . . . . .");
}

Credits

MrNacho

MrNacho

0 projects • 0 followers

Comments

Add projectSign up / Login