Navigation

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

    Topics created by titvs

    • titvs

      Temperature + Humidity with OLED
      Development • • titvs  

      3
      1
      Votes
      3
      Posts
      2088
      Views

      titvs

      @mfalkvidd hmm, that’s a nice suggestion... I don’t have motion sensors where they are but maybe I can integrate it on the actual node... Will give it some thought. Thanks!
    • titvs

      [SOLVED] RFM69HW Issues
      Troubleshooting • • titvs  

      2
      0
      Votes
      2
      Posts
      673
      Views

      titvs

      Did some testing today and i can now confirm that this issue with internal messages not getting delivered to the controller is now FIXED with commit 5d159a6 . Thanks @tekka
    • titvs

      The Repeater Stick
      Enclosures / 3D Printing • • titvs  

      3
      3
      Votes
      3
      Posts
      1248
      Views

      titvs

      @alowhum Good find!
    • titvs

      Repeater drops nodes
      Troubleshooting • • titvs  

      34
      1
      Votes
      34
      Posts
      3073
      Views

      titvs

      @tekka Here it is: REPEATER LOG It seems to be working ok but there are still some NACKs on the log. Radio issues perhaps? Neverthless, im not getting the node dropouts i got with the 2.3.0 version...
    • titvs

      Case for a small AC-DC converter
      Enclosures / 3D Printing • • titvs  

      3
      0
      Votes
      3
      Posts
      1200
      Views

      titvs

      Its a very nice one and i also like designs without screws. But since im not very confortable with my printer tolerances, im not thinking (at the moment) with that kind of parts inter-connections… And i have a pack of those tiny screws…
    • titvs

      Enclosure for Temp + Humidity node with OLED display
      Enclosures / 3D Printing • • titvs  

      6
      1
      Votes
      6
      Posts
      2903
      Views

      titvs

      @pihome Sure! Its no trade secret. Ive used the U8g2lib for the display which is connected at A4 and A5, as defined in the code. You should power the display directly to a good power source (3.3 ~ 5.5V) since you are also powering a radio module. Its basically the temp+hum sketch where Ive included some lines of code for the display. At boot it displays the message "Connecting…". If the gateway or repeater is offline or out of range, it wont do anything else unless MY_TRANSPORT_WAIT_READY_MS is of a different value than the default (not pretty sure but ive read that the default is to wait forever). It will then display temp + hum with a small chain icon at the bottom (connected). If the gateway goes offline it displays "Disconnected!" Im not sure if this is bug free, so feel free to debug and add new functionalities. // Enable debug prints //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 //#define MY_RS485 #define MY_RF24_CHANNEL 1 ////////////// #define MY_RF24_PA_LEVEL RF24_PA_HIGH ////////////// #include <SPI.h> #include <MySensors.h> #include <DHT.h> #include <U8g2lib.h> ////////////////////// #include <Wire.h> ///////////////////////// U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, A5, A4); // U8G2 Constructor (PINS: A5 - Clock SCL ; A4 - Data SDA) // Set this to the pin you connected the DHT's data pin to #define DHT_DATA_PIN 3 // Set this offset if the sensor has a permanent small offset to the real temperatures. // In Celsius degrees (as measured by the device) #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 = 60000; // Force sending an update of the temperature after n sensor reads, so a controller showing the // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that // the value didn't change since; // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms] 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); DHT dht; void before(){ u8g2.begin(); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); u8g2.drawStr(38,15,"OLED"); u8g2.drawStr(15,35,"Temp+Hum"); u8g2.drawStr(46,60,"v1.2"); } while ( u8g2.nextPage() ); delay(3000); u8g2.clear(); u8g2.firstPage(); do { u8g2.drawStr(3, 32, "Connecting..."); } while ( u8g2.nextPage() ); } void presentation() { // Send the sketch version information to the gateway sendSketchInfo("TEMPHUM_OLED", "1.2"); // 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() { u8g2.clear(); dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) { u8g2.firstPage(); do { u8g2.setFont(u8g2_font_haxrcorp4089_tr); // 7 PIXEL HIGHT u8g2.drawStr(1,12,"WARNING: UPDATE_INTERVAL"); u8g2.drawStr(1,24,"is smaller than supported by"); u8g2.drawStr(1,36,"the sensor!"); } while ( u8g2.nextPage() ); delay(4000); } // Sleep for the time of the minimum sampling period to give the sensor time to power up // (otherwise, timeout errors might occure for the first reading) sleep(dht.getMinimumSamplingPeriod()); } void loop() { while (transportCheckUplink() == false){ u8g2.firstPage(); do { u8g2.setFont(u8g2_font_helvR14_tf); // 14 px height u8g2.drawStr(3, 32, "Disconnected!"); } while ( u8g2.nextPage() ); } // Force reading sensor, so it works also after sleep() dht.readSensor(true); // Get temperature from DHT library float temperature = dht.getTemperature(); 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 = dht.toFahrenheit(temperature); } // 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 = dht.getHumidity(); 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++; } u8g2.firstPage(); do { u8g2.setFont(u8g2_font_fub30_tn); u8g2.setCursor(2, 35); u8g2.print(temperature, 1); u8g2.setFont(u8g2_font_inb16_mf); u8g2.drawGlyph(88, 35, 0x00b0); // degree u8g2.drawStr(100, 35, "C"); u8g2.setCursor(70, 60); u8g2.print(humidity, 0); u8g2.drawStr(100, 60, "%"); u8g2.setFont(u8g2_font_open_iconic_thing_2x_t); // 16 pix height u8g2.drawGlyph(45, 60, 0x0048); // drop u8g2.setFont(u8g2_font_open_iconic_www_2x_t); // 16 pix height u8g2.drawGlyph(2, 60, 0x004f); // CONNECTION ICON } while ( u8g2.nextPage() ); // Sleep for a while to save energy //sleep(UPDATE_INTERVAL); delay(UPDATE_INTERVAL); // POWERED NODE }
    • titvs

      Introductions and Range Issues
      Troubleshooting • • titvs  

      37
      0
      Votes
      37
      Posts
      3492
      Views

      Yveaux

      @titvs all grounds should be connected together, or you won't have a defined '0' level in your setup.