I will switch the heating on if the sensor say i'm under a defined Temp.
but i have a Problem with the Relay.
Hi I'm use the following parts.
ATOM Lite
https://docs.m5stack.com/#/en/core/atom_lite
HUB
https://docs.m5stack.com/#/en/unit/hub
ENV II
https://docs.m5stack.com/#/en/unit/envII
Relay:
https://docs.m5stack.com/#/en/unit/relay
- i have connected the HUB with the Atom Lite
- i have connected the ENV II with the HUB
itis working with this Code.
#include "M5Atom.h"
#include <Wire.h>
#include "Adafruit_Sensor.h"
#include <Adafruit_BMP280.h>
#include "SHT3X.h"
SHT3X sht30;
Adafruit_BMP280 bme;
float tmp = 0.0;
float hum = 0.0;
float pressure = 0.0;
void setup()
{
M5.begin(true, false, true);
Wire.begin(26, 32);
Serial.println(F("ENV Unit(SHT30 and BMP280) test..."));
while (!bme.begin(0x76))
{
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
}
}
void loop() {
pressure = bme.readPressure();
if(sht30.get()==0)
{
tmp = sht30.cTemp;
hum = sht30.humidity;
}
Serial.printf("Temperature: %2.2f*C Humidity: %0.2f%% Pressure: %0.2fPa\r\n", tmp, hum, pressure);
digitalWrite(26, HIGH);
delay(500);
digitalWrite(26, LOW);
delay(500);
delay(100);
}
After i connect the Relay to the HUB nothing is working.
I also have a PbHUB, would it work with the PbHUB?
Do you have an Code example with the Atom Lite?
thank you