Pages: 1 [2]   Go Down
Author Topic: Geocache only open when sun is up  (Read 845 times)
0 Members and 1 Guest are viewing this topic.
Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe im over complication things??
if I use a attiny 85 with a ligth dependent resistor and a motor control for the servo, The battery will probably last long enough without the charging?

Then I dont need to buy the solarpanel or the charging controller.....

http://hackaday.com/2011/09/25/attiny-hacks-attiny4585-servo-library/
« Last Edit: January 23, 2013, 03:34:10 am by Codemazter » Logged

-"Never laugh at live dragons".

J.R.R Tolkien

Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The start of the code:
starting with an explanation of how I want it to work....

Quote
//mission is to use the servo as a lock on a box.
//the servo should only be able to open the lock when the LDR AND a pusbutton is active.
// when sun is shining + a person pushes the button.
// when the lid is closed a micro swith should trigger the signal to reset the servo to start position

//permission to activate servo :
//Digital input from door-microswitch (closed) HIGH
//LDR should be letting approx 4?volts passed on analog input
//digital input from pushbutton HIGH

// when servo opens initiate lock 10 minutes delay

//Permission to reset servo :
//Pushbuton released
// microswitch closed

Is this going to be realistic?
I will then need 2 digital and 1 analog inputs, and one ? output for the servo.

I also see that this topic has some code that is usable, just needs a bit of tweeking.
http://arduino.cc/forum/index.php/topic,144261.0.html
« Last Edit: January 23, 2013, 05:18:52 am by Codemazter » Logged

-"Never laugh at live dragons".

J.R.R Tolkien

Croatia
Offline Offline
Sr. Member
****
Karma: 11
Posts: 432
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need one PMW pin for the servo and one analog input pin for the LDR.
Push button and microswitch will have to fight for the other two pins. (Or you could put them both on the remaining analog in pin, but hooked up in parallel each with a different resistor so that you can tell if the button is pushed, the microswitch is toggled, or both are messed with). That would leave you with one more PMW pin for something extra.

Fo servo control take a look at:
http://www.cunningturtle.com/attiny4585-servo-library/

As for power consumption, I have no idea.
Logged

Pages: 1 [2]   Go Up
Jump to: