Author Topic: My first project. Please grade / critical feedback. PIR/Nightlight  (Read 5607 times)

0 Members and 1 Guest are viewing this topic.

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
  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).
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline ttp

  • Regular Contributor
  • *
  • Posts: 151
  • Country: au
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #1 on: December 02, 2013, 12:28:20 am »
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.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #2 on: December 02, 2013, 12:35:42 am »
That or only switch the reset signal, not the power...
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #3 on: December 02, 2013, 12:46:56 am »
Ah! Thanks! 
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #4 on: December 02, 2013, 01:01:52 am »
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.
No longer active here - try the IRC channel if you just can't be without me :)
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #5 on: December 02, 2013, 01:21:57 am »
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.

I'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?
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #6 on: December 02, 2013, 03:05:01 am »
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.

I'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?
Quite 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.  |O
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #7 on: December 02, 2013, 04:46:10 am »
Quite possibly, my assumption was that Dark_Detected would also go high when T4 was high.

No 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?
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #8 on: December 02, 2013, 02:59:41 pm »
Quite possibly, my assumption was that Dark_Detected would also go high when T4 was high.

No 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?
Eureka!  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").
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #9 on: December 02, 2013, 03:10:50 pm »
That or only switch the reset signal, not the power...
Thanks! I incorporated that.  Power now only comes on after dark. And the reset is triggered only after motion is detected.
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #10 on: December 02, 2013, 03:11:45 pm »
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.
That's exactly what I did! (I think).  Thanks !!!
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #11 on: December 02, 2013, 03:13:42 pm »
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.
Hmm... OK.  I'll remove the voltage regulator and re-size the resistors... now, where did I put that Ohm's Law calculator?
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline cosmos

  • Regular Contributor
  • *
  • Posts: 110
  • Country: 00
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #12 on: December 02, 2013, 03:27:21 pm »
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)
 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #13 on: December 02, 2013, 04:27:10 pm »
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)
Do you mean like this?  I am having a hard time wrapping my head around how this would work.

(Breadboard V1.1 works!!  :phew: 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.)
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 

Offline cosmos

  • Regular Contributor
  • *
  • Posts: 110
  • Country: 00
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #14 on: December 02, 2013, 05:13:12 pm »
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 R5
move 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.

 

Offline JohnnyGringoTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: vg
Re: My first project. Please grade / critical feedback. PIR/Nightlight
« Reply #15 on: December 02, 2013, 05:50:50 pm »
  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.
Quote
The typical "saturation" current of this type of phototransistor is only of order 1 mA, which means that under conditions much less bright than sunlight, we get much less than 1 mA of output current. To increase the sensitivity of our pumpkin enough to detect indirect daylight lighting-- not just direct sunlight-- we use the phototransistor as one element of a Darlington pair.

 When daylight is detected, the phototransistor turns on (just a little bit), which turns on the first 2N3904, which pulls the base of the second 2N3904 to ground, and preventing the LEDs from turning on.
www.evilmadscientist.com/2008/a-dark-detecting-circuit-for-your-jack-o-lantern/
« Last Edit: December 02, 2013, 06:08:06 pm by JohnnyGringo »
"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf