Before getting started make sure doyou have
1 Agrumino Kit
1 Micro usb cable for upload sketch with Arduino Ide
1 Adafruit BME680
1 Cable 4 pin Male Jumper to Grove 4 pin
1 Breadboard
Setup Page https://bit.ly/3qgYQ43
Step 1: Description and Connection
In the first you need to connect Agrumino Lemon like a Fritzing example
This will allow us to acquire data with high precision:
- Temperature (° C)
- Humidity (%)
- Atmospheric pressure (hPa)
- VOC (KOhms)
- Altitude (Mt +/- 10Mt accurancy)
- Air quality
- Indoor air quality
- Home automation and control
- Internet of things
- Weather forecast
- GPS enhancement (e.g. time-to-first-fix improvement, dead reckoning, slope detection)
- Indoor navigation (change of floor detection, elevator detection)
- Outdoor navigation, leisure and sports applications
- Vertical velocity indication (rise/sink speed)
- Handsets such as mobile phones, tablet PCs, GPS devices
- Wearables
- Home weather stations
- Smart watches
- Navigation systemsGaming, e.g. flying toys
Now import sketch from link and upload them with Arduino IDE on your Agrumino Lemon
/*AgruminoPocketWeatherStation.ino - Sample project for Agrumino Lemon.
Created by gabriele.foddis@lifely.cc - Stay tuned on lifely.cc -
This sketch read and send all data in serial monitor.
Have fun !!!*/
#include <Wire.h>
#include <SPI.h>
#include <Agrumino.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
#define REFRESH_TIME 5000 //////ms
#define SEALEVELPRESSURE_HPA (1013.25)///change value
#define SERIAL_BAUD 115200
Adafruit_BME680 bme; // I2C connection
Agrumino agrumino;
void setup() {
agrumino.setup();
agrumino.turnBoardOn();
Serial.begin(SERIAL_BAUD);
while (!Serial);
Serial.println("BME680 test in progress");
if (!bme.begin()) {
Serial.println("Could not find a valid BME680 sensor, check wiring!");
while (1);
}
// Set up oversampling and filter initialization
bme.setTemperatureOversampling(BME680_OS_8X);
bme.setHumidityOversampling(BME680_OS_2X);
bme.setPressureOversampling(BME680_OS_4X);
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
bme.setGasHeater(320, 150); // 320*C for 150 ms
}
void loop() {
boolean isAttachedToUSB = agrumino.isAttachedToUSB();
boolean isBatteryCharging = agrumino.isBatteryCharging();
boolean isButtonPressed = agrumino.isButtonPressed();
float temperature = agrumino.readTempC();
unsigned int soilMoisture = agrumino.readSoil();
unsigned int soilMoistureRaw = agrumino.readSoilRaw();
float illuminance = agrumino.readLux();
float batteryVoltage = agrumino.readBatteryVoltage();
Serial.println("Data from Agrumino Lemon");
Serial.println("isAttachedToUSB: " + String(isAttachedToUSB));
Serial.println("isBatteryCharging: " + String(isBatteryCharging));
Serial.println("isButtonPressed: " + String(isButtonPressed));
Serial.println("Temperature: " + String(temperature) + "°C");
Serial.println("SoilMoisture: " + String(soilMoisture) + "%");
Serial.println("SoilMoisture: " + String(soilMoistureRaw) + "Mv");
Serial.println("illuminance : " + String(illuminance) + " lux");
Serial.println("batteryVoltage : " + String(batteryVoltage) + " V");
Serial.println("End");
Serial.println("*********************");
if (! bme.performReading()) {
Serial.println("Error with perform reading :(");
return;
}
Serial.println("Value from Bme680");
Serial.print("Temperature = ");
Serial.print(bme.temperature);
Serial.println(" °C");
Serial.print("Pressure = ");
Serial.print(bme.pressure / 100.0);
Serial.println(" hPa");
Serial.print("Humidity = ");
Serial.print(bme.humidity);
Serial.println(" %");
Serial.print("Gas = ");
Serial.print(bme.gas_resistance / 1000.0);
Serial.println(" KOhms");
Serial.print("Approx. Altitude = ");
Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
Serial.println(" mt");
Serial.println("End");
Serial.println("*********************");
delay(REFRESH_TIME);
}
Step 3: Show data on your Serial monitorWith this simple example you can build a very accurate pocket Weather Station.
You can also connect a small display (I2C) to see acquired data, or send the data with Mqtt to your Smartphone.
This should be seen as the start of your larger project,.
I hope it will be interesting for you !!
Do you have original ideas that you can realize with Agrumino Lemon ???
Write me!!!!
Thank you....
See you soon!!!
Comments
Please log in or sign up to comment.