Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
M

Mr_sensor

@Mr_sensor
About
Posts
47
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    I'm not sure if this is the right place to ask. But it seems right to me :)
    Hi I have e few of the Easy/Newbie-pcb working for some time with good effort. One of them even in a shed at 20 - 25 meters in the garden which is fairly good isolated. Sending Temp/Hum/battery level. And the Gateway is in the house on the first floor behind a door in a wardrobe.

    Now I have a second shed which is behind the fist shed. Also very good isolated. The pcb I have in there is not reaching the gateway (it did before until the battery was empty).
    Can I have the pcb in the first shed also working as an extender, so the second pcb will be able to send out topics to the gateway as well? What to add to my code to achieve that?

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • What is loaded / running on the arduino?
    M Mr_sensor

    @mfalkvidd said in What is loaded / running on the arduino?:

    @mr_sensor you are correct that it is not possible to get the sketch from the Arduino.

    But all MySensors sketches have something like this:

    sendSketchInfo("TemperatureAndHumidity", "1.1");
    

    which identifies which type of sketch and the version of that sketch, every time the sensor is restarted. If you store your sketches in some version control system (git is most popular), keeping track of them becomes quite easy.

    See also https://forum.mysensors.org/topic/2203/method-to-reveal-sketch-inside-node-or-g-w for an earlier discussion on a similar topic.

    @mfalkvidd thanks for the reply. The sendSketchInfo is indeed helpfull will also read the link.

    General Discussion

  • What is loaded / running on the arduino?
    M Mr_sensor

    Just a question that is on my mind for some time now. When a sketch is loaded on a arduino (in my case a pro mini) how to see / find out what is on that board? Or is that even not possible?
    After some time running a node and building others in the mean time it is not always clear what is on the particular node. Dis I miss something basic here? Or is it just not possible getting the (sketch) info from the arduino?
    How are you dealing with it. Having a sketch named/ numbered for every node? Just wondering what is the best practise.

    General Discussion

  • Temperature sensor sketch only sending battery info to mqtt
    M Mr_sensor

    @gohan

    Well the NACKS are gone :) by setting the RF_24_PA_HIGH but still I do not get any temperature after the first one while starting up:

    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
    26 TSM:INIT
    28 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    36 TSM:INIT:STATID=4
    38 TSF:SID:OK,ID=4
    40 TSM:FPAR
    43 TSM:FPAR:STATP=0
    45 TSM:ID
    47 TSM:ID:OK
    47 TSM:UPL
    1730 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    3739 TSM:UPL
    5421 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
    7430 TSM:UPL
    7452 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=OK:1
    7460 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    7467 TSF:MSG:PONG RECV,HP=1
    7471 TSM:UPL:OK
    7473 TSM:READY:ID=4,PAR=0,DIS=1
    7491 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    7499 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    7512 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0
    7530 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    9545 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
    9586 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
    9801 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
    9840 TSF:MSG:SEND,4-4-0-0,s=2,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
    9848 MCO:REG:REQ
    9861 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    9869 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    9875 MCO:PIM:NODE REG=1
    9877 MCO:BGN:STP
    9926 MCO:BGN:INIT OK,TSP=1
    911
    Child ID 2Battery Voltage: 3.06 V
    Battery Percent: 91 %
    10438 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:91
    10446 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    10452 TSF:TDI:TSL
    10455 MCO:SLP:WUP=-1
    10457 TSF:TRI:TSB
    831
    Child ID 2Battery Voltage: 2.79 V
    Battery Percent: 83 %
    10967 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:83
    10975 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    10981 TSF:TDI:TSL
    10983 MCO:SLP:WUP=-1
    10985 TSF:TRI:TSB
    830
    Child ID 2Battery Voltage: 2.79 V
    Battery Percent: 83 %
    11493 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    11501 TSF:TDI:TSL
    11503 MCO:SLP:WUP=-1
    11505 TSF:TRI:TSB
    833
    Child ID 2Battery Voltage: 2.80 V
    Battery Percent: 83 %
    12013 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    12021 TSF:TDI:TSL
    12023 MCO:SLP:WUP=-1
    12025 TSF:TRI:TSB
    830
    Child ID 2Battery Voltage: 2.79 V
    Battery Percent: 83 %
    12533 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    12541 TSF:TDI:TSL```
    Hardware sketch

  • Temperature sensor sketch only sending battery info to mqtt
    M Mr_sensor

    I have a newbie-pcb board with a Dallas temperature sensor attached. I mixed some sketches together to make it work.
    When starting the sensor the first time I can see all the actions performed. Reading temperature and battery percentage. But than after sleeping it is only reading and sending battery percentage (no voltage)? No temperature action is visible any-more. So, there must be a fault in my sketch which makes it read the temperature part only once? Any advice on this? Thanks.

    [code]
    
    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0: Henrik EKblad
     * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
     * 
     * DESCRIPTION
     * This sketch provides an example of how to implement a humidity/temperature
     * 
     * Dallas temperature sensor DS18B20
     *  
     * For more information, please visit:
     * http://www.mysensors.org/build/humidity
     * 
     HTU21D Humidity Sensor
     Hardware Connections (Breakoutboard to Arduino):
     -VCC = 3.3V
     -GND = GND
     -data  = D3 met pcb 470 uf resistor
     */
    
     
    #define MY_NODE_ID 4
    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached 
    #define MY_RADIO_NRF24
    //#define MY_RF24_PA_LEVEL RF24_PA_HIGH
    //#define MY_RADIO_RFM69
    //#define MY_RS485
     
    #include <MySensors.h> 
    //#include <Wire.h>
    #include <SPI.h>
    #include <OneWire.h>
    #include <DallasTemperature.h>
    
    
    // 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 COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
    // arrays to hold device address
    DeviceAddress insideThermometer;
    
    #define ONE_WIRE_BUS 3 // Pin where dallas sensor is connected 
    #define MAX_ATTACHED_DS18B20 1
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
    DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
    
    
    float lastTemperature[MAX_ATTACHED_DS18B20];
    int numSensors=0;
    bool receivedConfig = true;
    bool metric = true;
    
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_BATTERY 2
    #define CHILD_ID_VOLT 3
    //#define CHILD_ID_PRCNT 3
    
    float lastTemp;
    //float lastHum;
    
    uint8_t nNoUpdatesTemp;
    //uint8_t nNoUpdatesHum;
    //boolean metric = true;
    
    
    
    
    
    void presentation()  
    { 
     // Send the Sketch Version Information to the Gateway                                                                                                                     
      sendSketchInfo("Temperature Sensor", "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);
       present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
      metric = getControllerConfig().isMetric;
    
    // Fetch the number of attached temperature sensors  
      numSensors = sensors.getDeviceCount();
    
      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
         present(i, S_TEMP);
      }
       
    }
    
    int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
                                                                                                                                                      
    //unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)  60000                                                                                           
    static int oldBatteryPcnt = 0;                                                                                                                                                                        
                                                                                                                                                                   
                                                                                                                                                                            
    //Create an instance of the object                                                                                                                                          
    
      MyMessage msg(0,V_TEMP);                                                                                                                                                                                                                                                                                                                           
    //MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
    MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
    //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRC);
    
    
    void setup() {
        // Startup up the OneWire library
      sensors.begin();
    
         // use the 1.1 V internal reference
    #if defined(__AVR_ATmega2560__)
        analogReference(INTERNAL1V1);
    #else
        analogReference(INTERNAL);
    #endif
    
    // requestTemperatures() will not block current thread
      sensors.setWaitForConversion(false);
    
    } 
                                                                                                                                                                                                                                                                                                                                                     
    void loop()                                                                                                                                                                 
    {                                                                                                                                                                           
    
    
    // Fetch temperatures from Dallas sensors
      sensors.requestTemperatures();
    
      // query conversion time and sleep until conversion completed
      int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
      // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
      sleep(conversionTime);
    
      // Read temperatures and send them to controller 
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
    
        // Fetch and round temperature to one decimal
        float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
    
        // Only send data if temperature has changed and no error
        #if COMPARE_TEMP == 1
        if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
        #else
        if (temperature != -127.00 && temperature != 85.00) {
        #endif
    
          // Send in the new temperature
          send(msg.setSensor(i).set(temperature,1));
          // Save new temperatures for next compare
          lastTemperature[i]=temperature;
        }
      }
    
    
    // some delay here
      //delay(500);
    
       // get the battery Voltage
         
        int sensorValue = analogRead(BATTERY_SENSE_PIN);
        delay(500);
    #ifdef MY_DEBUG
        Serial.println(sensorValue);
    #endif
    
        // 1M, 470K divider across battery and using internal ADC ref of 1.1V
        // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
        // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
        // 3.44/1023 = Volts per bit = 0.003363075
        int batteryPcnt = sensorValue / 10;
    
    #ifdef MY_DEBUG
        float batteryV  = sensorValue * 0.003363075;
        Serial.print("Child ID ");
        Serial.print(CHILD_ID_BATTERY);
        Serial.print("Battery Voltage: ");
        Serial.print(batteryV);
        Serial.println(" V");
    
        Serial.print("Battery Percent: ");
        Serial.print(batteryPcnt);
        Serial.println(" %");
    #endif
    
        if (oldBatteryPcnt != batteryPcnt) {
            // Power up radio after sleep
                  
            sendBatteryLevel(batteryPcnt);
            oldBatteryPcnt = batteryPcnt;
        } 
                                                                                                                                                                          
      sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                           
    }
    [/code]```
    
    
    This is in the serial monitor:
    
    [code]```
    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
    26 TSM:INIT
    28 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    36 TSM:INIT:STATID=4
    38 TSF:SID:OK,ID=4
    40 TSM:FPAR
    43 TSM:FPAR:STATP=0
    45 TSM:ID
    47 TSM:ID:OK
    47 TSM:UPL
    1730 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    3739 TSM:UPL
    5421 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
    7430 TSM:UPL
    7477 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=OK:1
    7497 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    7503 TSF:MSG:PONG RECV,HP=1
    7507 TSM:UPL:OK
    7510 TSM:READY:ID=4,PAR=0,DIS=1
    7518 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    7526 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    7536 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0
    7557 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    11247 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=NACK:Temperature Sensor
    12939 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=1,st=NACK:1.1
    14628 !TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=2,st=NACK:
    16318 !TSF:MSG:SEND,4-4-0-0,s=2,c=0,t=30,pt=0,l=0,sg=0,ft=3,st=NACK:
    16324 MCO:REG:REQ
    18010 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=4,st=NACK:2
    21698 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=5,st=NACK:2
    21706 !TSM:READY:UPL FAIL,STATP
    25389 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
    29079 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=NACK:2
    31088 MCO:BGN:STP
    31137 MCO:BGN:INIT OK,TSP=1
    31141 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
    31148 TSF:TDI:TSL
    31150 MCO:SLP:WUP=-1
    31154 TSF:TRI:TSB
    903
    Child ID 2Battery Voltage: 3.04 V
    Battery Percent: 90 %
    31657 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=2,st=NACK:90
    31668 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    31674 TSF:TDI:TSL
    31676 MCO:SLP:WUP=-1
    31678 TSF:TRI:TSB
    31682 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
    31688 TSF:TDI:TSL
    31690 MCO:SLP:WUP=-1
    31692 TSF:TRI:TSB
    831
    Child ID 2Battery Voltage: 2.79 V
    Battery Percent: 83 %
    32202 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=3,st=OK:83
    32208 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    32217 TSF:TDI:TSL```
    Hardware sketch

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @gohan said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

    but this is RFM69 radio pcb not NRF24
    I know but I am using the nrf24 pcb.

    Do I need to add something like this when using the AP version?

    #define MY_RADIO_NRF24

    #define MY_RF24_PA_LEVEL RF24_PA_HIGH

    Or just #define MY_RADIO_NRF24

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @gohan Ok, what do you mean by "define HW" in code" ? This in my code:
    #define MY_RADIO_NRF24

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @mr_sensor said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

    @sundberg84 @gohan Ok thanks for the input I will order some of the extended ones :) and see if thing s will improve.

    The parts mentioned above arrived. I thought just swapping the radio's and see if there is any improvement. But it seems my devices are not happy with there new radio :) ? So are these new devices coming with the same pin-out and are they using the same library as the non amplified radio"s ? Or do I need to alter my sketches or wiring for it to work?

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @sundberg84 @gohan Ok thanks for the input I will order some of the extended ones :) and see if thing s will improve.

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @gohan said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

    I would get better quality nrf24 modules and using a PA LNA one on the gateway may also help. Sure the rfm69 at 433MHz can have a better wall penetration, but I think you can do with better radios. Look for CDEByte store on aliexpress, they have good radio modules. Also a poor quality power supply can reduce the effective range.
    If you want to try the RFM69 radios, you can "convert" the ones you have with this https://www.mysensors.org/hardware/nrf2rfm69

    So these would be better?
    https://nl.aliexpress.com/item/E01-ML01DP5-Ebyte-2-4GHz-20dBm-2100m-nRF24L01-SPI-Wireless-transceiver-module/32638720689.html?spm=a2g0s.13010208.99999999.336.T3AfNk
    https://nl.aliexpress.com/item/CDEBYTE-2PCS-Lot-E01-ML01D-Wireless-Transceiver-For-Arduino-nRF24L01-2-4GHz-Antenna-Module-For-Microcontroll/32803704874.html?spm=a2g0s.13010208.99999999.333.T3AfNk
    https://nl.aliexpress.com/item/CDEBYTE-2PCS-Lot-Special-promotions-1800-meter-long-distance-nRF24L01-PA-LNA-wireless-modules-with-PCB/32803720600.html?spm=a2g0s.13010208.99999999.330.T3AfNk

    If I use one with PA_LNA on my Gateway are the pin-out the same as for the nrf24l+ as in the mysensors gatweay example?
    Also there are models with nrf24l+PA what is the difference with the nrf24l+ ones?

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
    M Mr_sensor

    @sundberg84 said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

    Everything is going fine so im taking this to the next level... from test to produktion.
    This sensor might be my most important summer sensor from now on ;)
    A couple of days ago I had some friends over which gave me a beer cooler, garden edition.
    Its pretty much a barrel in the ground which cools the beer down... (a bit atleast).

    0_1500394205429_1.JPG

    I must say Im very impressed with the RFM69 so far... except the price, there has been no trouble at all. No repeaters, no capacitors, no fine tuning... nothing. Pretty much solder 'n' play!

    This node is burried in the far end on the garden (25m) and has to penetrate 3 concrete + 1brick wall to reach the GW in the celler... no problems, first try and bang!

    So far... the temperature in the cooler isnt very impressive, and I have only tried the first layer. I was afraid I would loose radio coverage if I put the sensors far down... but I will try.

    Cheers mates!

    Hi, nice set-up. I have been reading this and havong a "newbie" question. I have a Newbie PCB build with the Nrf24l01+ which seems to give (me) a poor range.
    So would that improve having a rfm69 instead? Or will just adding an antenna improve the reach (I have more or less the same outside distance and concrete wall/ flooring I'd liek to cross). Now I just have a reach for approx 8 meters and one concrete floor (inside the house)? Which is not very good (even my z-wave devices are preforming much better - outside at 20 mtr from the house.
    Can the nrf240 be improved or do I need teh rfm69 (or even using a LORA ?).

    OpenHardware.io mysensor easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 Ok did try with just the bare pro mini + the temp sensor + resistor on a breadboard powered with 3.3v from ftdi adapter.
    And guess what? Than I get the temperature reading :) So why is it not working on the board than? I Will check the soldering again and see if I can solder a new board.

    Dallas Temperature IC Control Library Demo
    Locating devices...Found 1 devices.
    Parasite power is: OFF
    Device 0 Address: 28FF5849011704D8
    Device 0 Resolution: 9
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE
    Temp C: 21.00 Temp F: 69.80
    Requesting temperatures...DONE ```
    
    So both sensor and arduino are working?
    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 I tried with other libraries, without success. Also changed the sensor for a new one, without any success. Only thing that made me wondering, now the sensor is on 3,3 volt? When looking at the net for samples, etc. some of them refer to 5volt? So could that be the problem here? Not providing 5 volt to the sensor?

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 I did measure some things. Also replaced the arduino to be sure that it was working (did nt make a difference)

    I found 3,3 volt between vcc and gnd on the sensor. Also between the data-pin of the sensor and the arduino there is continuity.
    The middle leg on the sensor and GND + VCC on the PCB is not resulting in any continuity(I am not really sure if I did measure it in the right way. It is a bit hard to get gnd + vcc on the multimeter pin together).

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @gohan Not a solder problem I think. This is no short on the board it is just the angel of the picture hiding the gap underneath. :)
    tried the same set-up with an other dallas sensor. still the same result.

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @dbemowsk said in 💬 Easy/Newbie PCB for MySensors:

    @mr_sensor And show a pic of the bottom of the board with the sensor.

    0_1519755501591_IMG_6065.jpg

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 I run the "single" sketch from temp library and this is what I get:

    Dallas Temperature IC Control Library Demo
    Locating devices...Found 0 devices.
    Parasite power is: OFF
    Unable to find address for Device 0
    Device 0 Address: 0000000000000000
    Device 0 Resolution: 0
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    Requesting temperatures...DONE
    Temp C: -127.00 Temp F: -196.60
    
    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 0_1519738543082_IMG_6049.jpg
    0_1519738618518_IMG_6041.jpg

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @sundberg84 Yes thanks I did so. But do not get any temp read out? Have al in space also the 4,7 k resistor.

    this is my sketch:

    [code]
    
    
    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0: Henrik EKblad
     * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
     * 
     * DESCRIPTION
     * This sketch provides an example of how to implement a humidity/temperature
     * 
     * Dallas temperature sensor DS18B20
     *  
     * For more information, please visit:
     * http://www.mysensors.org/build/humidity
     * 
     HTU21D Humidity Sensor
     Hardware Connections (Breakoutboard to Arduino):
     -VCC = 3.3V
     -GND = GND
     -data  = D3 met pcb 470 uf resistor
     */
    
     
    #define MY_NODE_ID 4
    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached 
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    //#define MY_RS485
     
    #include <MySensors.h>
    #include <OneWire.h>  
    //#include <Wire.h>
    #include <SPI.h>
    #include <DallasTemperature.h>
    
    // 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 COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
    
    #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
    #define MAX_ATTACHED_DS18B20 16
    //unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
    DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
    float lastTemperature[MAX_ATTACHED_DS18B20];
    int numSensors=0;
    bool receivedConfig = false;
    bool metric = true;
    
    #define CHILD_ID_TEMP 0
    #define CHILD_ID_BATTERY 1
    #define CHILD_ID_VOLT 2
    //#define CHILD_ID_PRCNT 3
    
    //float lastTemp;
    //float lastHum;
    
    //uint8_t nNoUpdatesTemp;
    //uint8_t nNoUpdatesHum;
    //boolean metric = true;
    
    
    
    
    void presentation()  
    { 
     // Send the Sketch Version Information to the Gateway                                                                                                                     
      sendSketchInfo("Temperature Sensor", "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);
       present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
      //metric = getControllerConfig().isMetric;
    
    // Fetch the number of attached temperature sensors  
      numSensors = sensors.getDeviceCount();
    
      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
         present(i, S_TEMP);
      }
       
    }
    
    int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
                                                                                                                                                      
    unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)  60000                                                                                           
    static int oldBatteryPcnt = 0;                                                                                                                                                                        
                                                                                                                                                                   
                                                                                                                                                                            
    //Create an instance of the object                                                                                                                                          
    
      MyMessage msg(0,V_TEMP);                                                                                                                                                                                                                                                                                                                           
    //MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
    MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
    //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRC);
    
    
    void setup() {
        // Startup up the OneWire library
      sensors.begin();
    
         // use the 1.1 V internal reference
    #if defined(__AVR_ATmega2560__)
        analogReference(INTERNAL1V1);
    #else
        analogReference(INTERNAL);
    #endif
    
    // requestTemperatures() will not block current thread
      sensors.setWaitForConversion(false);
    
    } 
                                                                                                                                                                                                                                                                                                                                                     
    void loop()                                                                                                                                                                 
    {                                                                                                                                                                           
    
    
    // Fetch temperatures from Dallas sensors
      sensors.requestTemperatures();
    
      // query conversion time and sleep until conversion completed
      int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
      // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
      sleep(conversionTime);
    
      // Read temperatures and send them to controller 
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
    
        // Fetch and round temperature to one decimal
        float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
    
        // Only send data if temperature has changed and no error
        #if COMPARE_TEMP == 1
        if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
        #else
        if (temperature != -127.00 && temperature != 85.00) {
        #endif
    
          // Send in the new temperature
          send(msg.setSensor(i).set(temperature,1));
          // Save new temperatures for next compare
          lastTemperature[i]=temperature;
        }
      }
    
    
    // some delay here
       delay(500);
    
       // get the battery Voltage
         
        int sensorValue = analogRead(BATTERY_SENSE_PIN);
        delay(500);
    #ifdef MY_DEBUG
        Serial.println(sensorValue);
    #endif
    
        // 1M, 470K divider across battery and using internal ADC ref of 1.1V
        // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
        // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
        // 3.44/1023 = Volts per bit = 0.003363075
        int batteryPcnt = sensorValue / 10;
    
    #ifdef MY_DEBUG
        float batteryV  = sensorValue * 0.003363075;
        Serial.print("Child ID ");
        Serial.print(CHILD_ID_BATTERY);
        Serial.print("Battery Voltage: ");
        Serial.print(batteryV);
        Serial.println(" V");
    
        Serial.print("Battery Percent: ");
        Serial.print(batteryPcnt);
        Serial.println(" %");
    #endif
    
        if (oldBatteryPcnt != batteryPcnt) {
            // Power up radio after sleep
                  
            sendBatteryLevel(batteryPcnt);
            oldBatteryPcnt = batteryPcnt;
        } 
                                                                                                                                                                          
      sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                           
    }
    [/code]```
    
    

    | / |_ / | ___ _ __ ___ ___ _ __ ___
    | |/| | | | _
    \ / _ \ _ \/ __|/ _ \|
    _/ __|
    | | | | |
    | || | / | | _ \ _ | | \�
    |
    | |
    |_
    , |/ ___|| ||/_/|| |/
    |
    __/ 2.2.0

    16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
    26 TSM:INIT
    28 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    36 TSM:INIT:STATID=4
    38 TSF:SID:OK,ID=4
    40 TSM:FPAR
    43 TSM:FPAR:STATP=0
    45 TSM:ID
    47 TSM:ID:OK
    47 TSM:UPL
    53 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    67 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    71 TSF:MSG:PONG RECV,HP=1
    75 TSM:UPL:OK
    77 TSM:READY:ID=4,PAR=0,DIS=1
    116 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
    2125 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=1,st=OK:2.2.0
    2138 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4177 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
    4196 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
    4214 TSF:MSG:SEND,4-4-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
    4227 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
    4235 MCO:REG:REQ
    4237 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    6246 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    8255 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    10264 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    12273 MCO:BGN:STP
    12275 MCO:BGN:INIT OK,TSP=1
    12279 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
    12285 TSF:TDI:TSL
    12288 MCO:SLP:WUP=-1
    12290 TSF:TRI:TSB
    915
    Child ID 1Battery Voltage: 3.08 V
    Battery Percent: 91 %
    13297 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:91
    13305 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
    13312 TSF:TDI:TSL
    13314 MCO:SLP:WUP=-1
    13316 TSF:TRI:TSB
    13320 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
    13326 TSF:TDI:TSL
    13328 MCO:SLP:WUP=-1
    13330 TSF:TRI:TSB
    826
    Child ID 1Battery Voltage: 2.78 V
    Battery Percent: 82 %
    14340 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:82
    14346 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
    14352 TSF:TDI:TSL

    OpenHardware.io mysensors battery easy newbie pcb mysx

  • 💬 Easy/Newbie PCB for MySensors
    M Mr_sensor

    @gohan said in 💬 Easy/Newbie PCB for MySensors:

    you can add a wire to the I2C pins, in your case you just need a short wire to a digital pin that are just next to the Extra area

    Ok. And if attaching a DS18B20 I have a pull up resistor soldered on the board. Than it is also just the digital pin I need from the board? D3 I think?

    OpenHardware.io mysensors battery easy newbie pcb mysx
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular