Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Motion sensor light that latches on and off

Status
Not open for further replies.

BingoBango

New Member
Hello electronics peoples! :D

I'm in the process of making a reading lamp for myself and am stuck on the electronics side. My aim is to make a 240v lamp where one can pass their hand past a face on the lamp and this will switch it on, and when the user wants to switch off the lamp they simply pass their hand past the face with the sensor again to switch it off.

I've considered a few different approaches to this such as:

1. Taking apart a standard 240v motion sensor light and using the innards in my lamp. The only complication with this is the timer circuitry that all the motion sensing lights seem to have. I don't want to sit down to start reading and a few minutes later the lamp switch off if i don't wave my hand in front of it every now and then. There also comes the difficulty of switching it off when i want to as waving in front of the sensor again won't switch it off, and I don't want to have to use a manual override switch.

2. My second thought is to use a picaxe to drive the motion sensing side of things but really have very little understanding of this area (the internet and my boss have gotten me this far); I've got a high power picaxe that can handle 3A 24V (apparently). I figure I can send the input from a PIR (passive infrared sensor) into the picaxe and then use the output from that to drive a relay to switch on the 240v light. But I will also need to somehow power the picaxe (as I don't want to have to use batteries for this and would rather run it off the same power as the lightbulb...). Writing the software to get it to latch on when the motion sensor is triggered and then to latch off when the motion sensor is next triggered. Assuming my theory is correct on this one, how do I actually go about all this? I've no idea how I'd actually build such a circuit. Do I need anything between the bare motion sensor and the inputs for the picaxe, etc.? How do I power it off 240v 10A mains (in Australia).

Absolutely no idea.

If anyone has a better solution or can help me to understand/start one of the two above I would really appreciate it.

Thanks!
 
Most motion sensor lights with timers have a "test" setting where the timer interval is really short, like 5 seconds or so. Set it to that, then connect it to a latching relay to turn your light on and off. That's the easiest way.

Is there any reason you don't want to make it a touch sensitive light? The touch sensors are usually touch-on touch-off, and often have 2 or 3 brightness levels.
 
I thought about buying a motion sensor light, turning down the timer and swapping the 24v relay for a 24v latching relay but then I spoke to an electrician and he said something about needing to run an active in parallel to hold the relay in one state and then reversed to hold it in another (I think he was confused and thought I wanted to run two relays to achieve the same end as a latching relay - but then I've never used them so I just took his advice...).

My fear with the latching relay idea is running the 5 or so seconds of power to it in the low-time setting, is this not bad for the relay?

I had considered touch-sensors, in fact these were my first thought. However, speaking to my local electronics part shop guy I was deterred from them as he said that he'd seen very many capacitance type touch switches fail after a few months. Having looked into the switches a bit more, the resonance ones seem quite tough in comparison though.

So would swapping the relay in be a safe way to achieve the latching motion-sensor light? Or would the time the power is being sent to the relay burn it out?
 
We've had touch sensitive lamps and they've lasted for years. I don't know what type of sensor they are, but I'm sure they are the cheap kind.

If you use a latching relay, check the specifications on it to see how long the coil can be kept energized without overheating. Chances are 5 seconds won't kill it.
 
No timer needed

a photo cell, an ssr and a D flip flop is all the major componets needed.
a few caps, a voltage regulator into the mix
you have to have the phpto cell shielded from the light or it won't work as planned.
a simple switch debounce might trigger the the flip flop?? need to research.
 
my bad not a photocell

but a photo transistor
see attached schematic
use a wallwart for powering the electronics.
be forewarned this circuit should work but ??
and you are dealing with high voltage!!!
the D flip flop is a divide by two.
you pass your hand over the flip flop changes states from low to high
you pass your hand over the flip flop changes states from high to low
hope this helps
do a search and see how this works
 

Attachments

  • light switch.PNG
    light switch.PNG
    24.1 KB · Views: 1,832
got to thinking about the schematic I posted

might work better if the photo transistor is connected from the Vcc/clk input to ground
see attached
 

Attachments

  • light switch2.PNG
    light switch2.PNG
    24.5 KB · Views: 1,850
Thanks a lot MrDeb. Not having an electrical background I'll have to get my head around your diagram and get back to you about how I get on :)
 
more questions

Using wikipedia and google I’ve managed to gain a partial understanding of the circuit you’ve kindly post for me. I’m struggling in a few areas however and would really appreciate your assistance with a few questions I have (I’ve add numbers to your drawing to correlate with my questions). Please accept my apologies in advance for what I assume are extremely naive electronics questions.

1. What does this symbol stand for and where should it connect to? I did an electronics symbols search and couldn’t find it.

2. What size photo transistor would I need? Would this one suffice? **broken link removed**

3. You’ve placed two values, 100 and 180 on this resistor. Which should I buy?

4. I assume this is a triac of some sort. Is there a specific rating triac I should buy?

5. I’m confused about how the AC power connects to this circuit at this point. Using a wallwart, how would the active, neutral and ground connect to this circuit?

6. Probably the most naive of my questions, why is this CD4013 out here unconnected to anything?

7. Lastly, I’ve found the CD4013 and MOC3041 chips at my local supplier I believe. Are these the correct ones?
a. **broken link removed**
b. **broken link removed**

I’m not sure if I’m allowed to post links to supplier websites on the forum. If I’m not allowed please let me know and I’ll remove them straight away.
Many thanks in advance!
 

Attachments

  • light_switch_questions1.JPG
    light_switch_questions1.JPG
    60.1 KB · Views: 1,783
ansewers to important questions

1. What does this symbol stand for and where should it connect to? I did an electronics symbols search and couldn’t find it.

2. What size photo transistor would I need? Would this one suffice? Infrared Phototransistor - Jaycar Electronics

3. You’ve placed two values, 100 and 180 on this resistor. Which should I buy? the value can be anywhere in between

4. I assume this is a triac of some sort. Is there a specific rating triac I should buy?not really. your only switching half of your A.C. poweryour A.C. power comiong from the wall plug has 2 outputs - one is considered HOT while the other is NETURAL(but still has potiential for shock!) You only need to have the triac switch one side of your A.C. power

5. I’m confused about how the AC power connects to this circuit at this point. Using a wallwart, how would the active, neutral and ground connect to this circuit?The wallwart is for powering the electronics only. not the triac

6. Probably the most naive of my questions, why is this CD4013 out here unconnected to anything?In the cd4013 there are two seperate indivual circuits in one package. You only need one hafe of the package.

Be sure to use sockets for the I.C.'s\
As a suggestion, when your at Jaycar, see if someone there can offer assistance. You are in dangerious territory when dealing with 110/220 voltage

hope this helps

7. Lastly, I’ve found the CD4013 and MOC3041 chips at my local supplier I believe. Are these the correct ones?
 
oups, forgot to address #1 question

the little triangle denotes dc power
this can be a regulated walwart unit or a battery, The electronics could be powered by a battery if you don't want to use a wal wart.
the photo transistor-I need to look at your link
 
Woohoo, almost there :)

Many thanks once again MrDEB, your answers have provided me with a greater understanding of how this circuit works. I'm also a bit excited about heading to Jaycar to buy the parts now :D

If you've the patience to humour me I've a few more questions just to make sure I'm on the right path before I attempt making this circuit - as there are a few things I've not quite got my head around:

1. Does the rating for the wallwart that connects to the sensor depend on the PIR sensor rating alone? Based on the one I linked earlier I assume it's 5v max, but what current should the wallwart produce?

2. Are these 2 points where the wallwart connect? And does it matter whether the positive goes to one or the other?

3. Are these ground connections? Or part of the D.C. power? - again, sorry for the really naive question.

4. Is this roughly how the light would be connected to the triac?

5. Jaycar don't seem to have the MOC3041, would the MOC3020 or MOC3021 suffice instead?

I've made lamps running off 240v before but have never attempted to go down the electronics route before, rather than the simple in-line switch... I'm really enjoying learning this and will be sure to have the fellas at Jaycar help me out to ensure I'm safe :)

Thanks again!
 

Attachments

  • light_question_2.JPG
    light_question_2.JPG
    60.9 KB · Views: 400
revised drawing

note, after looking at data sheet for IR led I changed the pins (see data sheet for both the phototransistor and both ic'c
the wall adapter has a plug on the end. if you have no volt meter or can't denote the + wire from the - then suggest getting a jack for the plug end.
You could buy an LED and place it across pins 1 and ground (be sure resistor is connected to led as well (just plug the LED into pins 1 & 2 of the 6 pin socket.) This you can do before connecting high voltageto your circuit.
Just to see if your electronics work as planned.
if LED dosn't light then you might have it backwards.
the flat side goes to pin 2.
 

Attachments

  • light switch3.PNG
    light switch3.PNG
    36.4 KB · Views: 942
Well 1 method could be that you use ir LED and a TSOP(of desired frequency), and use a JK flip flop.when u will pass your hand ir will be reflected from your hand & can be sensed by TSOP otherwise signal strength will not be enough to be sensed by TSOP. Simultaneously use a JK flip flop which will toggle itself each tym.
 
a phototransistor

is what I am proposing.
the phototransistor makes the input low. passing hand over turns off the phototransistor thus creating a high.
no need for reflection but am wondering if the IR detector will be as sensitive as a true phototransistor or perhaps a photodiode would work better?
 
Perhaps I could buy a few sensors that would be interchangeable should one of them not work or not be sensitive enough. Suggestions?
 
Just go with the phototransistor

connect an LED into pins 1 & 2 of the 6 pin socket to test before inserting the opticoupler and connecting high voltage.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top