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. Air Conditioning state monitoring sensor

Air Conditioning state monitoring sensor

Scheduled Pinned Locked Moved My Project
16 Posts 7 Posters 5.6k Views 5 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.
  • Moshe LivneM Offline
    Moshe LivneM Offline
    Moshe Livne
    Hero Member
    wrote on last edited by
    #1

    First, special thanks to @Chester for thinking the way to do that and @Sparkman, my hero, for correcting my silly mistake.

    These sensors are for checking if the kids (or me, just hypothetically :-) ) left the air conditioning running in their rooms. What makes it work is that the flaps move in a particular way when you turn the air conditioning off in my wall unit and they "close down" to a position that is impossible while its running.
    This is the sensor (looks almost professional!):
    upload_-1 (4).jpg
    I have since added also battery monitoring although I have to tweak it a bit as it shows 66%.
    The reed sensor sense the presence of a magnet on the flap.

    This is the sensor in position. Couldn't find my kids blue tack so had to use blue tape.
    upload_-1 (5).jpg

    I have carefully measure everything to fit into one of the super cheap aliexpress project boxes. what I didn't take into account was that the battery adds extra 4mm to the height. Darn.

    Here you can see the magnet:upload_-1 (6).jpg

    and this is the sketch:

    #include <MySensor.h>
    #include <SPI.h>
    
    #define REED_PIN 3
    #define INTERRUPT REED_PIN-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
    #define CHILD_ID 1
    #define SLEEP_TIME 28800000
    int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
    
    
    
    
    MySensor gw;
    MyMessage msg(CHILD_ID, V_LIGHT);
    
     
    void setup() {
      
      analogReference(INTERNAL);
    
      pinMode(REED_PIN, INPUT); 
      digitalWrite(REED_PIN, HIGH); //internal pullup
    //  pinMode(A0, INPUT); 
      Serial.begin(115200);
    
      gw.begin();
      
      gw.sendSketchInfo("AirCon Sensor", "1.0");
      gw.present(CHILD_ID, S_LIGHT);
      
    }
    
    int old_value = -1;
    int oldBatteryPcnt = 0;
    
    
    void loop() {
    	int value;  
    	int bValue;
      
      // Listen for any knock at all.
      
    ///  gw.process(); // Process incomming messages
      
    //  	t = analogRead(A0);
      	value = digitalRead(REED_PIN);
      	
    	Serial.println(value);
      	delay(500); //debounce
      	if (value != old_value){
      		old_value = value;
      		gw.send(msg.set(value));
      	}
    
    	//Battery
    	bValue = analogRead(BATTERY_SENSE_PIN);
        int batteryPcnt = bValue / 10;
        Serial.print("Battery : ");
    	Serial.print(batteryPcnt);
    	Serial.println("%");
    	if (oldBatteryPcnt != batteryPcnt) {
        	gw.sendBatteryLevel(batteryPcnt);
        	oldBatteryPcnt = batteryPcnt;
    	}
    
    	gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME);
     
    } 
    
    BulldogLowellB 1 Reply Last reply
    5
    • C Offline
      C Offline
      Chester
      wrote on last edited by
      #2

      Great to see it working! Sometimes its definitely a case of going back to the simplest design idea to get the best result. Congratulations on getting the right solution :)

      Moshe LivneM 1 Reply Last reply
      0
      • Moshe LivneM Moshe Livne

        First, special thanks to @Chester for thinking the way to do that and @Sparkman, my hero, for correcting my silly mistake.

        These sensors are for checking if the kids (or me, just hypothetically :-) ) left the air conditioning running in their rooms. What makes it work is that the flaps move in a particular way when you turn the air conditioning off in my wall unit and they "close down" to a position that is impossible while its running.
        This is the sensor (looks almost professional!):
        upload_-1 (4).jpg
        I have since added also battery monitoring although I have to tweak it a bit as it shows 66%.
        The reed sensor sense the presence of a magnet on the flap.

        This is the sensor in position. Couldn't find my kids blue tack so had to use blue tape.
        upload_-1 (5).jpg

        I have carefully measure everything to fit into one of the super cheap aliexpress project boxes. what I didn't take into account was that the battery adds extra 4mm to the height. Darn.

        Here you can see the magnet:upload_-1 (6).jpg

        and this is the sketch:

        #include <MySensor.h>
        #include <SPI.h>
        
        #define REED_PIN 3
        #define INTERRUPT REED_PIN-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
        #define CHILD_ID 1
        #define SLEEP_TIME 28800000
        int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
        
        
        
        
        MySensor gw;
        MyMessage msg(CHILD_ID, V_LIGHT);
        
         
        void setup() {
          
          analogReference(INTERNAL);
        
          pinMode(REED_PIN, INPUT); 
          digitalWrite(REED_PIN, HIGH); //internal pullup
        //  pinMode(A0, INPUT); 
          Serial.begin(115200);
        
          gw.begin();
          
          gw.sendSketchInfo("AirCon Sensor", "1.0");
          gw.present(CHILD_ID, S_LIGHT);
          
        }
        
        int old_value = -1;
        int oldBatteryPcnt = 0;
        
        
        void loop() {
        	int value;  
        	int bValue;
          
          // Listen for any knock at all.
          
        ///  gw.process(); // Process incomming messages
          
        //  	t = analogRead(A0);
          	value = digitalRead(REED_PIN);
          	
        	Serial.println(value);
          	delay(500); //debounce
          	if (value != old_value){
          		old_value = value;
          		gw.send(msg.set(value));
          	}
        
        	//Battery
        	bValue = analogRead(BATTERY_SENSE_PIN);
            int batteryPcnt = bValue / 10;
            Serial.print("Battery : ");
        	Serial.print(batteryPcnt);
        	Serial.println("%");
        	if (oldBatteryPcnt != batteryPcnt) {
            	gw.sendBatteryLevel(batteryPcnt);
            	oldBatteryPcnt = batteryPcnt;
        	}
        
        	gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME);
         
        } 
        
        BulldogLowellB Offline
        BulldogLowellB Offline
        BulldogLowell
        Contest Winner
        wrote on last edited by
        #3

        @Moshe-Livne

        props for the use of blue tape!

        all kidding aside, this is a great project!

        Moshe LivneM 1 Reply Last reply
        0
        • BulldogLowellB BulldogLowell

          @Moshe-Livne

          props for the use of blue tape!

          all kidding aside, this is a great project!

          Moshe LivneM Offline
          Moshe LivneM Offline
          Moshe Livne
          Hero Member
          wrote on last edited by
          #4

          @BulldogLowell It does add a little 60`s look to the whole project, isn't it? I'll make these some pretty wood boxes. My problem is that temps here are now consistently under 10 degrees. white glue turns to cheese when its that cold. Have an idea for this as well... will post when it's ready.

          1 Reply Last reply
          0
          • C Chester

            Great to see it working! Sometimes its definitely a case of going back to the simplest design idea to get the best result. Congratulations on getting the right solution :)

            Moshe LivneM Offline
            Moshe LivneM Offline
            Moshe Livne
            Hero Member
            wrote on last edited by
            #5

            @Chester That is why having a forum is so great! I don't think I would have thought about this myself - I tend to oversolve problems.

            1 Reply Last reply
            0
            • DidiD Offline
              DidiD Offline
              Didi
              wrote on last edited by
              #6

              you make yourself always down

              if (knowledge == 0) { use BRAIN; use GOOGLE;use SEARCH; } else {make POST;}

              1 Reply Last reply
              0
              • DidiD Offline
                DidiD Offline
                Didi
                wrote on last edited by
                #7

                you gave me more solutions i think about before you here

                if (knowledge == 0) { use BRAIN; use GOOGLE;use SEARCH; } else {make POST;}

                Moshe LivneM 1 Reply Last reply
                0
                • DidiD Didi

                  you gave me more solutions i think about before you here

                  Moshe LivneM Offline
                  Moshe LivneM Offline
                  Moshe Livne
                  Hero Member
                  wrote on last edited by
                  #8

                  @Didi Thanks! Still, I tend to oversolve. I know that and try to fight it but whenever I see a problem my first instinct is an RPI with 1/2 TB storage, a few motors and sensors. Simple!

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    ThinkPad
                    wrote on last edited by
                    #9

                    Nice! Although i would probably have opened the unit and see if i could tap into the signal of one of those 'operation' LED's.
                    That way the whole MySensors node would be invisible ;)

                    1 Reply Last reply
                    1
                    • Moshe LivneM Offline
                      Moshe LivneM Offline
                      Moshe Livne
                      Hero Member
                      wrote on last edited by
                      #10

                      And here they are, mounted properly:
                      IMG_20150727_142235_HDR[1].jpg

                      SparkmanS 1 Reply Last reply
                      5
                      • T Offline
                        T Offline
                        ThinkPad
                        wrote on last edited by
                        #11

                        Looking neat!

                        1 Reply Last reply
                        0
                        • Moshe LivneM Moshe Livne

                          And here they are, mounted properly:
                          IMG_20150727_142235_HDR[1].jpg

                          SparkmanS Offline
                          SparkmanS Offline
                          Sparkman
                          Hero Member
                          wrote on last edited by
                          #12

                          @Moshe-Livne Looks great, but I kind of miss the blue tape :stuck_out_tongue:

                          Cheers
                          Al

                          Moshe LivneM 1 Reply Last reply
                          0
                          • SparkmanS Sparkman

                            @Moshe-Livne Looks great, but I kind of miss the blue tape :stuck_out_tongue:

                            Cheers
                            Al

                            Moshe LivneM Offline
                            Moshe LivneM Offline
                            Moshe Livne
                            Hero Member
                            wrote on last edited by
                            #13

                            @Sparkman I cater for the community members needs:
                            IMG_20150729_131313[1].jpg

                            SparkmanS 1 Reply Last reply
                            1
                            • Moshe LivneM Moshe Livne

                              @Sparkman I cater for the community members needs:
                              IMG_20150729_131313[1].jpg

                              SparkmanS Offline
                              SparkmanS Offline
                              Sparkman
                              Hero Member
                              wrote on last edited by
                              #14

                              @Moshe-Livne :laughing: :satisfied:

                              1 Reply Last reply
                              0
                              • DidiD Offline
                                DidiD Offline
                                Didi
                                wrote on last edited by
                                #15

                                :laughing:

                                if (knowledge == 0) { use BRAIN; use GOOGLE;use SEARCH; } else {make POST;}

                                1 Reply Last reply
                                0
                                • Ivan ZI Offline
                                  Ivan ZI Offline
                                  Ivan Z
                                  Hardware Contributor
                                  wrote on last edited by
                                  #16

                                  Good idea. Append IR control

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


                                  16

                                  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