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
CorvlC

Corvl

@Corvl
About
Posts
63
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Device to remotely turn a thermostat
    CorvlC Corvl

    My house is getting all automated by now , thanks to vera and Z-wave. And now Arduino comes into play !! :-)

    My heating system is also automated , by means of Fibaro relais which turns things (the system itself or pumps) on and off. And radiators have danfoss Z-wave thermostats attached to it.

    But my floorheating ..... that was a different story. It had a special thermostat with a temperature sensor going a device which measures the water in the floorheating system.

    Allready demolished a danfoss Z-wave thermostate , trying to make the tempretaure sensor external , but no joy.

    Huray for Arduino.

    Building the gateway was easy enough, building a servo-actuator with an arduino UNO was also very easy.

    On vera there was an issue with the slider , with the slider the servo only moves 90 degrees. someone helped me changing some code on the sketch:


    fixed it by replacing the line:

    myservo.write(SERVO_MAX + (SERVO_MIN-SERVO_MAX)/100 * val); // sets the servo position 0-180

    by the following 2 lines of code:

        val = map(val, 0, 100, 0, 180); // scale 0%-100% between 0 and 180)
        myservo.write(val);       // sets the servo position 0-180
    

    Now the servo was moving the full 180 degrees by means of the slider.

    Than came the mechanical part, I had to make quite a bracket to hold the servo. Initially I had a standard 3 kg/cm servo , but it wasn't enough to completely close the valve. I ended up using a big scale servo with 14 kg/cm on 7V. Offcourse the servo is powered by a seperate 7V, max 5A power supply

    Initially the plan was to attach the servo directly to the thermostat , at that time I didn't know the themostat not only turns , but also moves in-and outwards .....

    Plan 2 was to use a timing belt system with 2 sprockets , also this didn't work , because the servo pulled the thermostat towards it

    Plan 3 finally worked , I routed out of trespa a bracket where the servo could go freely in and out , but not turn itself.
    This trespa ( white) attached to the metal bracket. Now the servo can do it's normal thing , turn the lever , but also move in and outward

    Here 2 pictures:
    20141209_194903.jpg 20141209_194836.jpg

    A succesfull project I must say :-)

    My Project

  • Building an IR controller
    CorvlC Corvl

    pffff , 84 pages ..... it is something I have to read I guess .

    Thanks for the info ..... I will report here if it is working ......

    Cor

    Troubleshooting

  • Relais sketch, auto switch on again after x seconds
    CorvlC Corvl

    @ BartE , thanks a lot , I changed all the _Off to _OFF and the same with the On , gw. wait as well. also the 500 to 5000

    Working perfectly !

    Many thanks

    I haven't had a definite anwer yet if libabry 2.x works on vera , I have only read about problems . For the moment I stick to 1.5

    edit : one small thing I just noticed , when I switch via the vera Gui the relais to off , it nicely goes back to on after 5 seconds , but it doesn't report back to vera that it is again in an on state.

    is there still something wrong with the code?

    Again many thanks,
    Cor

    For future reference:

    // Example sketch showing how to control physical relays. 
    // This example will remember relay state even after power failure.
    
    #include <MySensor.h>
    #include <SPI.h>
    
    #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 1 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
    
    MySensor gw;
    
    void setup()  
    {   
      // Initialize library and add callback for incoming messages
      gw.begin(incomingMessage, AUTO, true);
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Relay", "1.0");
    
      // Fetch relay status
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
        // Register all sensors to gw (they will be created as child devices)
        gw.present(sensor, S_LIGHT);
        // Then set relay pins in output mode
        pinMode(pin, OUTPUT);   
        // Set relay to last known state (using eeprom storage) 
         if (gw.loadState(sensor) == RELAY_OFF) {
         digitalWrite(pin, RELAY_OFF);
         gw.wait(5000);
         digitalWrite(pin, RELAY_ON);
    }
      }
    }
    
    
    void loop() 
    {
      // Alway process incoming messages whenever possible
      gw.process();
    }
    
    void incomingMessage(const MyMessage &message) {
      // We only expect one type of message from controller. But we better check anyway.
      if (message.type==V_LIGHT) {
         // Change relay state
     if (message.getBool() == RELAY_OFF) {
    digitalWrite(message.sensor-1+RELAY_1, RELAY_OFF);
    gw.wait(5000);
    digitalWrite(message.sensor-1+RELAY_1, RELAY_ON);
    }
         // Store state in eeprom
         gw.saveState(message.sensor, message.getBool());
         // Write some debug info
         Serial.print("Incoming change for sensor:");
         Serial.print(message.sensor);
         Serial.print(", New status: ");
         Serial.println(message.getBool());
       } 
    }```
    General Discussion
  • Login

  • Don't have an account? Register

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