Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. michlb1982
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by michlb1982

    • michlb1982

      DHT12 + 2Relay + 2Button - Combining Problem
      Development • • michlb1982  

      14
      0
      Votes
      14
      Posts
      1791
      Views

      rejoe2

      @michlb1982 Congratulations also from my side ! One additional remark: In case you want to use more relays and buttons, you may hav a closer look to the use of array functions. Good, but rather complex example: https://forum.mysensors.org/post/51488
    • michlb1982

      Mini Pro + DHT12 + NRF24L01+ SMD
      Hardware • • michlb1982  

      12
      0
      Votes
      12
      Posts
      2721
      Views

      gohan

      That's odd... Unless that smd version has different voltage requirements, the nrf24 should fry with 5v
    • michlb1982

      Mysensort mit DHT12 (i2C)
      Hardware • • michlb1982  

      3
      0
      Votes
      3
      Posts
      2420
      Views

      michlb1982

      Well i did it... i've got a working MYSENSOR with DHT12... here the Code ... its not nice but it works... // Enable debug prints #define MY_DEBUG // Define Node ID #define MY_NODE_ID 128 //#define MY_REPEATER_FEATURE // Enable and select radio type attached #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> #include <DHT12.h> #include <Wire.h> DHT12 dht12; #define SENSOR_TEMP_OFFSET 0 // Sleep time between sensor updates (in milliseconds) // Must be >1000ms for DHT22 and >2000ms for DHT11 static const uint64_t UPDATE_INTERVAL = 30000; static const uint8_t FORCE_UPDATE_N_READS = 10; #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; bool metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); void presentation() { // Send the sketch version information to the gateway sendSketchInfo("DHT12", "1.1"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); //metric = getControllerConfig().isMetric; } void setup() { Wire.begin(); } void loop() { // Force reading sensor, so it works also after sleep() //dht12.readSensor(true); // Get temperature from DHT library float temperature = dht12.readTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { // Only send temperature if it changed since the last measurement or if we didn't send an update for n times lastTemp = temperature; // apply the offset before converting to something different than Celsius degrees temperature += SENSOR_TEMP_OFFSET; if (!metric) { temperature = dht12.readTemperature(); } // Reset no updates counter nNoUpdatesTemp = 0; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { // Increase no update counter if the temperature stayed the same nNoUpdatesTemp++; } // Get humidity from DHT library float humidity = dht12.readHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { // Only send humidity if it changed since the last measurement or if we didn't send an update for n times lastHum = humidity; // Reset no updates counter nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG Serial.print("H: "); Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } // Sleep for a while to save energy sleep(UPDATE_INTERVAL); //wait(UPDATE_INTERVAL); //for repeaters } i Used this library: https://github.com/Bobadas/DHT12_library_Arduino/blob/master/README.md here the datasheet of the dht12: http://www.robototehnika.ru/file/DHT12.pdf
    • michlb1982

      Compiling Problems since Update to 1.5
      Troubleshooting • problems compiling release 1.5 • • michlb1982  

      3
      0
      Votes
      3
      Posts
      1471
      Views

      Dirk_H

      THanks! it worked for me too! @hek Maybe we should put a small hint about this (first delete old MySensors 1.4) on the Downloadpage?
    • michlb1982

      Magnetic field detection
      Feature Requests • • michlb1982  

      5
      0
      Votes
      5
      Posts
      3887
      Views

      michlb1982

      well, the promised curcuit...Windrichtung-AS5040-Mysensor.pdf Windrichtung.fzz
    • michlb1982

      2 or more DHT11 - Sensors on one Arduino NANO MYSENSOR
      Development • mysensors dht11 • • michlb1982  

      11
      0
      Votes
      11
      Posts
      12903
      Views

      Sparkman

      @michlb1982 A couple of things, you put the device to sleep so while it's asleep, it won't respond to the commands to change the relays. Since you are combining relays and sensors, you need to keep the unit awake and find a different way to send the sensor data occasionally. For the relay status, read the comments in the sketch. You are saving the relay state and then reading that on startup. You can eliminate all of that code and just set the relay to off in the setup section. Cheers Al