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. MySensored 230v motion sensor with light level

MySensored 230v motion sensor with light level

Scheduled Pinned Locked Moved My Project
17 Posts 9 Posters 15.5k 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.
  • korttomaK korttoma

    I have been searching for a nice enclosure to use with some motion sensors but nothing was to my satisfactory. So I started to look at different motion sensors to see if I could find something I could modify. I found this one at my local electronics shop. Both looks and prize was right so I picked one up.

    I cut the Live copper strip to the relay and removed the wire that would normally go to the lamp and removed 2 capacitors (marked with red and green), soldered 2 wires to were a capacitor had been to access the relay contacts (marked with green).
    WP_20141126_001.jpg

    Destroid one of them 90 cent iPhone charger clones to get a 5v power supply added a Pro Mini with radio and a LM393 photo resistor.
    Connected the relay contacts to GND and a binary in on the arduino and the photo transistor to a analog in.
    WP_20141126_003.jpg

    Here is the result:
    WP_20141126_006.jpg

    And here is the sketch:
    https://codebender.cc/sketch:62574

    Have not attached it to the ceiling yet just had it on the floor for testing, motion sensor works great but I'm not sure if the light sensor will be sensitive enough.

    Think I'm going to add a 2A glas fuse to it because of the cheep 5v power just in case.

    RJ_MakeR Offline
    RJ_MakeR Offline
    RJ_Make
    Hero Member
    wrote on last edited by
    #2

    @korttoma

    No way to use the on board power for the Arduino?

    RJ_Make

    1 Reply Last reply
    0
    • daulagariD Offline
      daulagariD Offline
      daulagari
      Hero Member
      wrote on last edited by
      #3

      Good example you to work with 230 Volts relatively safe without too much effort!

      No way to use the on board power for the Arduino?

      Yes that should be possible but maybe less safe.

      1 Reply Last reply
      0
      • korttomaK Offline
        korttomaK Offline
        korttoma
        Hero Member
        wrote on last edited by
        #4

        Finally had time to mount this thing to it's final location and as I feared the light sensor is not sensitive enough. Does anyone have a suggestion of a light sensor that has high sensitivity at low light levels?

        • Tomas
        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mrlynx
          Hardware Contributor
          wrote on last edited by
          #5

          @korttoma have you tried using a ldr-resistor on an analog input?

          http://www.sa2avr.se

          1 Reply Last reply
          0
          • korttomaK Offline
            korttomaK Offline
            korttoma
            Hero Member
            wrote on last edited by
            #6

            I found an LDR at my local store that is 24 kohm - 1 Mohm acording to simulation it will give me 100mV - 2,3V on A0 with R1 at 20kohm. Could this work better then the LM393 Light Sensor I'm using now?

            LDR.jpg

            • Tomas
            1 Reply Last reply
            0
            • korttomaK Offline
              korttomaK Offline
              korttoma
              Hero Member
              wrote on last edited by
              #7

              So I replaced the LM393 Light Sensor with an LDR according to the previous picture.

              I had to make a small change to the sketch since the reading was inverted. High value at low light and vice versa:

              Replaced:

              int lightLevel = 1023 - analogRead(LIGHT_SENSOR_ANALOG_PIN);
              

              with:

              int lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN);
              

              I now get way better sensitivity at low light level, I'm happy :D

              Now to PLEG some lights according to Light level in Vera.

              • Tomas
              1 Reply Last reply
              0
              • AnticimexA Offline
                AnticimexA Offline
                Anticimex
                Contest Winner
                wrote on last edited by
                #8

                Be careful using cheap Chinese iPhone charger clones. They are definitely not safe to use: http://www.righto.com/2012/03/inside-cheap-phone-charger-and-why-you.html

                Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                korttomaK 1 Reply Last reply
                0
                • AnticimexA Anticimex

                  Be careful using cheap Chinese iPhone charger clones. They are definitely not safe to use: http://www.righto.com/2012/03/inside-cheap-phone-charger-and-why-you.html

                  korttomaK Offline
                  korttomaK Offline
                  korttoma
                  Hero Member
                  wrote on last edited by
                  #9

                  @Anticimex Yeah, I know. This is why I added a small glass fuse to the 230v of it all. I hope this will be sufficient if something does go wrong.

                  • Tomas
                  AnticimexA 1 Reply Last reply
                  0
                  • korttomaK korttoma

                    @Anticimex Yeah, I know. This is why I added a small glass fuse to the 230v of it all. I hope this will be sufficient if something does go wrong.

                    AnticimexA Offline
                    AnticimexA Offline
                    Anticimex
                    Contest Winner
                    wrote on last edited by Anticimex
                    #10

                    @korttoma Yes, that's a good ide. Just wanted to mention it in case someone decides to read partial parts and go ahead and do "crazy stuff". You would not believe what people do given a little encouragement :)

                    I plan to, at some point, do a bit checkup on the availablility of AC/DC converters, "battery eliminators" that could be suitable with respect to cost, but most of all, efficiency. Not nice to have something that goes too warm and waste energy for powering a device that itself draws next to nothing :)

                    Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                    1 Reply Last reply
                    0
                    • jeylitesJ Offline
                      jeylitesJ Offline
                      jeylites
                      wrote on last edited by jeylites
                      #11

                      @korttoma Very interesting project. Nice work! I'm just curious does it dim the lights in response to varying ambient light levels or is it a ON/OFF setup?

                      korttomaK 1 Reply Last reply
                      0
                      • jeylitesJ jeylites

                        @korttoma Very interesting project. Nice work! I'm just curious does it dim the lights in response to varying ambient light levels or is it a ON/OFF setup?

                        korttomaK Offline
                        korttomaK Offline
                        korttoma
                        Hero Member
                        wrote on last edited by
                        #12

                        @jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.

                        The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.

                        • Tomas
                        jeylitesJ AWIA 2 Replies Last reply
                        0
                        • korttomaK korttoma

                          @jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.

                          The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.

                          jeylitesJ Offline
                          jeylitesJ Offline
                          jeylites
                          wrote on last edited by jeylites
                          #13

                          @korttoma Nice!

                          That will be great to have the the lights dim in response to varying ambient sensor light levels. I'm still researching on AC triac based PWM dimming which I'm planning to use My Sensor LED Dimmer run it.

                          !AC-board-schematic.jpg electronique_interface_230V_001.gif

                          1 Reply Last reply
                          0
                          • korttomaK korttoma

                            @jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.

                            The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.

                            AWIA Offline
                            AWIA Offline
                            AWI
                            Hero Member
                            wrote on last edited by
                            #14

                            @korttoma You will need a light level sensor or LDR to do such thing.. You can find them in the store

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              Rina
                              wrote on last edited by
                              #15

                              Cool, I tried do do "crazy stuff" on this one, without encouragement...
                              https://www.mrosupply.com/electrical/signaling-visual-audio/2487583_21104634000_pfannenberg-inc/

                              1 Reply Last reply
                              0
                              • Cameron PayneC Offline
                                Cameron PayneC Offline
                                Cameron Payne
                                wrote on last edited by
                                #16

                                @korttoma love this and works great! But is there any way to remove the relay from the equation so you don't get that clicking noise each time the sensor goes off?

                                Thanks!

                                1 Reply Last reply
                                0
                                • korttomaK Offline
                                  korttomaK Offline
                                  korttoma
                                  Hero Member
                                  wrote on last edited by
                                  #17

                                  Hi @Cameron-Payne I'm not sure how to replace the relay in a safe way but maybe an optocoupler could do the trick if you can find one that can handle 230VAC.

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


                                  15

                                  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