My first project. Please grade / critical feedback.  PIR/Nightlight - Page 1
Forum section: electronics / beginners

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 01, 2013, 10:57:12 pm
content: My first real circuit (real for me)! I can't take all the credit, as I cobbled it together from several different sources, and played with the values until I got everything to play *nice* with each other. But, would probably not win a Energy Star rating.Please, if you have the time, take a look at it and be as critical as possible. *good way to learn*Theory of Operation:When the photo-transistor's voltage goes low (at night), it allows current to flow to the PIR (motion detector) and to the 555 Timer. Motion triggers the 555 and causes the LED to come on for 30 seconds.jpg from Eagle (free version).

author: ttp
author_rank: Regular Contributor
timestamp: December 02, 2013, 12:28:20 am
content: One problem is that you are supplying the current to power for 555 and associated elements via R7 (5k) resistor - I'm afraid there won't be enough current for this part of cct to work. You'd be better off supplying current using pnp transistor controlled by photo-transistor.

author: c4757p
author_rank: Super Contributor
timestamp: December 02, 2013, 12:35:42 am
content: That or only switch the reset signal, not the power...

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 12:46:56 am
content: Ah! Thanks!

author: c4757p
author_rank: Super Contributor
timestamp: December 02, 2013, 01:01:52 am
content: Also, if you don't need such a wide voltage range, the circuit should work fine on an unregulated power supply. I'd just recommend increasing some of the resistors so it doesn't burn too much power at higher voltages. NE555 is good to 16V, 18V absolute max.

author: IanB
author_rank: Super Contributor
timestamp: December 02, 2013, 01:21:57 am
content: Quote from: JohnnyGringo on December 01, 2013, 10:57:12 pmI'm having trouble following.When T2 turns off (in the dark), T3 will turn off. When T3 turns off the base of T4 will be pulled high, turning it on. Which will drive the dark detected signal level low. Do you have the logic inverted?

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:05:01 am
content: Quote from: IanB on December 02, 2013, 01:21:57 amQuite possibly, my assumption was that Dark_Detected would also go high when T4 was high.My original bread-boarded (working) design had the PIR, 555 and photo-transistor all powered. Movement detected by the PIR caused the timer to fire and if it was dark, send T3 low to light the LED (or activate a relay) .Which seem inefficient, as the PIR and timer weren't needed unless it was dark. So I rearranged it to where the photo-transistor was acting as a master switch, to only enable the PIR and 555 after dark.Here's my original bread-boarded schematic. I'll plug in a inverter and mess with that 5K resistor to see if I can get it to work.Thanks everyone, I'll post results tomorrow. I probably won't sleep a wink with this problem frying my brain.

author: IanB
author_rank: Super Contributor
timestamp: December 02, 2013, 04:46:10 am
content: Quote from: JohnnyGringo on December 02, 2013, 03:05:01 amNo need to make assumptions. You are designing the circuit, you should make it do what you want it to do.Now T4 is a transistor. Transistors do not go "high" or "low", they switch "on" or "off". If T4 is switched on it is like closed switch; it connects Dark_Detected to Gnd. Is that what you want to happen?

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 02:59:41 pm
content: Quote from: IanB on December 02, 2013, 04:46:10 amEureka! Thanks. My "coding abstractions" keep getting in the way. Now, when T4 is on, it enables current flow through the PIR Motion Detector and the 555 timer. I've included a simplified schematic (abstracted the voltage regulator to "5V").

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:10:50 pm
content: Quote from: c4757p on December 02, 2013, 12:35:42 amThanks! I incorporated that. Power now only comes on after dark. And the reset is triggered only after motion is detected.

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:11:45 pm
content: Quote from: ttp on December 02, 2013, 12:28:20 amThat's exactly what I did! (I think). Thanks !!!

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:13:42 pm
content: Quote from: c4757p on December 02, 2013, 01:01:52 amHmm... OK. I'll remove the voltage regulator and re-size the resistors... now, where did I put that Ohm's Law calculator?

author: cosmos
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:27:21 pm
content: Use the RES input of the 555 as an on/off control perhaps?The phototransistor have no problem driving it directly (put 100k or so pull-up on RES and the phototransistor to GND).Edit (reset pin name)

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 04:27:10 pm
content: Quote from: cosmos on December 02, 2013, 03:27:21 pmDo you mean like this? I am having a hard time wrapping my head around how this would work.(Breadboard V1.1 works!!Thanks everyone for their inputs! This was not a homework assignment, except assigned by me in my self-education wanderings through life, in an effort to cure a little ignorance in this world, or least in myself.)

author: cosmos
author_rank: Regular Contributor
timestamp: December 02, 2013, 05:13:12 pm
content: Maybe I missed something with how you want the motion detected signal to work so I am not claiming this is a working solution.Here is what I was thinking...remove T3 and T4 and R5move GND symbol so 555 pin 1 and everyting connected to it has GND.move T2 over to the other side of the 555 near the RES signal (arrow side to GND, non arrow side to RES).Now... as long as there is light T2 conducts current and RES is low, and therefore the 555 is in reset so nothing happens ...light should be off in this state.

author: JohnnyGringo
author_rank: Regular Contributor
timestamp: December 02, 2013, 05:50:50 pm
content: My requirements have evolved during this project. My current design (hopefully) should not supply current to the PIR and 555 timer, until they potentially will need to be used, only after dark. No sense in wasting current on two-thirds of the board if they're only needed half the time.I couldn't have the PIR supply the 555, as it's output is only energized for 2s, and I wanted the LED (relay) to be energized for around 30s.Or am I missing your point. (high probability)EDIT: One of the reasons for the Darlington Pair, was to able to use this circuit indoors.Quotewww.evilmadscientist.com/2008/a-dark-detecting-circuit-for-your-jack-o-lantern/