Motion Sensor Led Strip - Page 1
Forum section: electronics / beginners

author: bitman
author_rank: Unknown
timestamp: April 14, 2017, 07:56:02 pm
content: I'm very much a novice building pure electronics. Logic circuits is another matter, but straight out just basic electronics is something I'm barely begun dappling in. I created a very simple circuit NOT using a simple arduino. I'm beginning to regret that, but before I toss it I would like some input. The very basic schematic is attached here. There's a 9v battery, a 7805, a HC SR601, a Led Strip (one of those that comes in a roll) and a simple PNP transistor. That's it! The switch is a rocker with a small LED - I had no luck finding a symbol for it, so I just drew the basic switch into the diagram.Issue: This thing seems to be eating the battery up for lunch. I'll goof around a bit getting the AMPs, but I already know it's going to be way too high. So my question is, where did I goof up? Is the SR501 just not a good candidate that draws too much current? Since it's a 5v sensor I had to scale things down a bit so I used a basic 7805, which of course also consumes additional current. And finally I placed the switch AFTER the 7805 - because the build in led only takes 5v too. 9V is needed to get enough brightness on the LED strip to be useful. I would actually like it at 12v but that probably will be v2 if I ever get there.Part of the idea here was a small project for me to dabble in, getting something soldered and put in a box. I've learned a lotBut this doesn't seem to be practical as is.

author: sokoloff
author_rank: Super Contributor
timestamp: April 15, 2017, 11:29:41 am
content: If you increase the value of R1 to around 680 ohm (or even try 1k first), you should be able to put SW1 ahead of the 7805, eliminating standby losses from the 7805.You're going to be dumping a lot of energy (relative to a 9V battery's capacity) through SW1's LED (and a larger amount of waste through the regulator and resistor).That's a long way of asking "Do you really need the SW1 LED functionality in this circuit?"

author: Rick Law
author_rank: Super Contributor
timestamp: April 15, 2017, 08:25:54 pm
content: Just in case you are not aware of this: Comparing to something like a AA battery, 9V battery has very low mAH. At best, 1/2 to 1/3.My rechargeable 9V is only 200mAH whereas my rechargeable AA are 2000mAH. Primary batteries will have more than rechargeable. The best mAH from a 9V battery is around 450mAH. The PIR and the 7805 together will eat up 10mA easy. At 200mAH even if the light is not on, the battery is not going to last a day.If you do add an Arduino, battery is going to cycle even faster!I too have a PIR+LED running. I use a single Cree (250mA) LED. I run it off 5V and switched by aAMC7135. I use an Arduino NANO so I have a PWM for brightness control as well as logging PIR trigger date/time displayed on a 20x4 LCD driven by the NANO. I could use that setup to run LED up to ~1Amp by adding two more AMC7135, but I don't need that much light.In my case, I already have a laptop which takes time lapse photo (USB camera) set up a few years back. The LED is a later addition to provide light for the photo. So, the laptop makes a convenient power source for the NANO, but I can also run it with 5V power-brick. With the NANO connected to the laptop for power, it also tell the laptop when PIR is triggered so the laptop will keep the time lapse photos only when PIR is trigger-on. The NANO also decides if the external light is already high enough (photo resister), the LED doesn't need to come on.

author: bitman
author_rank: Unknown
timestamp: April 15, 2017, 08:58:37 pm
content: Quote from: Rick Law on April 15, 2017, 08:25:54 pmThanks! You pretty much confirmed my fears that I had totally misunderstood the configuration I created. I'd already gone down the thought pass of stepping up the voltage instead of down, but I had no clue that 9V batteries had that little "juice" in them. Live and learn.Quote from: Rick Law on April 15, 2017, 08:25:54 pmOk - that shows that I'm in way over my head here. I hate to admit but looking up AMC7135 just raised more questions than answers for me. I have a feeling it steps up voltage but the datasheets I see doesn't seem to say so (just the opposite). As to the arduino, I was thinking of adding a simple wifi module to it and do what you're talking about, but yeah - it will eat battery even faster.Thanks for replying ... one more step towards better understanding of this thing called current

author: Rick Law
author_rank: Super Contributor
timestamp: April 17, 2017, 01:25:59 am
content: Quote from: bitman on April 15, 2017, 08:58:37 pmDon't feel bad, that is how we learn. I am a relatively inexperience hobbyist also and I have made my share of mistakes. Fixing the mistake is a great learning experience.Quote from: bitman on April 15, 2017, 08:58:37 pmI hope this helps with understanding the AMC7135AMC7135 is designed as an LED driver chip running at up to 6V. Each chip switches 350mA. They are designed to be able to run in a gang of other AMC7135s: you want 700mA, you use two chips (350+350). So on.AMC7135 has just 3 pins: Out, Ground, Vdd (ie:switch)The LED goes between Vin to the 7135's OUT pin.- If the 7135's Switch pin (i.e. Vdd pin) has zero volt, the LED is off.- If the 7135's Switch pin has Vin (5V) the LED turns on.If you arenot using Arduino, you can just use yourPIR to feed the AMC7135's switch pin.Because I want to log each time the PIR was triggered, I needed something more than just the PIR, ie: Arduino. With Arduino in the picture, I might as well do brightness control (PWM). So, what I did was to use the Ardunio's PWM output and feed that into the 7135's switch pin to turn the LED on/off depending on the PIR sense, and at specific % brightness controlled by the PWM. The Vin is fed from the same Vin for the Arduino, voltage regulated down to 3.3V. Since I did not need so much light (just enough for my USB camera), I get by with a single LDO voltage regulator and a single 7135. The LED+ is with the 3.3V regulator output, the LED- is the AMC7135's OUT pin.Actually, I one more "if statement" there - before it turns LED on, the Arduino checks the external brightness via a photo resistor. If it is bright enough, it wont turn LED on. Just so I save the battery when it is running with battery power (which I rarely do).I get my AMC7135 in 10-packs from FastTech.com for a bit over a dollar (if I remember correctly). So, they are only about 10 cents each.

author: bitman
author_rank: Unknown
timestamp: April 17, 2017, 02:07:41 pm
content: Quote from: Rick Law on April 17, 2017, 01:25:59 amOhhh I'm not. I just need to pick my "battles" more carefullyQuote from: Rick Law on April 17, 2017, 01:25:59 amSo I think that's what has me a bit confused. That doesn't fit the led model I haveThis seems to be targeted towards single or "special" led applications like flash-lights. What I have is something like this:https://www.diodeled.com/media/catalog/product/cache/2/image/2500x/472321edac810f9b2465a359d8cdc0b5/b/l/blaze-wet-location-tape-light.jpgand for one, it takes more than 6volts to be bright enough. But then, maybe that's a current thing, not a voltage. Anyway, the strip is fairly long for my application and nothing below 9v has provided enough light to be worth it. Usually it runs at 12v for full brightness. When I have just a few leds on a strip, I've managed to have it on for days without seeing any dimming of the lights from a simple 9v battery. The strip usually comes with plugged in transformers, and yes there is a motion sensor available for it too, but all of it seems to be targeted a plugged in setup.So that may be my problem - the wrong led type that takes too much current to work well of batteries. But I presumed that since the strip would only be on for 20-30 seconds a day it wouldn't be too big of a deal. I never expected the sensor/power setup to eat as much as it did.Quote from: Rick Law on April 17, 2017, 01:25:59 amSo it seems it does what my strip already does - keep current constant so all the leds light up equally bright? That's built in to the strip. I just need to provide enough current for the whole strip to light up.Quote from: Rick Law on April 17, 2017, 01:25:59 amHeh - yeah, you're quite a few steps ahead of me. That's some of the same features I was looking at implementing. But since you're regulating voltage down too (to 3.3v) it seems like I'll be in the same boat again?

author: Rick Law
author_rank: Super Contributor
timestamp: April 18, 2017, 04:32:53 am
content: First, let me say this. I am no expert. Just another hobbyist perhaps (in your words) a few steps ahead, perhaps. My solution grew over the years and learned as I go. So, it is just "one man's experience" and may not be the best technical solution.You brought up some interesting questions, I will touch on them - arranged in differ order.Quote from: bitman on April 17, 2017, 02:07:41 pmYour strip (from your link) is set up as units of three LEDs- look at the cut-line and you can see that as well. Each unit has 3 LEDs in series with a ballast resistor to run at 12V and all theunits in the strip runs in parallel.Not that I suggest you do it, but the way it is made, that ballast resistor is set up for 12V. A different (lower) resistor would allow it to run at lower voltage.You very well may want to use the plug-in set up, see reasons later in the reply.Quote from: bitman on April 17, 2017, 02:07:41 pmNo,the strip doesn't keep constant current. My solution doesn't either. As the LED warms up or voltage change, the strip will draw different amount of current producing different level of light.Each unit of 3xLED can draw different current, but within the unit, all three LEDs will have the same current.My solution keeps it at constant source voltage (3.3v) and not constant current. The 7135 doesn't control current per-se, it really just limits it to 350mA so you control it by adding another 7135 for another 350mA. Since I am drawing below 350mA, so the 7135 can't do a thing but be a mere on/off switch.As LED warms up, there is a difference in current draw and brightness. My solution does have thepotential capabilityto produce constant brightness with minor code modification. Since I already have a photo-resister feedback (for now just used to decide on or off), and since I made it with PWM to control brightness already, I could use the photo-resister reading to keep the LED at constant brightness.Quote from: bitman on April 17, 2017, 02:07:41 pmThe 7135 might have been designed for flashlights, I just found it a great little switch to use particularly since it is designed with low-power-waste, PWM & LED in mind as compared to a general purpose transistor for switching.I choose to use single LED over a long strip for a couple of reasons - main reason is if I need to make it very bright, I can do so in very limited space, and I can aim the lights better comparing to a strip. The other is, as they age, they get dim. Individual LEDs allows me to manage it better (swapping out individual ones, or even change them so edge ones are lower and middle ones are brighter).My solution is not a clean thought out implementation. It grew over the years. It was (a) to see who is eating the cat food outside, and (b) who is walking the dog on-tomy lawnto let the dog do its business on my lawn!An earlier version of my solution (with very bright LED and two piezoelectric beeper) scared the dog-walker away. So, now my set up is reduced to cat-watching with the exterior piezoelectric beeper removed as well. At the earlier solution, I actually had the Arduino (with relay module) "press the garage button" to open my garage door and then within a second (before garage door opens more than a few inches) closes it. That simulates my action whenever I catch a dog-walker near my driveway. But concerns over forgetting to turn it off when I am out, I eliminated that as quickly as right after showing it does work. If I left it on while I am out, someone can take advantage of that and walk into my house via the garage - all it needs is just something obstructing the closing and the garage door will stay open. That "deployment" didn't last much longer than the test phase just to "have done it".Quote from: bitman on April 17, 2017, 02:07:41 pmWell, regulating to 3.3V is not the issue here. Strip or single LED, PIR will be just driving a switch whether the switch is a general purpose transistor or an AMC7135.If you are thinking about logging, you will be using at least an MCU (Arduino, I assume) or perhaps even Laptop connection. Between the MCU and the PIR, your battery is going to be driven hard. An Arduino UNO + PIR + LED + RealTimeClock probably would use up the 9V battery within afew hoursif that long. If you are planning on viewing the log without a PC, you will need an LCD screen on your Ardunio...So, that bring us back to power usage. You just may want to run it off a car-battery! A cheap auto battery would give you5000mAH50AH (50,000mAH) at 12V. The 12V transformer (for your strip) can very well supply the MCU/PIR setup as well. Car battery or transformer,the switching part of the circuit doesn't have to run at the same voltage as the LED light circuit.You can use amore power-efficient buck converter(as oppose to linear regulator) to step down the voltage to 7V-ish for your Arduino Vin and PIR. If you trust the buck enough, you can step-down all the way to 5V and by-pass the voltage regulator in the Arduino board's Vin. Directly connecting your buck converter 5V out to Arduino's 5V out is risky. If your buck converter fails, your Arduino (and everything else connected to it) may fry. But you do save power with buck as compared to linear regulation so bucking down to 5V instead of 7V will eliminate theadditional wasteof regulating 7V to 5V.My solution simply grew from initial simple deployment. There may be better solution to it such as an off-the-shelf solution with it's own lighting. My solution is not an ideal one. It just grew to be exactly what I needed.EDIT: corrected typo above. Small/cheap car battery typically is around 40-50AH, I mistyped. Small UPS battery would be around 5000mAH.