Shop Learn
How to turn on power to device with motion — Parallax Forums

How to turn on power to device with motion

Hello all, I'm looking for some advice on how to power up a small circuit board if there is motion detected. The purpose is on a sliding glass door, if there is motion I want to turn on a touch sensor metal strip on the edge of the door. The module must be battery operated and the goal is to get a minimum 1 year out of whatever batteries are used. The form factor goal for the batteries would be not to exceed the shape of 3 D size batteries, 4 worst case. The module will use a QT1010 cap touch sensor. In low power mode (slow) at 5V it states 73.5uA, in Fast Mode 729uA but I can get by with slow mode. The goal is to be able to run the device for 1 minute per day, every day of the year. In reality it will likely not get used for weeks at a time and used a few minutes a month, but I need to plan for 1 minute per day so that the battery life is 1 year minimum. A gyro chip doesn't seem like a good fit since it will require some processor to drive it non stop. I was hoping someone had some experience with a device that can detect motion and make a switch contact. Upon making a contact it would turn on the power to the microprocessor(unspecified but P1 is my go to if possible) and QT1010 for 1 minute. A P1 pin can power the QT as one option. If the sensor gets a trigger then a processor will drive a logic level mosfet to fire some other device that has it's own battery. The question is what method to detect some motion(door sliding), and what method to turn on power to the QT1010 for a predetermined time( ie a micro that counts to 1 minute or user defined, then it has a method to kill the power to the QT1010. During the 1 minute the micro will watch for a trigger from the QT1010, and if it sees an active high it will then drive a mosfet for 1 second, then turn off the power to the QT1010 and to the micro.

One problem will hooking up a motion type switch to 3v3 to provide power to the P1 is that the switch could be very short and the p1 would need sufficient power on time to boot, and subsequently turn on a another switch from the battery to provide power to itself until the P1 runs for the 1 minute and shuts everything back down.

Any suggestions appreciated!


  • Is the door always in the same position when the motion starts?


  • T ChapT Chap Posts: 4,070
    edited 2021-12-15 01:11

    The door can be anywhere. There is no known position for the start. Up to 40’ travel. This is an example of a switch I could make that has bit of weight on a swing arm that allows shorting 2 wires. I don't know if something exists like this off the shelf but that would be nice. Only a quick contact would set turn on the circuit that would turn on the power to the microprocessor and QT1010. Then the microprocess turns back off the power.

  • is that 40 inches or 40 feet?

  • T ChapT Chap Posts: 4,070
    edited 2021-12-15 04:20

    40 feet max travel. Here is the general idea of a circuit where a movement switch will short and turn on an NPN mosfet, which provides the low side to the Micro and QT1010 and also a relay that then allows continuous power back to the NPN gate. Some obvious problems with the PNP pullup it should be pull down . The micro just needs to provide a high to the PNP mosfet to turn the circuit off. EDIT. I think the term for the switch is metal ball tilt switch.

  • You want to have the battery totally disconnected. Then the movement switch latches a relay or transistor, after the system completes its work cycle the relay or transistor unlatches. Like a key Fob when you press a button it connects the battery.

  • T ChapT Chap Posts: 4,070
    edited 2021-12-15 21:12

    Here is a concept. Using a bi-directional mosfet TLP222a and a PNP mosfet. The metal ball tilt switch turns on the LED on Switch1 by connecting Batt- then the TLP22a switch will provide the GND to the LED so it stays on. The TLP222a provides the low to the Micro and the QT1010. If the Micro( probably P1) + QT1010 (73uA) + the TL222a LED cost less than 50 millamp for 1 or 2 minutes per day * 365 days, then 2 Duracell D size batteries in series (3V) should provide 18000 mAh and last a year which is the goal. The micro will turn on a pin to the PNP mosfet to shut down the system.

    I have used this boost reg to make 3v3 before so I have the footprint ready to drop in.

    Any suggestions on this idea?

  • Maybe you could adapt RE46C190 smoke detector IC as your trigger circuit. It would give you that ultra low watchdog current draw.

  • Your image was a bit hard to read, so I inverted it, boosted the contrast, and converted to grayscale:

    Also, when you're posting something other photos, it helps to use PNG or GIF encoding, rather than JPG. That would eliminate the halos around your lines.


  • Christof Eb.Christof Eb. Posts: 576
    edited 2021-12-16 17:02

    for the sensor, you might consider a tilt switch or two:
    What about a discrete Thyristor circuit:

    R2 and R1 can be pretty high.

  • A piezo film tab makes a good vibration or acceleration sensor A small weight can be added on the end of the tab. The tab would be oriented so that motion of the door causes the tab to flex. It could easily generate enough voltage to turn on a mosfet.

    You mentioned a rolling ball sensor. I recall an SMT device of about 1206 size that had an internal plated cavity with a gold ball inside. Very sensitive.

  • I'd go for the Christof's solution.
    It's so beautifully simple, effective and reliable.
    The old school electronics design and it shows. Or at least I can see it :).

  • Thanks for all the suggestions!

  • One comment, a Prop running at RCslow most of the time, at ~30µA, could in theory run for 45 years on a pair of D cells. That is 12Ah, divided by 30µA. Heck, make the average current 1mA, and you still have more than a year out of it. So just have the Prop monitor the motion switch and then go to higher clkfreq to turn on the QTsensor and do the one minute/day task when triggered.

    Here are links to that clever SMT passive vibration sensor, near zero power.
    A product of,
    Available from Newark/Farnell, mvs0608-02

    We bought a couple and considered using it for a personal monitor, to gage activity and compliance, the big advantage being simplicity. But it turned out that a little accelerometer was cheaper, and allowed for feature creep (hehe).

  • jmgjmg Posts: 14,876

    @"T Chap" said:
    Hello all, I'm looking for some advice on how to power up a small circuit board if there is motion detected. The purpose is on a sliding glass door, if there is motion I want to turn on a touch sensor metal strip on the edge of the door.

    Another approach is to make or select the touch sensor low enough power, so that it does not need a helper circuit ?

    eg This series claims 50uA operate, with lower with sleep options

    On shock/tilt sensors, I did find

    and Digikey shows rolling ball switches.

  • Tracy that device looks perfect. I’ll order it. Also good idea on using RC slow. If I can get a year that would be fine. It will flash an LED for 100mIlliseconds on each motion detected for easy tracking of being alive to know when batteries are dead. I’d still need to use the boost reg to push 3v to 3v3 for the prop power do I’ll have to read up on what that reg will add to the battery drain if it is on all the time.

  • <<I’d still need to use the boost reg to push 3v to 3v3 for the prop>>

    The Prop operates fine at 3.0V, in fact its official Vdd spec covers 2.7 to 3.6V. A pair of alkaline cells should be fine, neither boost nor regulation required.

    The internal brownout detector kicks in when Vdd drops below 2.7V. However, if it is not enabled via the BOE pin, the Prop will work down to lower voltages. As low as 1.6V on RCslow--See Marty Lawson's thread,

  • Thanks Tracy. I never considered running below 3.3 so that makes things simpler.

  • ercoerco Posts: 20,060
    edited 2021-12-27 22:39

    My new favorite sensor is this dirt-cheap ($5 for 5pcs on Amazon) RCWL-0516 Doppler microwave sensor. I have one inside my office door, it senses outside people THROUGH the wooden door and triggers two LED displays to greet them. I have the output switching a logic-level mosfet for several seconds, and the module can be continously retriggered by more motion. At 5V, the sensor-only draw is just 1-2 mA so a battery would last a long time as long as the triggered load doesn't drain power too fast.

    Not the best video but it inspired me to try the sensor and I had immediate success compared to this Youtuber!

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,173
    edited 2021-12-27 22:57

    Cool product. Interesting video, although the disadvantages of not rehearsing are plainly manifest.

    I could see incorporating this thing into an ultrasonic deer repellant device.


  • Tracy AllenTracy Allen Posts: 6,593
    edited 2021-12-28 21:25

    Erco, wow, at less than $1 each! I see that same one on MPJA for $2 each, where you can find a data sheet and reviews that link to a nice Github repository, and thence to another source, ICstation at 5/$8.

  • T ChapT Chap Posts: 4,070

    I ended up using a battery switching circuit I had used years ago but forgot about. An NPN-PNP mosfet designed for battery switching - On Semi NTGD1100L. Their schematic is shown, mine is more convoluted. I added a switchable option for 3V direct from batteries, or if I mount the ADP1613 boost regulator then it will power the board with 3v3. I ended up designing my own movement switch (not shown yet) which is quite simple. The idea is the board powers up on motion, the Prop then can either trigger a 900Mhz keyFOB type transmitter and have a receiver on the other end, or use a wifi module. I have some RN131 GSX modules so I've been testing with that. It just connects to the house wifi, on a trigger detection it sends a packet over wifi to another module that is set to server mode. That module has a Propeller and it sends RS485 to the controllers on the far end. So far it's working well. Just built boards today.

Sign In or Register to comment.