Go Down

Topic: Geocache only open when sun is up (Read 1 time) previous topic - next topic

#15
Jan 23, 2013, 09:28 am Last Edit: Jan 23, 2013, 09:34 am by Codemazter Reason: 1
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/
-"Never laugh at live dragons".

J.R.R Tolkien

#16
Jan 23, 2013, 10:56 am Last Edit: Jan 23, 2013, 11:18 am by Codemazter Reason: 1
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
-"Never laugh at live dragons".

J.R.R Tolkien

Shpaget

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.

Go Up