Skip to content

Commit

Permalink
V3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
velbn committed Mar 27, 2019
1 parent 0149b1a commit 9eab3e4
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 82 deletions.
26 changes: 15 additions & 11 deletions EarthListener3v3_final.ino → EarthListener3v4_final.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Based on examples by Adafruit, SparkFun, J. Steinlage and Tom Igoe
See tab 'info_and_refs' for more documentation
******************************************************************************/
String SWversion = "v3.3";
String SWversion = "v3.4";

/***************************************/
/* ---------- DECLARATIONS ----------- */
Expand All @@ -14,16 +14,16 @@ String SWversion = "v3.3";
#include <EEPROM.h> // Library to read & store info in EEPROM long term memory

/* --- Local Libraries --- */
#include "src\Adafruit-GFX-Library\Adafruit_GFX.h" // Core graphics library by Adafruit
#include "src\Adafruit-GFX-Library\Fonts\FreeSans9pt7b.h"// Font FreeSans 9pts (as an alternative for basic font)
#include "src\AS3935_I2C_PSImod\AS3935_I2C_PSImod.h" // Specific lib for AS3935 sensor (mod by PSI to choose IRQ pin myself)
#include "src\I2C\I2C.h" //I2C library for AS3935 lib
#include "src\MCUFRIEND_kbv\MCUFRIEND_kbv.h" // TFT library by David Prentice
#include "src\Adafruit-GFX-Library\Adafruit_GFX.h" // Core graphics library by Adafruit
#include "src\Adafruit-GFX-Library\Fonts\FreeSans9pt7b.h" // Font FreeSans 9pts (as an alternative for basic font)
#include "src\AS3935_I2C_PSImod\AS3935_I2C_PSImod.h" // Specific lib for AS3935 sensor (mod by PSI to choose IRQ pin myself)
#include "src\I2C\I2C.h" // I2C library for AS3935 lib
#include "src\MCUFRIEND_kbv\MCUFRIEND_kbv.h" // TFT library by David Prentice
#include "src\SDmega\SDmega.h" // SD library (mod by PSI to work with MEGA & TFT SD card shield)
#include "src\SparkFun_BME280\src\SparkFunBME280.h" // BME280 library by SparkFun
#include "src\SparkFun_CCS811\src\SparkFunCCS811.h" // CCS811 library by SparkFun
#include "src\TFTLCD-Library\Adafruit_TFTLCD.h" // Hardware-specific library for TFT screen by Adafruit
#include "src\TouchScreen\TouchScreen.h" // TouchScreen library by Adafruit
#include "src\SparkFun_BME280\src\SparkFunBME280.h" // BME280 library by SparkFun
#include "src\SparkFun_CCS811\src\SparkFunCCS811.h" // CCS811 library by SparkFun
#include "src\TFTLCD-Library\Adafruit_TFTLCD.h" // Hardware-specific library for TFT screen by Adafruit
#include "src\TouchScreen\TouchScreen.h" // TouchScreen library by Adafruit
#include "bitmaps.h" // Icon library (local, hence the "")


Expand Down Expand Up @@ -164,6 +164,11 @@ int slideshowTimer = 5; //time (in seconds) to show each slide
unsigned long timeStartSlide = 0; //time when slide was first shown;


/* --- metric / imperial switch --- */
boolean MetricON; //boolean to check if values of temperature and lightning distance are set in celcius/km or fahrenheit/miles => can be modified via TFT interface
int MetricON_EEPROMaddr = 2; // address to store this value in long term memory (EEPROM)


/***************************************/
/* ----------- LOOP CODE ------------ */
/***************************************/
Expand Down Expand Up @@ -204,7 +209,6 @@ void loop(void)
AMBIENTPRESSURE_BME280_c = AMBIENTPRESSURE_BME280 / 100; //convert Pa to mBar
ALTITUDE_BME280 = myBME280.readFloatAltitudeMeters();
TEMP_BME280 = myBME280.readTempC();

//compensate temp & humi data
TEMP_BME280 = TEMP_BME280 + TEMP_comp;
if(HUMIDITY_BME280 <= (100 - HUMI_comp)) //make sure we don't have values > 100%
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
EARTH LISTENER


Ever wondered how good the air quality is in your living room? Or do you need proof of why you fall asleep in a non-ventilated meeting room after 3 hours? Look no further! This DIY experimental kit has all the answers!
The Earth Listener is an Arduino based sensor device that reads multiple environmental values to indicate the air quality. This kit is assembled in 15 minutes and you don’t need a soldering iron! Just connect the parts and wires, put everything in the case and connect it to a 5V USB socket. The Mega development board is pre-programmed and shows eCO2, TVOC (particles in the air), barometric pressure, temperature and humidity values onto the TFT touchscreen. To top thing off, the Earth Listener also contains a lightning detection sensor. If lightning (or electronic discharge) is detected, the Earth Listener will give an alarm tone and log how far the lightning is located. Since everything is open source, you can add an additional 6 sensors to the Earth Listener via the sensor shield. Logging is possible via the micro SD card (not included).


More info here: https://www.vellemanformakers.com/shop/00/00-10/00-10-15/earth-listener/
Buy it here: https://www.vellemanformakers.com/earth-listener/
Follow the tutorial here: https://manuals.velleman.eu/category.php?id=378

Changelog v3.4
- logo Velleman updated
- support for imperial units now available via setup menu
64 changes: 32 additions & 32 deletions bitmaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -1162,42 +1162,42 @@ static const uint8_t tvoc_65x50[] PROGMEM = {
};

static const uint8_t Velleman_114x36[] PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xbf,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,
0x00,0x00,0x00,0x00,0xf3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xff,
0x7c,0x1e,0x03,0xc0,0xf3,0xc0,0xfc,0x1f,0xf8,0xf8,0x0f,0xfe,0x7f,0xe5,0xff,
0x7c,0x1e,0x0f,0xf0,0xf3,0xc1,0xff,0x1f,0xff,0xfc,0x1f,0xfe,0x7f,0xf6,0xff,
0x3e,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,0x3f,0xfc,0xf3,0xcf,0xff,0x9e,0x1e,0x3c,0x7f,0xfe,0xf8,0xf0,0x3f,
0x00,0xfe,0x3f,0xf8,0xf3,0xc7,0xff,0x9e,0x1e,0x3c,0x7f,0xfe,0xf8,0xf0,0x3f,
0x00,0x7e,0x1f,0xf0,0xf3,0xc3,0xfe,0x1e,0x1e,0x3c,0x3f,0xfe,0xf8,0xf0,0x3f,
0x00,0x3e,0x03,0xc0,0xf3,0xc0,0x78,0x1e,0x1e,0x3c,0x07,0xbe,0xf8,0xf0,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x3f,0xff,0xfc,0xfd,0xf1,0xfd,0xf9,0x13,0xf3,0xef,0xff,0xff,0xf0,0x3f,
0x00,0x3f,0xff,0xfc,0xfd,0xf1,0xfd,0xfd,0x13,0xfb,0xef,0xff,0xff,0xf0,0x3f,
0x00,0x00,0x00,0x08,0x8d,0x81,0x24,0x0d,0x13,0x1a,0x08,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x08,0x8d,0x81,0x25,0xfd,0xfb,0xfa,0x0f,0xc0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x08,0x8d,0x81,0x25,0x8d,0x0b,0x02,0x00,0xc0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x08,0xcd,0x81,0x25,0x8d,0x0b,0x02,0x00,0xc0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x08,0xfd,0x81,0x25,0xfd,0x0b,0xfa,0x0f,0xc0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x3f,
0x00,0x3f,0xff,0xff,0xdf,0xef,0xe3,0x7f,0x3f,0xbe,0x1f,0xff,0xff,0xf8,0x3f,
0x00,0x3f,0xff,0xff,0xdf,0xcf,0xe3,0x7f,0x3f,0xbe,0x1f,0xff,0xff,0xf0,0x3f,
0x00,0x00,0x00,0x30,0xd8,0x0c,0x23,0x63,0x20,0x30,0x18,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0xd8,0x08,0x23,0x7f,0x20,0x30,0x1f,0xe0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0xd8,0x08,0x23,0x6b,0x20,0x30,0x0b,0xe0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0xd8,0x0c,0x63,0x60,0x30,0x38,0x00,0x60,0x00,0x00,0x3f,
0x00,0x00,0x00,0x3f,0xd8,0x0f,0xe3,0x7f,0x3f,0xbf,0xdf,0xe0,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
0x00,0x00,0x00,0x30,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
};

static const uint8_t EarthListener_200x150[] PROGMEM = {
Expand Down
145 changes: 111 additions & 34 deletions functions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void showScreen(int screenNr)
{
//tft.fillScreen(BLACK); //clear screen
//we only have to clear part of the screen (startX, startY, width, height, colour)
tft.fillRect(10,70,310,170,BLACK);
tft.fillRect(10,60,310,180,BLACK);
//print menu buttons
printMenuBtn();
}
Expand Down Expand Up @@ -337,30 +337,41 @@ void showScreen(int screenNr)
tft.setFont(); //standard system font
tft.setTextSize(2);
tft.setTextColor(GREYY,BLACK);
tft.setCursor(20, 80);
tft.setCursor(20, 70);
tft.print("Buzzer on/off");
tft.setCursor(20, 130);
tft.setCursor(20, 115);
tft.print("Slideshow timer: "); tft.print(slideshowTimer); if(slideshowTimer < 10){tft.print(" ");}
tft.setCursor(20, 180);
tft.setCursor(20, 160);
tft.print("Indoor/outdoor use");
tft.setCursor(20, 205);
tft.print("Metric/Imperial");
//print icons (according to state)
if(BuzzerEnabled)
{
showbgd(257, 75, slider_on_44x27, 44, 27, GREYY, BLACK);
showbgd(257, 65, slider_on_44x27, 44, 27, GREYY, BLACK);
}
else
{
showbgd(257, 75, slider_off_44x27, 44, 27, GREYY, BLACK);
showbgd(257, 65, slider_off_44x27, 44, 27, GREYY, BLACK);
}
showbgd(255, 125, arrows_47x26, 47, 26, GREYY, BLACK);
showbgd(255, 110, arrows_47x26, 47, 26, GREYY, BLACK);
if(AS3935_OUTDOORS)
{
showbgd(257, 175, slider_off_44x27, 44, 27, GREYY, BLACK);
showbgd(257, 155, slider_off_44x27, 44, 27, GREYY, BLACK);
}
else
{
showbgd(257, 175, slider_on_44x27, 44, 27, GREYY, BLACK);
showbgd(257, 155, slider_on_44x27, 44, 27, GREYY, BLACK);
}
if(MetricON)
{
showbgd(210, 200, slider_on_44x27, 44, 27, GREYY, BLACK);
}
else
{
showbgd(210, 200, slider_off_44x27, 44, 27, GREYY, BLACK);
}

//control LED
controlLED('0'); //off
//control Logo
Expand Down Expand Up @@ -479,11 +490,26 @@ void showScreen(int screenNr)
controlLED('R');
controlLogo(RED);
}
if(TEMP_BME280 < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("C");

if(MetricON)
{
if(TEMP_BME280 < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("C");
}
else
{
float TEMP_BME280_F = ((TEMP_BME280 * 9)/5 + 32);
if(TEMP_BME280_F < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280_F,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("F");
}


/*
//print scale with fillRect(startX, startY, width, height, color)
tft.fillRect( 10, 175, 33, 18, GREY);
Expand All @@ -508,12 +534,25 @@ void showScreen(int screenNr)
tft.drawLine(Xindic, 175, Xindic, 198, WHITE);
//print values of scale
tft.setTextSize(1);
tft.setCursor(10, 165); tft.setTextColor(GREY,BLACK); tft.print("-5");
tft.setCursor(45, 165); tft.setTextColor(BLUE,BLACK); tft.print("0");
tft.setCursor(167, 165); tft.setTextColor(GREEN,BLACK); tft.print("19");
tft.setCursor(207, 165); tft.setTextColor(YELLOW,BLACK); tft.print("25");
tft.setCursor(248, 165); tft.setTextColor(RED,BLACK); tft.print("31");
tft.setCursor(295, 165); tft.setTextColor(RED,BLACK); tft.print("40");

if(MetricON)
{
tft.setCursor(10, 165); tft.setTextColor(GREY,BLACK); tft.print("-5");
tft.setCursor(45, 165); tft.setTextColor(BLUE,BLACK); tft.print("0");
tft.setCursor(167, 165); tft.setTextColor(GREEN,BLACK); tft.print("19");
tft.setCursor(207, 165); tft.setTextColor(YELLOW,BLACK); tft.print("25");
tft.setCursor(248, 165); tft.setTextColor(RED,BLACK); tft.print("31");
tft.setCursor(295, 165); tft.setTextColor(RED,BLACK); tft.print("40");
}
else
{
tft.setCursor(10, 165); tft.setTextColor(GREY,BLACK); tft.print("23");
tft.setCursor(45, 165); tft.setTextColor(BLUE,BLACK); tft.print("32");
tft.setCursor(167, 165); tft.setTextColor(GREEN,BLACK); tft.print("66");
tft.setCursor(207, 165); tft.setTextColor(YELLOW,BLACK); tft.print("77");
tft.setCursor(248, 165); tft.setTextColor(RED,BLACK); tft.print("88");
tft.setCursor(295, 165); tft.setTextColor(RED,BLACK); tft.print("104");
}
break;


Expand Down Expand Up @@ -745,12 +784,25 @@ void lightningscreen()
{
uint8_t lightning_dist_km = lightX.AS3935_GetLightningDistKm();
Serial.print("Lightning detected! Distance to strike: ");
Serial.print(lightning_dist_km);
Serial.println("KM");
lastErrorLine1 = "Lightning detected! ";
lastErrorLine2 = "Distance to strike:";
lastErrorLine2 += lightning_dist_km;
lastErrorLine2 += "KM ";

if(MetricON)
{
Serial.print(lightning_dist_km);
Serial.println("km");
lastErrorLine2 += lightning_dist_km;
lastErrorLine2 += "km ";
}
else
{
uint8_t lightning_dist_miles = lightning_dist_km / 1.609344;
Serial.print(lightning_dist_miles);
Serial.println("mi");
lastErrorLine2 += lightning_dist_miles;
lastErrorLine2 += "mi ";
}

tft.println(lastErrorLine1);
tft.setCursor(35, 98);
tft.println(lastErrorLine2);
Expand Down Expand Up @@ -882,11 +934,24 @@ void printValues()
{
tft.setTextColor(RED,BLACK);
}
if(TEMP_BME280 < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("C ");

if(MetricON)
{
if(TEMP_BME280 < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("C ");
}
else
{
float TEMP_BME280_F = ((TEMP_BME280 * 9)/5 + 32);
if(TEMP_BME280_F < 10){ tft.print(" "); } //add leading spaces
tft.print(TEMP_BME280_F,1);
tft.print(" ");
tft.print((char)247); //to print the ° symbol
tft.println("F");
}

//Humidity
tft.setCursor(140, 200);
Expand Down Expand Up @@ -1136,23 +1201,29 @@ void inputControl()
toggleBuzzer();
}
//check indoor/outdoor button
else if( (Xpos > 50) && (Xpos < 85) && (Ypos > 190) && (Ypos < 235) )
else if( (Xpos > 70) && (Xpos < 105) && (Ypos > 190) && (Ypos < 235) )
{
//Serial.println("Touch on indoor/outdoor button!");
toggleIndoor();
}
//check Metric/Imperial button
else if( (Xpos > 0) && (Xpos < 45) && (Ypos > 160) && (Ypos < 200) )
{
//Serial.println("Touch on °C/°F button!");
toggleMetric();
}
//check arrow left
else if( (Xpos > 110) && (Xpos < 150) && (Ypos > 190) && (Ypos < 208) )
else if( (Xpos > 125) && (Xpos < 165) && (Ypos > 190) && (Ypos < 208) )
{
//Serial.println("Touch on arrow left!");
slideshowTimer--;
if(slideshowTimer <1){slideshowTimer = 1;}

}
//check arrow right
else if( (Xpos > 110) && (Xpos < 150) && (Ypos > 214) && (Ypos < 235) )
else if( (Xpos > 125) && (Xpos < 165) && (Ypos > 214) && (Ypos < 235) )
{
//Serial.println("Touch on arrow right!");
//Serial.println("Touch on arrow right!");
slideshowTimer++;
if(slideshowTimer > 60){slideshowTimer = 60;}
}
Expand Down Expand Up @@ -1277,6 +1348,12 @@ void toggleBuzzer()
EEPROM.write(Buzzer_EEPROMaddr, BuzzerEnabled);
}

//check state of MetricON
void toggleMetric()
{
if(MetricON) { MetricON = false; } else { MetricON = true; }
EEPROM.write(MetricON_EEPROMaddr, MetricON);
}

//check status of indoor mode & toggle + write to long term memory (so if you loose power, we still know what you want)
void toggleIndoor()
Expand All @@ -1288,7 +1365,7 @@ void toggleIndoor()
tft.setFont(); //standard system font
tft.setTextSize(2);
tft.setTextColor(RED,BLACK);
tft.setCursor(20, 180);
tft.setCursor(20, 160);
tft.print("Please reboot! ");
delay(800);
}
Expand Down
Loading

0 comments on commit 9eab3e4

Please sign in to comment.