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
  1. Home
  2. My Project
  3. roller shutter

roller shutter

Scheduled Pinned Locked Moved My Project
5 Posts 2 Posters 1.7k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Reza
    wrote on last edited by Reza
    #1

    hi
    this is a roller shutter sketch that i wrote :) a simple sketch :)

    #define MY_DEBUG
    #define MY_RADIO_NRF24
    #define MY_RF24_CHANNEL 0
    #define MY_REPEATER_FEATURE
    #include MY_NODE_ID 20
    
    #include <SPI.h>
    #include <MySensors.h>
    
    #define RELAY_1  3
    #define RELAY_2  4
    
    
    
    void before() {
      int sensor = 1;
      pinMode(RELAY_1, OUTPUT);
      pinMode(RELAY_2, OUTPUT);
      digitalWrite(RELAY_1,HIGH);
      digitalWrite(RELAY_2,HIGH);
    
    }
    
    
    
    void setup() {
    }
    void presentation()
    {
      sendSketchInfo("Roller shutter", "1.0");
      int sensor = 1 ;
      present(sensor, S_COVER);
    }
    
    void loop() {
    }
    void receive(const MyMessage &message) {
      if (message.type == V_UP) {
        digitalWrite(RELAY_1, HIGH);
        delay(500);
        digitalWrite(RELAY_2, LOW);
      }
      if (message.type == V_STOP ) {
        digitalWrite(RELAY_1, HIGH);
        delay(500);
        digitalWrite(RELAY_2, HIGH);
      }
      if (message.type == V_DOWN) {
        digitalWrite(RELAY_2, HIGH);
        delay(500);
        digitalWrite(RELAY_1, LOW);
      }
    }
    
    1 Reply Last reply
    1
    • Q Offline
      Q Offline
      Qu3Uk
      wrote on last edited by
      #2

      Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..

      R 1 Reply Last reply
      0
      • Q Qu3Uk

        Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..

        R Offline
        R Offline
        Reza
        wrote on last edited by Reza
        #3

        @Qu3Uk said:

        Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..

        there is a 2channel relay and motor left round wire is connect to one relay and motor right round wire is connect to other channel.
        here HIGH = off and LOW = on
        for left round (right round is off and left round is on)
        for right round (left round is off and right round is on)
        for stop both is off
        :)

        Q 1 Reply Last reply
        0
        • R Reza

          @Qu3Uk said:

          Nice, I was wondering about something like this but couldn't think how you'd handle limits? Unless the motor handles them..

          there is a 2channel relay and motor left round wire is connect to one relay and motor right round wire is connect to other channel.
          here HIGH = off and LOW = on
          for left round (right round is off and left round is on)
          for right round (left round is off and right round is on)
          for stop both is off
          :)

          Q Offline
          Q Offline
          Qu3Uk
          wrote on last edited by
          #4

          @Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?

          R 1 Reply Last reply
          0
          • Q Qu3Uk

            @Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?

            R Offline
            R Offline
            Reza
            wrote on last edited by Reza
            #5

            @Qu3Uk said:

            @Reza Oh I understand that but with stop command you could quite quickly have the shutter fully open but the motors still running. Right?

            i dont test it yet but i think you right :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            30

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

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