Author Topic: Chicken Door Opener / 4 AA cells direct to PIC?  (Read 17657 times)

0 Members and 1 Guest are viewing this topic.

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4102
  • Country: us
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #75 on: May 28, 2017, 07:33:34 am »
Quote
As it will be in timer pass-through mode most of the time
And if this is the case... instead of doing ADC readings throughout all this time, which each draw a little current, you could have PIC sleeping the entire time on lowest clock setting. Waiting for IOC.

The 2 trannies will have zero quiescent current until the open collector output is switched on. And only need very little draw while the signal is active. Just a trickle of the base of the small signal PNP. And a trickle thru the pulldown for the small signal NFET. And essentially nothing thru the drain of the NFET, if you turn off the pullup after wake. And still, this is simpler on the code end.  :-//

You could even put the emitter of the signal PNP to an output pin on the PIC, and turn the entire thing off after wake. :)
« Last Edit: May 28, 2017, 07:43:15 am by KL27x »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #76 on: May 28, 2017, 07:56:44 am »
The timer doesn't provide separate open and close pulses. instead its output is on ALL the time the door is to be closed for.  The ON time of the timer is therefore a significant contribution to the average quiescent current  Assuming its being used with a light sensor on the main unit so is only on from 4AM to 9AM to keep the chickens in in the morning till everyone's up and about, averaged over 24H, that's still 21% of its on-state current.

That's why I suggested testing if its possible to drive the PIC input off the timer emitter - the levels should be compatible on a TTL digital input pin, and the pull-down resistor can be large enough that the quiescent current is lower than running the watchdog to poll the pin.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4102
  • Country: us
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #77 on: May 28, 2017, 08:02:47 am »
Quote
21% of its on-state current.
K, I didn't think of it like that. I was thinking it was on only when the door was opening/closing, or whatnot. I see where you are coming from on that end, and I agree with the reasoning.  :-//

« Last Edit: May 28, 2017, 08:15:31 am by KL27x »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #78 on: May 28, 2017, 08:14:12 am »
Its worse if N.S. isn't using the photosensor.  Average hours of darkness over the year will be 12, and you'll want to extend that in the morning a bit so it could be as much as 60% of the on-state current.

The idea was to make the PIC CLC handle the pass-through.  The PIC stays asleep and you avoid the cost and complexity of the latching relay and its drivers. That means you dont have much power budget for the interface between the timer and the PIC.
« Last Edit: May 28, 2017, 08:17:19 am by Ian.M »
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4102
  • Country: us
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #79 on: May 28, 2017, 08:30:04 am »
Hmm, that CLC sounds too cool. I have to get my hands on these newer PIC. Yeah, sorry I just edited last post. I see where you are already 2 steps ahead of the whole relay idea. But yeah, as usual, I end up learning something in the end. :)
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #80 on: May 28, 2017, 08:50:53 am »
Yes, its fairly cool - each can do a lot of four input logic functions, including several typoes of flipflop, with invert/non invert options for all signals.  However now Microchip have Atmel's programmable logic designs, if we are lucky we may yet see an enhanced midrange core paired with a GAL equivalent RAM based logic fabric
 

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #81 on: May 28, 2017, 05:49:49 pm »
So... swapped the diode for another one I had lying around (not sure if it was shottky)... no significant change....

... anyway... changed the software to use AN5 and ADC... it does a conversion and then has 1.5s of conversion quiet time during which no conversions are done and then converts again.  Conversions only occur when in active mode.  The 1.5s polling interval is not an issue.

I've also changed the LED flashing as per suggestions.

Works nicely.



That was meant to be an afternoon project... it's taken me weeks!  Thanks for your help.  I will add Mk2 to the projects list... really looking forward to try the CLC approach.

(For the record.... the PIC is definitely out of spec here... the diode drop doesn't get you down to 5.5V so therefore a regulator should really be used, this could be added to this design to give Mk 1.5.  Ultimately the LDO and CLC design makes much more sense as the latching relay and ancillary components add significant cost/complexity. Finally in retrospect the actual functional requirement seems a bit off... it would make much more sense to just buy/build a new timer with the override functionality, the LCD glass and UI on the existing timer is really nice though, direct LCD drive is something PICs do well)
« Last Edit: May 29, 2017, 09:15:13 am by NivagSwerdna »
 

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Chicken Door Opener / 4 AA cells direct to PIC?
« Reply #82 on: May 28, 2017, 06:18:15 pm »
Its worse if N.S. isn't using the photosensor.  Average hours of darkness over the year will be 12, and you'll want to extend that in the morning a bit so it could be as much as 60% of the on-state current.
I don't use a photo-sensor.  Although the principal is roughly day light hours in practice you want it a bit after dawn and then around dusk.  During spring you want to delay opening to avoid foxes that are up and about a bit latter than dawn during cub season.
« Last Edit: May 29, 2017, 10:43:24 pm by NivagSwerdna »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf