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. Multisensor PIR based on IKEA Molgan

Multisensor PIR based on IKEA Molgan

Scheduled Pinned Locked Moved My Project
112 Posts 21 Posters 49.8k Views 37 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
    ricmail85
    wrote on last edited by
    #98

    Ok thanks for your reply. I'll check the board for some weak connection and try again...
    bye!

    1 Reply Last reply
    0
    • R ricmail85

      Hi to all,
      I've realized my hacked version of the Ikea Molgan but the PIR sensor stays always HIGH.
      Everything works apart of this... Do you have any idea howto investigate?

      could I have broken it?

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #99

      @ricmail85 I also have one Molgan that I just can't get to work correctly. Put it aside, thinking it was an incident, but if more people have issues, this might be a structural thing...

      http://yveaux.blogspot.nl

      R 1 Reply Last reply
      0
      • YveauxY Yveaux

        @ricmail85 I also have one Molgan that I just can't get to work correctly. Put it aside, thinking it was an incident, but if more people have issues, this might be a structural thing...

        R Offline
        R Offline
        ricmail85
        wrote on last edited by
        #100

        @Yveaux said in Multisensor PIR based on IKEA Molgan:

        @ricmail85 I also have one Molgan that I just can't get to work correctly. Put it aside, thinking it was an incident, but if more people have issues, this might be a structural thing...

        I'll give it a try. I have to check that the wires I soldered on the back of the breadboard are just fine...
        I'll let you know.

        bye!

        dynamiteD 1 Reply Last reply
        0
        • R ricmail85

          @Yveaux said in Multisensor PIR based on IKEA Molgan:

          @ricmail85 I also have one Molgan that I just can't get to work correctly. Put it aside, thinking it was an incident, but if more people have issues, this might be a structural thing...

          I'll give it a try. I have to check that the wires I soldered on the back of the breadboard are just fine...
          I'll let you know.

          bye!

          dynamiteD Offline
          dynamiteD Offline
          dynamite
          wrote on last edited by
          #101

          @ricmail85 @Yveaux basically mine was shortcut by testing Some connection which I should not have Done....🙄

          R 1 Reply Last reply
          0
          • dynamiteD dynamite

            @ricmail85 @Yveaux basically mine was shortcut by testing Some connection which I should not have Done....🙄

            R Offline
            R Offline
            ricmail85
            wrote on last edited by
            #102

            @dynamite @Yveaux Ok I've done some testing. Here my results.

            I checked the wire connections between the Arduino and the PIR and they were ok. Actually when powering everything with batteries I always get HIGH from PIR.

            Then I tried to leave only the PIR without the Arduino and its radio (disconnected the GND wire) and the PIR (alone) was working! I checked with multimeter it oscillates between 0V and 3V if a movement was detected.

            So I concluded that the failure was due to the Arduino. If arduino+radio are powered (by the same battery source) i get always HIGH.

            Looking at this post https://forum.mysensors.org/topic/5273/ikea-molgan-hack/36 I found similar problems due to ripples. I added a capacitor (100uF) in parallel to the PIR capacitor and a 10uF capacitor between the + and - of the battery pack.

            By doing so I still cannot move from HIGH signal from PIR when everything was connected. So I've done more debugging and I found that everything works like a charm if I put a sleep (1000 ms) after sending a message (in my sketch I send 4 different message types when the Molgan wake up).

            Maybe there is still some disturb arising from the radio (sending a message require some power at least)? Now my project is working, actually with the sleep(1000) trick after each send.

            I don't know if the capacitors were effectively needed at this point...

            Hope this can help!
            bye!

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LastSamurai
              Hardware Contributor
              wrote on last edited by
              #103

              I am the one from your post and the capacitors only helped a little. One of my molgans simply doesn't seem to work.
              But you are right sending takes a lot of energy (vs doing nothing) so a bigger capacitor and/or pauses in between definitely should help!

              1 Reply Last reply
              0
              • R Offline
                R Offline
                ricmail85
                wrote on last edited by
                #104

                @LastSamurai
                Some more debugging and I see the problems arise when I do analogread, so does not seem related to the radio itself.

                If I send a message about a dht sensor (digitalread) it is ok. If I send a message of battery/light measure (analogread), the pir gets high...

                YveauxY 1 Reply Last reply
                0
                • R ricmail85

                  @LastSamurai
                  Some more debugging and I see the problems arise when I do analogread, so does not seem related to the radio itself.

                  If I send a message about a dht sensor (digitalread) it is ok. If I send a message of battery/light measure (analogread), the pir gets high...

                  YveauxY Offline
                  YveauxY Offline
                  Yveaux
                  Mod
                  wrote on last edited by Yveaux
                  #105

                  @ricmail85 does the behavior change when you swap the order of the messages sent? Eg first send the battery value.

                  http://yveaux.blogspot.nl

                  R 1 Reply Last reply
                  0
                  • YveauxY Yveaux

                    @ricmail85 does the behavior change when you swap the order of the messages sent? Eg first send the battery value.

                    R Offline
                    R Offline
                    ricmail85
                    wrote on last edited by
                    #106

                    @Yveaux yes, it seems to work better by sending before the messages performing analogread and then the one using digitalread...

                    YveauxY 1 Reply Last reply
                    0
                    • R ricmail85

                      @Yveaux yes, it seems to work better by sending before the messages performing analogread and then the one using digitalread...

                      YveauxY Offline
                      YveauxY Offline
                      Yveaux
                      Mod
                      wrote on last edited by
                      #107

                      @ricmail85 could be power related then. Try adding some sleep or wait statements inbetween each message sent.

                      http://yveaux.blogspot.nl

                      R 1 Reply Last reply
                      0
                      • YveauxY Yveaux

                        @ricmail85 could be power related then. Try adding some sleep or wait statements inbetween each message sent.

                        R Offline
                        R Offline
                        ricmail85
                        wrote on last edited by
                        #108

                        @Yveaux Yes I found a partial fix by adding sleep of 1000 ms after each send. And by doing analogread before digitalread. It seems related to power fluctuations. I ve already added some capacitors to the Pir. Shoul I add akso in parallel to the R2 resistance when reading the battery and light level?

                        Bye!

                        YveauxY 1 Reply Last reply
                        0
                        • R ricmail85

                          @Yveaux Yes I found a partial fix by adding sleep of 1000 ms after each send. And by doing analogread before digitalread. It seems related to power fluctuations. I ve already added some capacitors to the Pir. Shoul I add akso in parallel to the R2 resistance when reading the battery and light level?

                          Bye!

                          YveauxY Offline
                          YveauxY Offline
                          Yveaux
                          Mod
                          wrote on last edited by
                          #109

                          @ricmail85 I still think it's strange that you need the delays for a battery powered sensor. Normally the batteries can supply sufficient power to compensate for the bursts required when sending.
                          I don't want to read back the whole thread now, but what was your setup again?

                          http://yveaux.blogspot.nl

                          R 1 Reply Last reply
                          0
                          • YveauxY Yveaux

                            @ricmail85 I still think it's strange that you need the delays for a battery powered sensor. Normally the batteries can supply sufficient power to compensate for the bursts required when sending.
                            I don't want to read back the whole thread now, but what was your setup again?

                            R Offline
                            R Offline
                            ricmail85
                            wrote on last edited by
                            #110

                            @Yveaux This is my configuration

                            1. Arduino Pro Mini 3.3V
                            2. RFM69 radio 433MHz
                            3. Photo-resistor
                            4. DHT11 temp sensor
                            5. Battery voltage measurement through voltage partition.
                            6. The arduino and radio are powered by a 3.3V MCP1700-3302E voltage regulator

                            yesterday I've noticed the following. If I shutdown the gateway, the sensors fail to reach it and the PIR goes HIGH forever. By rebooting the gateway there is no chance to get it LOW. I have to remove the batteries and everything starts to work again.

                            YveauxY 1 Reply Last reply
                            0
                            • R ricmail85

                              @Yveaux This is my configuration

                              1. Arduino Pro Mini 3.3V
                              2. RFM69 radio 433MHz
                              3. Photo-resistor
                              4. DHT11 temp sensor
                              5. Battery voltage measurement through voltage partition.
                              6. The arduino and radio are powered by a 3.3V MCP1700-3302E voltage regulator

                              yesterday I've noticed the following. If I shutdown the gateway, the sensors fail to reach it and the PIR goes HIGH forever. By rebooting the gateway there is no chance to get it LOW. I have to remove the batteries and everything starts to work again.

                              YveauxY Offline
                              YveauxY Offline
                              Yveaux
                              Mod
                              wrote on last edited by
                              #111

                              @ricmail85 said in Multisensor PIR based on IKEA Molgan:

                              The arduino and radio are powered by a 3.3V MCP1700-3302E voltage regulator

                              I suspect the regulator injects noise in your supply and/or isn't able to supply enough power for a series of transmissions.
                              You could try powering directly from 2xAA battery, without using a regulator.
                              Both the ATmega and radio will work directly on 2xAA.
                              The DHT11 won't (IIRR) but there are many way better alternatives for it that work at less than 5V supply (e.g. Si7021, BME280, SHT11 etc.).
                              The PIR needs > 3.3V; refer to this post on how to power only the PIR from 3xAA.

                              If you don't need a lot of accuracy on the battery measurement (who does...) then you could consider using the Vcc library I wrote a while ago.

                              http://yveaux.blogspot.nl

                              R 1 Reply Last reply
                              0
                              • YveauxY Yveaux

                                @ricmail85 said in Multisensor PIR based on IKEA Molgan:

                                The arduino and radio are powered by a 3.3V MCP1700-3302E voltage regulator

                                I suspect the regulator injects noise in your supply and/or isn't able to supply enough power for a series of transmissions.
                                You could try powering directly from 2xAA battery, without using a regulator.
                                Both the ATmega and radio will work directly on 2xAA.
                                The DHT11 won't (IIRR) but there are many way better alternatives for it that work at less than 5V supply (e.g. Si7021, BME280, SHT11 etc.).
                                The PIR needs > 3.3V; refer to this post on how to power only the PIR from 3xAA.

                                If you don't need a lot of accuracy on the battery measurement (who does...) then you could consider using the Vcc library I wrote a while ago.

                                R Offline
                                R Offline
                                ricmail85
                                wrote on last edited by
                                #112

                                @Yveaux Thanks for your reply. I've done a lot of debugging today. And I guess I found the issue.
                                It's definitely related to the radio power consumption as you suggested.

                                I'm currently using the new RFM69 driver, with ATC enabled by default. As long as the power level stays below -4 dB, everything works fine. If the gateway is powered off, the radio power level automatically increases to 100% and the PIR behaves weird. It's always HIGH.

                                By rebooting the gateway, the node relink itself and gradually lowers its power. As before, when it goes below -4dB the PIR starts to work again.

                                Since it's a battery powered device I decided to set

                                #define MY_RFM69_MAX_POWER_LEVEL_DBM (-4)

                                at the beginning of the sketch file. Even if the gateway fails (shutdown) the PIR does not get HIGH anymore. All the measurements work fine now by limiting the max power to the radio.

                                By doing so all the sleeps of 1000ms after each send are not needed anymore.

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


                                12

                                Online

                                11.7k

                                Users

                                11.2k

                                Topics

                                113.0k

                                Posts


                                Copyright 2019 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