PDA

View Full Version : day/night sensor



grounded
- 4th October 2006, 21:34
Whats the option for a day/night sensor to be used as a input for a 16f630.
using PBP
this is for a joint hobby project with a out of state friend.
I'm programming the chip he's building the board
I have used the "pot" command with a LDR and cap which has most of the calibration in the program. I added a cal. pot but it has little effect. and I would hate have to mail the chip back and forth to get the cal. were we need it.
I've used a LDR, pot, voltage divider& transistor set up but this project is battery operated and I think it could be hard on battery life.
just wondering if there is a better option.
as always thanks

dhouston
- 4th October 2006, 21:56
Look at the Panasonic PNA4603H.

sayzer
- 5th October 2006, 03:28
Hi grounded,

Why don't you post your schematic here?


--------------

grounded
- 5th October 2006, 21:35
dhouston I did a search for panisonic could not find much.
sayzer here is a schematic
Sorry I'm a not a pro on this just a hobbist.
I guess in a nut shell what I need is a simple,cheap light sensor that has a wide range on the cal. pot, and is easy on the battery.

dhouston
- 6th October 2006, 01:08
dhouston I did a search for panisonic could not find much.

What do you need besides the PNA4603H data sheet which the first few hundred Google responses point to?

http://industrial.panasonic.com/www-data/pdf2/ATB7000/ATB7000CE157.pdf#search=%22pna4603h%22

grounded
- 6th October 2006, 01:41
the smarts to understand them
sorry dhouston not trying to be a smart (*&(& . but I'm just a hobbist
I did look at the data sheet but that all greece to me. I'm not even shure what it or does
i need examples, people telling how they work ,why they work what they are.
schematics
sorry

sayzer
- 6th October 2006, 08:22
grounded,

Are you sure your LDR is 10K-33K ? did you measure it under complete dark and full light with an ohmmeter?

grounded
- 6th October 2006, 15:52
sayzer its was a 16-33k digi-key pvd-p8103-nd this was from a project that I did last year with a 12f629. the PBP manuel says to use a 5-50k &.1cap this had the greatest span and along with a 5k cal pot was still under the 50k as per the manuel. it worked but the pot had little effect. I just added this to the schematic I posted. which is the new project. this is the code I used with the 12f629.

Pot GPIO.4,100,DN
IF DN<140 Then
GoTo CHECKPIR
Else
GoTo MOVIE
EndIF
but If I can get a a greater span from the pot this project can be used for multiple things
thanks

sayzer
- 6th October 2006, 18:14
I can say that the POT command with LDR type of fast changing resistive devices is not quite precise.

Do you have any chance of using a PIC with ADC ?

Or have you tried your circuit with a PIC with ADC?


Also, POT command with 5K gives the best result as what I have experienced so far. Any value above 5K has not been working well for me (only with POT command though - even 10K was not good).

Also, why are you using a scale of 100? What was the reason?

dhouston
- 6th October 2006, 20:41
The PNA4603H (available from Digikey) outputs a voltage that is proportional to the light level. Its sensitivity and wavelength are similar to that of the human eye.

Use it on an ADC pin or use it on one input to the comparator and use a potentiometer on the other input to the comparator.

If you supply it with +5V using a PIC pin and use ADC, you can turn it off between readings to minimize battery drain.

grounded
- 6th October 2006, 21:53
thank you both
In my short time "playing" with the PIC I have not tried any of the adc stuff
the 16f676 is the sister chip to the 630 about the same but with adc
is this the way I need to go?

the 100 scale well I worked for 6 hr. before I got some thing that would work
(on the other project) started with 255 but did not have any luck ajusted both # and until 100 and it worked.