Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Movement detector
I sketched the wiring of the connection of HC-SR501 to the enviroment sensor board. Suggestions for improvement are welcome.

[Image: fetch.php?media=pir2env.png]

And idea how to track the battery status of such a env-sensor? As it powered by the voltage regulator the battery status will remain at 100%.

Is it sufficient if I connect a voltage divisor to an analoge input pin?
They convert 0..1.1 V to Value of 0..255, right?
If so for 4 AA it would be max 6 V as V_in.

V_in >----| R1=4.7k |----+----| R2=1k |---->GND
                         +----> PC3
like this?
I had a similar idea for measuring battery life.
You should need much higher resistors to reduce the current, and you may use an additional uC output pin to only switch the voltage divisor to Vcc when checking the battery, so it doesn't drain the batteries all the time.

I want to power this thing from a 3.3V stabilised step up regulator, these are available with Vin from 0.8V - 3.3V and only use 2 AA batteries. My first motion detector uses 4.5V minimum, and I power this from a 5V step up converter. Probably it's running from 3.3V and got an onboard 3.3V regulator, I didn't check before. It's running for app. 2 years now.

Why do you use a transistor 2N3904 in your circuit?
Would 4.7MOhm and 100kOhm be OK?

I thought the transistor makes this safer. Can I connect the voltage OUT directly to PB2 ?
My PIR puts app. 3V at the output pin, so I connected it directly, or maybe put a 10k between. Not sure, have to look at it. Check the voltage when movement is detected, it should be < 3.3V. Then you can connect it directly.

For measuring the battery status: If you have 4 cells, voltage may be a bit above 6V when these are very fresh. So anything about 1.5 : 1 will be good & safe, because you shouldn't extend the uC operating voltage, 3.3V.

I did a small quick & dirty sched, trying to attatch the picture... Does this work? [Image: QnD%20bat%20measurement.jpg]
OK, works. I didn't test this, but it should work with any small NPN transistor. Simply let the pin go down, maybe add a 100k pulldown resistor, and a short time before measuring the battery voltage, set it to high.

Forum Jump:

Users browsing this thread: 1 Guest(s)