ATtiny-85 project

Hi to all. i am thinking for first time to use an ATiny85 ic for a future project (instead of using a pro mini).
My project would be the Attiny85 count for max mills time (49days as i know ) and then read in one pin input signal and if it is "True" then drive independent 2 small relays with 2 Gpio output pins and write the state in eeprom so if after have power down can read at boot the eeprom and set the state of the output pins (relays) to the previous condition (after the 49days countdown) .

pins i need = 1 for input signal, 1 for input signal to reset eeprom address , 2 pins for the relays

so can i use the Attiny85 for something like that? do i need to use an external oscillator?

You'll need a lot of patience for testing this but it should be possible depending on the degree of accuracy required. With the addition of a crystal (and 2 capacitors) a higher degree of accuracy can be achieved.

1 Like

i don't care if the time is not precise to the second or to hour... even more if i loose one day in counting (let say that wanted to stop at maximum time of 49days and stopping at 48 days )

if i can avoid Crystal would be better as in that option i have to loose 2 GPIO pins and will be left with just 3 only and i need 4 in total.

except if it is possible to the "setup loop" read on of the GPIO pins for the oscillator if it is true or false and reset my eeprom (but i think that cant be happen from the moment i have setup ATtiny Fuse bits)

The internal EEPROM does not occupy any GPIO pins.
Are the relays (or relay modules?) independently operated?
You can, in absolute desperation, use the reset pin as a GPIO pin. However, to undo it to reprogram the ATtiny85, you need first a high voltage programmer.

I have some difficulty imagining the purpose of all this. What is the application of this project ?

No , my mistake... i know that the internal eeprom doesnt need any GPIO pins...... i want to use one GPIO pin as input so when the Attiny boot after power down , in the setup loop will read if the Eeprom address is set to 1 and then go to lock() function.
if it reads 0 to the address then will continue to the normal loop to countdown until the end of the 49 days period.
The GPIO input pin for eeprom would be in the case that 49 period has pass if reads the state(LOW or High depending my program ) to reset the address of the eeprom to 0 and start again the countdown .

my application would be to lock a box with solenoid lock if a period of 49 days pass without visit the room and cut off the power supply for few seconds ( make the program restart and so restart counting)
if now the period of 49 days pass without visit the room then the selenoid will lock the box and write to the eeprom so even if you cut off the power the program will read the eeprom that the period passed and will go to lock function in my program (while loop that will freeze program to that state)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.