Navigation

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

    korttoma

    @korttoma

    Hero Member

    136
    Reputation
    686
    Posts
    2620
    Profile views
    3
    Followers
    0
    Following
    Joined Last Online
    Location Finland Age 42

    korttoma Follow
    Hero Member

    Best posts made by korttoma

    • RE: ๐Ÿ’ฌ Dimmable LED Actuator

      Inspirational pictures from my Dimmable LED Actuator with rotary encoder device I made for my sons bedside lamp.
      Running this at 12VDC. His lamp had a G9 socket so I just broke apart the G9 LED bulb and soldered some G4 12VDC LED lights like these to it and replaces the "Dumb" switch with a 5mm DC plug. It turned out so nice that I think I will MySensor my own bedside lamp also.

      Edit: btw, I found the nice big knobs from here -> eBay

      0_1476680417320_WP_20161014_07_07_53.jpg

      0_1476680429390_WP_20161014_07_11_47.jpg

      posted in Announcements
      korttoma
      korttoma
    • MySensored 230v motion sensor with light level

      I have been searching for a nice enclosure to use with some motion sensors but nothing was to my satisfactory. So I started to look at different motion sensors to see if I could find something I could modify. I found this one at my local electronics shop. Both looks and prize was right so I picked one up.

      I cut the Live copper strip to the relay and removed the wire that would normally go to the lamp and removed 2 capacitors (marked with red and green), soldered 2 wires to were a capacitor had been to access the relay contacts (marked with green).
      WP_20141126_001.jpg

      Destroid one of them 90 cent iPhone charger clones to get a 5v power supply added a Pro Mini with radio and a LM393 photo resistor.
      Connected the relay contacts to GND and a binary in on the arduino and the photo transistor to a analog in.
      WP_20141126_003.jpg

      Here is the result:
      WP_20141126_006.jpg

      And here is the sketch:
      https://codebender.cc/sketch:62574

      Have not attached it to the ceiling yet just had it on the floor for testing, motion sensor works great but I'm not sure if the light sensor will be sensitive enough.

      Think I'm going to add a 2A glas fuse to it because of the cheep 5v power just in case.

      posted in My Project
      korttoma
      korttoma
    • RE: Temperature sensor accuracy comparison

      @wes Thanks for the list of sensor accuracy. But for for example battery nodes there are other parameters that are at least as important as temp accuracy and you left out the Si7021 that is really good for battery driven nodes.

      Si7021
      Precision Relative Humidity Sensor ยฑ 3% RH (max), 0โ€“80% RH
      High Accuracy Temperature Sensor ยฑ0.4 ยฐC (max), โ€“10 to 85 ยฐC
      Wide operating voltage (1.9 to 3.6 V)
      Low Power Consumption 150 ยตA active current 60 nA standby current

      posted in Hardware
      korttoma
      korttoma
    • RE: First run of new nodeMCU based GatewaySerial. Not sure what it is saying.

      The correct way to use any ESP8266 based boards with the current MySensors implementation is to configure them as WiFi Gateways with local sensors. You cannot make one ESP8266 an serial GW and expect all other ESPs to communicate via this one using the WiFi.

      I other words all your ESPs will be Gateways but without any transport (NRF24L01 or RFM69 that is currently supported).

      posted in Troubleshooting
      korttoma
      korttoma
    • RE: nRF5 action!

      @nca78 I have now measured the current consumption of the small bluetooth beacon device (N51822 QFABC0) using your code and the results are encouraging.

      With your code I get around 4uA sleep current compared to 800-4000uA with my old code ๐Ÿ˜„

      Measurements done with an Micro (nano) ampere meter (double) that has not been calibrated against a reliable meter so do not take the measured values so seriously but more as a comparison.

      Device

      posted in My Project
      korttoma
      korttoma
    • RE: ๐Ÿ’ฌ Building a WiFi Gateway using ESP8266

      @sghazagh maybe you can take a picture of the setup. Maybe someone else can see something that you don't.

      posted in Announcements
      korttoma
      korttoma
    • RE: Relay with button

      @Lanman said:

      doesn't seem to work

      Can you elaborate on this? What is it that is not working? Can you get the serial debug output from your node?

      // Enable debug prints
      #define MY_DEBUG
      
      posted in Troubleshooting
      korttoma
      korttoma
    • Alternative battery operated motion sensor using 433MHz sensors

      I never managed to get a motion sensor attached to an arduino to work reliably, especially on batteries so I looked for an alternative using ready made sensor that could be "MySensord". Here is what I came up with:

      I found these 433MHz battery operated Motion sensors that seemed like a nice alternative and then I got myself this 433MHz receiver to hock up to my MySensors 5V Pro Mini node like this (I allso connected an NRF24L01+ but I left it out from the drawing to keep it clean):

      0_1479892250747_433MHzReceiver.jpg

      I attached a 17,3cm wire as a quarter length antenna to the receiver calculated here

      Then I created this sketch to handle it all:

      /**
       * 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.
       *
       *******************************
       *
       *
       *
       *
       */
      
      // Enable debug prints
      //#define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      #define MY_BAUD_RATE  9600
      
      #define MY_NODE_ID 18
      #define SKETCH_NAME "RF433 Motion"
      #define SKETCH_VERSION "1.0"
      
      #include <MySensors.h>
      #include <RCSwitch.h>
      #include <SPI.h>
      
      unsigned long TRIP_RESET_TIME = 120000;
      
      unsigned long NOW_TIME = millis();
      unsigned long KnownSensor1 = 5945054;
      unsigned long TRIP_TIME_1 = millis();
      bool untripsent_1 = 1;
      bool tripped_1 = 0;
      
      unsigned long KnownSensor2 = 5914846;
      unsigned long TRIP_TIME_2 = millis();
      bool untripsent_2 = 1;
      bool tripped_2 = 0;
      
      #define RF433RECIEVER 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      
      RCSwitch mySwitch = RCSwitch();
      
      #define CHILD_ID_1 1   // Id of the sensor child
      #define CHILD_ID_2 2   // Id of the sensor child
      
      // Initialize motion message
      MyMessage msg1(CHILD_ID_1, V_TRIPPED);
      MyMessage msg2(CHILD_ID_2, V_TRIPPED);
      
      void setup()
      {
        mySwitch.enableReceive(digitalPinToInterrupt(RF433RECIEVER));  // Receiver on interrupt 0 => that is pin #2
      
      }
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
      
        wait(50);
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_1, S_MOTION);
        wait(50);
        present(CHILD_ID_2, S_MOTION);
        wait(50);
      
      }
      
      void loop()
      {
      
      
        if (mySwitch.available()) {
      
          int value = mySwitch.getReceivedValue();
      
          if (value == 0) {
            Serial.print("Unknown encoding");
          } else {
            Serial.print("Received ");
            Serial.println( mySwitch.getReceivedValue() );
            //Serial.print(" / ");
            //Serial.print( mySwitch.getReceivedBitlength() );
            //Serial.print("bit ");
            //Serial.println( mySwitch.getReceivedProtocol() );
      
            if (mySwitch.getReceivedValue() == KnownSensor1) {
              int value = mySwitch.getReceivedValue();
      
              if (tripped_1 == 0) {
                Serial.println("Sending Tripped value");
                send(msg1.set(1));  // Send tripped value to gw
                tripped_1 = 1;
              }
      
              TRIP_TIME_1 = millis();
              untripsent_1 = 0;    
            }
      
            if (mySwitch.getReceivedValue() == KnownSensor2) {
              int value = mySwitch.getReceivedValue();
      
              if (tripped_2 == 0) {
                Serial.println("Sending Tripped value");
                send(msg2.set(1));  // Send tripped value to gw
                tripped_2 = 1;
              }
      
              TRIP_TIME_2 = millis();
              untripsent_2 = 0;        
            }
      
            mySwitch.resetAvailable();
          }
      
        }
        
        unsigned long NOW_TIME = millis();
        
        if ((NOW_TIME - TRIP_TIME_1 >= TRIP_RESET_TIME) && (untripsent_1 == 0))
        {
          Serial.println("Sending Un-tripped value");
          send(msg1.set(0));  // Send Un-tripped value to gw
          TRIP_TIME_1 = NOW_TIME;
          untripsent_1 = 1;
          tripped_1 = 0;
        }
      
        if ((NOW_TIME - TRIP_TIME_2 >= TRIP_RESET_TIME) && (untripsent_2 == 0))
        {
          Serial.println("Sending Un-tripped value");
          send(msg2.set(0));  // Send Un-tripped value to gw
          TRIP_TIME_2 = NOW_TIME;
          untripsent_2 = 1;
          tripped_2 = 0;    
        }
        
      }
      
      
      

      So far I'm happy with the performance. I have one outside sending me a snapshot from a camera if there is movement when we are away and I have not had any false triggers so far. The communication range of the 433MHz sensors is great. I cannot comment on how long the batteries will hold on these since they have only been in use a few weeks.

      posted in My Project
      korttoma
      korttoma
    • RE: Request: New Sensor Type ? Thermostatically controlled switch

      I finally put together a thermostat device sketch. Unfortunately it got a bit out of hand and I implemented lots of features that most people probably not need.

      Not sure if I'm using the V_HVAC_FLOW_STATE and V_HVAC_SETPOINT_HEAT correctly but it seems to work with my Vera UI5 presented as a S_HEATER device.

      Here is the sketch in case someone needs it.

      https://codebender.cc/sketch:169733

      posted in Feature Requests
      korttoma
      korttoma
    • RE: ๐Ÿ’ฌ Easy/Newbie PCB for MySensors

      @maghac it is not just as simple as the capacitor size is added, true it is added but different size capacitors also filter disturbances at different frequencies. So adding different size capacitors in parallel can act as a more effective disturbance filter.

      posted in OpenHardware.io
      korttoma
      korttoma

    Latest posts made by korttoma

    • RE: Pokit PRO on kickstarter

      Quite popular project after all..

      https://www.kickstarter.com/projects/pokitmeter/pokit-pro/posts/2691302

      posted in General Discussion
      korttoma
      korttoma
    • RE: Pokit PRO on kickstarter

      btw, did anyone here back their previous project the pokit meter?
      I would love to hear some comments about how the previous campaign project was handled and general information about the product quality this company produces.

      posted in General Discussion
      korttoma
      korttoma
    • Pokit PRO on kickstarter

      Hi all, just wanted to let you know about this kickstarter project and if you find it interesting and decided to back it please do so via my referral link ๐Ÿ˜‰

      https://kicks.to/HRE9Dtx

      posted in General Discussion
      korttoma
      korttoma
    • RE: VERA / Arduino Integration

      @sparky60 yes, 4 inputs and 4 outputs. It should be easy to modify if you need a different amount.

      posted in Vera
      korttoma
      korttoma
    • RE: VERA / Arduino Integration

      @sparky60
      Yes it is possible to run I/O on a Ethernet Gateway without radio unit
      Yes it is possible to have multiple Gateways connected to the same Vera, you just add another plugin device and use different IP for it. Remember to also use different MAC address for each GW in the sketch.

      Not sure how up to date this example is because I have not updated my devices for a year or 2 but I think you get the idea.
      Example sketch:

      /**
       * 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
       * Contribution by a-lurker and Anticimex,
       * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
       * Contribution by Tomas Hozza <thozza@gmail.com>
       *
       *
       * DESCRIPTION
       * The EthernetGateway sends data received from sensors to the ethernet link.
       * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
       *
       * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
       *
       * LED purposes:
       * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
       * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
       * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
       * - ERR (red) - fast blink on error during transmission error or recieve crc error
       *
       * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
       *
       */
      
      // Enable debug prints to serial monitor
      
      //#define MY_DEBUG 
      #define SN "EthGW/RFM69 Rele Button"
      #define SV "1.1"
      
      // Enable and select radio type attached
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RF69_433MHZ
      #define MY_IS_RFM69HW
      #define MY_RF69_SPI_CS 4  //try changeing this to 9
      // Enable gateway ethernet module type 
      #define MY_GATEWAY_W5100
      
      // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
      //#define MY_W5100_SPI_EN 10  
      
      // Enable Soft SPI for NRF radio (note different radio wiring is required)
      // The W5100 ethernet module seems to have a hard time co-operate with 
      // radio on the same spi bus.
      
      
      // Enable to UDP          
      //#define MY_USE_UDP
      
      #define MY_IP_ADDRESS 192,168,1,100   // If this is disabled, DHCP is used to retrieve address
      // Renewal period if using DHCP
      //#define MY_IP_RENEWAL_INTERVAL 60000
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003      
      
      // Controller ip address. Enables client mode (default is "server" mode). 
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. 
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254   
       
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xED, 0xED
      
      // Flash leds on rx/tx/err
      //#define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60 
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3 
      
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
      
      #include <SPI.h>
      
      #if defined(MY_USE_UDP)
        #include <EthernetUdp.h>
      #endif
      #include <Ethernet.h>
      #include <MySensors.h>
      #include <Bounce2.h>
      #define RELAY_ON 0                      // switch around for ACTIVE LOW / ACTIVE HIGH relay
      #define RELAY_OFF 1
      //
      
      #define noRelays 4                     //2-4
      
      const int relayPin[] = {14, 15, 16, 17};       //  switch around pins to your desire
      const int buttonPin[] = {7, 8, 5, 6};   //  switch around pins to your desire
      
      class Relay             // relay class, store all relevant data (equivalent to struct)
      {
        public:
          int buttonPin;                   // physical pin number of button
          int relayPin;             // physical pin number of relay
          boolean relayState;               // relay status (also stored in EEPROM)
      };
      
      Relay Relays[noRelays];
      Bounce debouncer[noRelays];
      MyMessage msg[noRelays];
      
      void setup() {
        wait(100);
        // Initialize Relays with corresponding buttons
        for (int i = 0; i < noRelays; i++) {
          Relays[i].buttonPin = buttonPin[i];              // assign physical pins
          Relays[i].relayPin = relayPin[i];
          msg[i].sensor = i;                                   // initialize messages
          msg[i].type = V_LIGHT;
          pinMode(Relays[i].buttonPin, INPUT_PULLUP);
          wait(100);
          pinMode(Relays[i].relayPin, OUTPUT);
          Relays[i].relayState = loadState(i);                               // retrieve last values from EEPROM
          digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly
          send(msg[i].set(Relays[i].relayState ? true : false));                 // make controller aware of last status
          wait(50);
          debouncer[i] = Bounce();                        // initialize debouncer
          debouncer[i].attach(buttonPin[i]);
          debouncer[i].interval(30);
          wait(50);
        }
      }
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo(SN, SV);
      
        wait(100);
      
        for (int i = 0; i < noRelays; i++)
          present(i, S_LIGHT);                               // present sensor to gateway
      
        wait(100);
      }
      
      
      void loop()
      {
        for (byte i = 0; i < noRelays; i++) {
          if (debouncer[i].update()) {
            
            int value = debouncer[i].read();
            
            if ( value == LOW) {
              Relays[i].relayState = !Relays[i].relayState;
              digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF);
              send(msg[i].set(Relays[i].relayState ? true : false));
              // save sensor state in EEPROM (location == sensor number)
              saveState( i, Relays[i].relayState );
      
            }
      
          }
        }
        //wait(20);
      }
      
      void receive(const MyMessage &message) {
        if (message.sender == 0) {
          if (message.type == V_LIGHT) {
            if (message.sensor < noRelays) {          // check if message is valid for relays..... previous line  [[[ if (message.sensor <=noRelays){ ]]]
              Relays[message.sensor].relayState = message.getBool();
              digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly
              saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number)
            }
          }
        } 
        wait(20);
      }
      
      
      
      posted in Vera
      korttoma
      korttoma
    • RE: Code explanation

      @royzone Your code is a bit incomplete because you did not include the entire line but I think that you are comparing some boolean variable to the value "HIGH" and if it is HIGH then you send the value "1" with ack (acknowledgement).

      If an experienced coder see that my asumption is incorrect please correct me ๐Ÿ˜‰

      posted in General Discussion
      korttoma
      korttoma
    • RE: ๐Ÿ’ฌ MySensors Library

      @flopp https://forum.mysensors.org/topic/9973/mysensors-2-3-1-released

      posted in Announcements
      korttoma
      korttoma
    • RE: Using PLEG to copy a sensor value to another

      Just add LUA as a Logic Action triggered by a cyclic condition in PLEG
      Using Lua just get the value from the temp sensor variable and set the variable on the thermostat:

      local PipeTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 42)
      luup.variable_set("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",PipeTemp,44)
      
      
      posted in Vera
      korttoma
      korttoma
    • RE: OLED Scene controller

      I have noticed that in the latest Vera firmware if a variable has no value it does not show up in the Advanced -> Variables tab.

      Try writing some value manually from Apps -> Develop apps -> test loop code (here is an example):

      luup.call_action("urn:upnp-arduino-cc:serviceId:arduino1", "SendCommand", {radioId="11;3", variableId="VAR_4", value=1}, 24)

      24 in the example is the Id of the MySensors plugin Main device.
      11;3 in the example is altid of the sensor node device.

      After writing and refreshing of browser (Ctrl + F5) you should see the variables under Advanced -> Variables tab

      The command should also send the value to your child node.

      posted in Hardware
      korttoma
      korttoma
    • RE: Which dust sensor do you use and why?

      @gohan said in Which dust sensor do you use and why?:

      @korttoma if you have a library that can read the values from the sensor, you can easily add the mysensors code

      yeah I know, I just thought that if @NeverDie already made a MySensors sketch I would not have to invent the wheel again.

      @NeverDie what lib are you using and how? I2C?

      posted in Hardware
      korttoma
      korttoma