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. Poolside Music Player

Poolside Music Player

Scheduled Pinned Locked Moved My Project
10 Posts 4 Posters 2.3k Views 4 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.
  • Boots33B Offline
    Boots33B Offline
    Boots33
    Hero Member
    wrote on last edited by
    #1

    I built a pool thermometer to keep track of the water temperature but the node could not reliably connect to the closest repeater.
    The repeater node was not that far away so I think maybe the closeness of the water and perhaps the pool fence were causing some problems. The easiest solution was to just deploy another repeater node to bridge the gap.

    I didn't wan't to have a node just for repeating the temp data so decided to make use of it as a music player for the pool area as well.

    To keep it simple I settled on a cheap Bluetooth enabled amplifier module and a couple of marine speakers, The node just turns power on and off to the amp and I can control the volume and stream music from my phone via the bluetooth connection.

    For convenience I have set up a button on my Touch switch so I can turn the amp on/off when walking down to the pool area.

    The circuit is just a simple single switch type node to control power to the amp.

    0_1514807588204_pool player.jpg

    The sketch is a standard relay control with a timer to shut down the amp after 3hrs. We are seldom in the pool for longer than that and wanted a way to ensure the amp is not left switched on by accident.

    /**
     *Node to control pool music player 
     *
     *Auto turns off after preset time
     *
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define MY_RF24_CHANNEL 84
    #define MY_REPEATER_FEATURE
    
    #include <MySensors.h>
    
    #define PLAYER_PIN  6                          // Arduino  pin number for Player power control
    #define PLAYER_ID  1                          // Id of the player control child
    
    unsigned long millisNow = 0;                  // holder for the current time
    unsigned long startMillisA = 0;
    unsigned long activeTimeA = 180;             // how long the player will stay on, in minutes
    const int switchOn = 1; 
    const int switchOff = 0;
    int timerMarkerA = 0;                       // Used to tell if timer A is active
    bool stateA = false;                        // State holder for player
    
    MyMessage msgA(PLAYER_ID, V_STATUS);
    
    void setup()
    {
     pinMode(PLAYER_PIN, OUTPUT);               // set player pin in output mode 
     digitalWrite(PLAYER_PIN, switchOff);       // Make sure player is off when starting up
    }
    
    void presentation()
    {
    	// Send the sketch version information to the gateway and Controller
    	sendSketchInfo("Pool Player", "1.3");
    	present(PLAYER_ID, S_BINARY,"Pool Player");
    	}
    
    
    void loop()
    {
    poolTimer();
    }
    
    void receive(const MyMessage &message){	
    	if (message.type==V_STATUS) {                                     // check that message is for binary switch
    		if (message.sender == 0) {                                      // check if message is from gateway (node 0)
          stateA = message.getBool();
          digitalWrite(PLAYER_PIN,  stateA ? switchOn : switchOff);
    		}
        else  {                                                         // message is not from gateway so must be from a remote
          stateA = !stateA;                                             // toggle player state
          digitalWrite(PLAYER_PIN,  stateA ? switchOn : switchOff);
          wait (10);
          send( msgA.set(stateA),false) ;                               // Notify controller of change  
       }   
      }
    }
    
    void poolTimer() {
      millisNow = millis();           // get the current time  
      if (digitalRead(PLAYER_PIN) == switchOn && timerMarkerA == 0 ) {        //Check relayPinA status and start timer event if relay is on.
        timerMarkerA = 1;                                                   
        startMillisA = millisNow;
      }
      if (timerMarkerA == 1 && (millisNow - startMillisA) > (activeTimeA*60000)) {   // check to see if timeout has been reached
        digitalWrite(PLAYER_PIN, switchOff);                                         // turn off player
        send(msgA.set(false),false );                                                // send message to controller so it knows the player is now off
        timerMarkerA = 0;                                                            //reset marker
        stateA = false;
      }
        if (digitalRead(PLAYER_PIN) == switchOff && timerMarkerA == 1 ) {            //if  player has been turned off by user, cancel timer event
        timerMarkerA = 0;
        Serial.println("timer A cancelled" );
      }
    
    }
    
    

    The node was constructed on a small prototype board with the nrf mounted well clear at the top.

    0_1514808205998_board.jpg

    Here it is shown with the amp and speakers during testing.
    0_1514808353051_testing.jpg

    The node was housed in a section of 90mm water pipe.

    0_1514808572491_controller.jpg

    The speakers were fitted to an existing seat/storage area. Just a bit of tidying up of the wiring etc to do.

    0_1514808657929_setup.jpg

    dbemowskD 1 Reply Last reply
    4
    • Boots33B Boots33

      I built a pool thermometer to keep track of the water temperature but the node could not reliably connect to the closest repeater.
      The repeater node was not that far away so I think maybe the closeness of the water and perhaps the pool fence were causing some problems. The easiest solution was to just deploy another repeater node to bridge the gap.

      I didn't wan't to have a node just for repeating the temp data so decided to make use of it as a music player for the pool area as well.

      To keep it simple I settled on a cheap Bluetooth enabled amplifier module and a couple of marine speakers, The node just turns power on and off to the amp and I can control the volume and stream music from my phone via the bluetooth connection.

      For convenience I have set up a button on my Touch switch so I can turn the amp on/off when walking down to the pool area.

      The circuit is just a simple single switch type node to control power to the amp.

      0_1514807588204_pool player.jpg

      The sketch is a standard relay control with a timer to shut down the amp after 3hrs. We are seldom in the pool for longer than that and wanted a way to ensure the amp is not left switched on by accident.

      /**
       *Node to control pool music player 
       *
       *Auto turns off after preset time
       *
       */
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      #define MY_RF24_CHANNEL 84
      #define MY_REPEATER_FEATURE
      
      #include <MySensors.h>
      
      #define PLAYER_PIN  6                          // Arduino  pin number for Player power control
      #define PLAYER_ID  1                          // Id of the player control child
      
      unsigned long millisNow = 0;                  // holder for the current time
      unsigned long startMillisA = 0;
      unsigned long activeTimeA = 180;             // how long the player will stay on, in minutes
      const int switchOn = 1; 
      const int switchOff = 0;
      int timerMarkerA = 0;                       // Used to tell if timer A is active
      bool stateA = false;                        // State holder for player
      
      MyMessage msgA(PLAYER_ID, V_STATUS);
      
      void setup()
      {
       pinMode(PLAYER_PIN, OUTPUT);               // set player pin in output mode 
       digitalWrite(PLAYER_PIN, switchOff);       // Make sure player is off when starting up
      }
      
      void presentation()
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Pool Player", "1.3");
      	present(PLAYER_ID, S_BINARY,"Pool Player");
      	}
      
      
      void loop()
      {
      poolTimer();
      }
      
      void receive(const MyMessage &message){	
      	if (message.type==V_STATUS) {                                     // check that message is for binary switch
      		if (message.sender == 0) {                                      // check if message is from gateway (node 0)
            stateA = message.getBool();
            digitalWrite(PLAYER_PIN,  stateA ? switchOn : switchOff);
      		}
          else  {                                                         // message is not from gateway so must be from a remote
            stateA = !stateA;                                             // toggle player state
            digitalWrite(PLAYER_PIN,  stateA ? switchOn : switchOff);
            wait (10);
            send( msgA.set(stateA),false) ;                               // Notify controller of change  
         }   
        }
      }
      
      void poolTimer() {
        millisNow = millis();           // get the current time  
        if (digitalRead(PLAYER_PIN) == switchOn && timerMarkerA == 0 ) {        //Check relayPinA status and start timer event if relay is on.
          timerMarkerA = 1;                                                   
          startMillisA = millisNow;
        }
        if (timerMarkerA == 1 && (millisNow - startMillisA) > (activeTimeA*60000)) {   // check to see if timeout has been reached
          digitalWrite(PLAYER_PIN, switchOff);                                         // turn off player
          send(msgA.set(false),false );                                                // send message to controller so it knows the player is now off
          timerMarkerA = 0;                                                            //reset marker
          stateA = false;
        }
          if (digitalRead(PLAYER_PIN) == switchOff && timerMarkerA == 1 ) {            //if  player has been turned off by user, cancel timer event
          timerMarkerA = 0;
          Serial.println("timer A cancelled" );
        }
      
      }
      
      

      The node was constructed on a small prototype board with the nrf mounted well clear at the top.

      0_1514808205998_board.jpg

      Here it is shown with the amp and speakers during testing.
      0_1514808353051_testing.jpg

      The node was housed in a section of 90mm water pipe.

      0_1514808572491_controller.jpg

      The speakers were fitted to an existing seat/storage area. Just a bit of tidying up of the wiring etc to do.

      0_1514808657929_setup.jpg

      dbemowskD Offline
      dbemowskD Offline
      dbemowsk
      wrote on last edited by
      #2

      @boots33 Where is it that you live? I want to move there. I see the sun and green grass in your pics. To give you some perspective on things, for the past few days we have had average temps in the single digits (°F). That is less than -12°C; The wind chills here have gone as low as -25°F (-31.6°C).

      Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
      Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

      Nca78N 1 Reply Last reply
      0
      • dbemowskD dbemowsk

        @boots33 Where is it that you live? I want to move there. I see the sun and green grass in your pics. To give you some perspective on things, for the past few days we have had average temps in the single digits (°F). That is less than -12°C; The wind chills here have gone as low as -25°F (-31.6°C).

        Nca78N Offline
        Nca78N Offline
        Nca78
        Hardware Contributor
        wrote on last edited by Nca78
        #3

        @dbemowsk said in Poolside Music Player:

        @boots33 Where is it that you live? I want to move there. I see the sun and green grass in your pics. To give you some perspective on things, for the past few days we have had average temps in the single digits (°F). That is less than -12°C; The wind chills here have gone as low as -25°F (-31.6°C).

        Don't complain when you have a real winter !
        In my current place beginning of year is the driest season and very warm (>30°C). We had an exceptionally cold period a few weeks ago, temperature went down to 20°C at night/morning and people were starting to wear winter clothes :D
        But most people here have never seen snow and are dreaming about visiting a cold place in winter, enjoy it for them please :P

        dbemowskD 1 Reply Last reply
        1
        • Nca78N Nca78

          @dbemowsk said in Poolside Music Player:

          @boots33 Where is it that you live? I want to move there. I see the sun and green grass in your pics. To give you some perspective on things, for the past few days we have had average temps in the single digits (°F). That is less than -12°C; The wind chills here have gone as low as -25°F (-31.6°C).

          Don't complain when you have a real winter !
          In my current place beginning of year is the driest season and very warm (>30°C). We had an exceptionally cold period a few weeks ago, temperature went down to 20°C at night/morning and people were starting to wear winter clothes :D
          But most people here have never seen snow and are dreaming about visiting a cold place in winter, enjoy it for them please :P

          dbemowskD Offline
          dbemowskD Offline
          dbemowsk
          wrote on last edited by mfalkvidd
          #4

          @nca78 said in Poolside Music Player:

          enjoy it for them please

          I can enjoy some winter days, but when it gets so cold that a breath of air nearly freezes your lungs, that's kind of tough to do.

          Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
          Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

          Nca78N 1 Reply Last reply
          1
          • Boots33B Offline
            Boots33B Offline
            Boots33
            Hero Member
            wrote on last edited by
            #5

            Ha ha... no white Christmas in the land down under @dbemowsk :) Pool temp is pretty stable at around 30c at the moment so that should thaw you out. At the moment we spend our weekends wakeboarding at the lake or

            Going to the Beach

            0_1514838380426_beach.jpg

            @Nca78 is right though, I have to drive over 1500km if I want to see some snow and there is only snow there in winter. Temps have already been up to 37c here so it does get a bit toasty at times!

            dbemowskD 1 Reply Last reply
            0
            • Boots33B Boots33

              Ha ha... no white Christmas in the land down under @dbemowsk :) Pool temp is pretty stable at around 30c at the moment so that should thaw you out. At the moment we spend our weekends wakeboarding at the lake or

              Going to the Beach

              0_1514838380426_beach.jpg

              @Nca78 is right though, I have to drive over 1500km if I want to see some snow and there is only snow there in winter. Temps have already been up to 37c here so it does get a bit toasty at times!

              dbemowskD Offline
              dbemowskD Offline
              dbemowsk
              wrote on last edited by
              #6

              @boots33 said in Poolside Music Player:

              Temps have already been up to 37c here so it does get a bit toasty at times!

              I'd say that's toasty. Right now I'd take that over -31°C. When it's that cold, it doesn't seem like any amount of clothing is enough to stay warm. The key is to enjoy the season no matter the weather outside.

              Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
              Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

              Boots33B 1 Reply Last reply
              0
              • dbemowskD dbemowsk

                @boots33 said in Poolside Music Player:

                Temps have already been up to 37c here so it does get a bit toasty at times!

                I'd say that's toasty. Right now I'd take that over -31°C. When it's that cold, it doesn't seem like any amount of clothing is enough to stay warm. The key is to enjoy the season no matter the weather outside.

                Boots33B Offline
                Boots33B Offline
                Boots33
                Hero Member
                wrote on last edited by
                #7

                @dbemowsk I can't even imagine those sort of temps! Don't think my freezer can go that low :)

                dbemowskD 1 Reply Last reply
                3
                • Boots33B Boots33

                  @dbemowsk I can't even imagine those sort of temps! Don't think my freezer can go that low :)

                  dbemowskD Offline
                  dbemowskD Offline
                  dbemowsk
                  wrote on last edited by
                  #8

                  @boots33 said in Poolside Music Player:

                  @dbemowsk I can't even imagine those sort of temps! Don't think my freezer can go that low :)

                  If I could upvote that twice I would

                  Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                  Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                  1 Reply Last reply
                  0
                  • mfalkviddM Offline
                    mfalkviddM Offline
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #9

                    0_1514843628282_IMG_2234.PNG

                    1 Reply Last reply
                    3
                    • dbemowskD dbemowsk

                      @nca78 said in Poolside Music Player:

                      enjoy it for them please

                      I can enjoy some winter days, but when it gets so cold that a breath of air nearly freezes your lungs, that's kind of tough to do.

                      Nca78N Offline
                      Nca78N Offline
                      Nca78
                      Hardware Contributor
                      wrote on last edited by
                      #10

                      @dbemowsk said in Poolside Music Player:

                      I can enjoy some winter days, but when it gets so cold that a breath of air nearly freezes your lungs, that's kind of tough to do.

                      Yes I was just joking, lowest I ever had was around -15°C but with low/no wind and it was already a pain to walk outside.

                      Would switch with @Boots33's place anyway too, it seems we are the same weather but I don't have all those trees. Nice house, warm weather, garden, pool, lots of trees around, and workshop when the MySensors virus makes a comeback. Sounds like a perfect place, any chance you're on AirBnb @Boots33 ? :D

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


                      32

                      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