How to power a 5v circuit with batteries? And will my circuit always draw power? Answered
I'm building a fridge door sensor that will beep when the door is opened. The one that is on my fridge right now is very inaccurate and so I want to improve it.
So what I've done is make a sensor that is mounted onto the door to makes a contact when its closed. When it's opened, I'm using an ATtiny 25 to wait 30 seconds and then make a pulsating buzzing noise through a buzzer.
The ATtiny operates in a range of 2.7 - 5.5v and I want to power it with batteries.
I'm new to electronics so I don't know much about powering stuff with batteries. My questions are:
How do I get that power that I need?
Will the batteries get drained quickly because of the circuit design? (power always going through the contacts)
Does anyone know exactly how to hook up a battery to an ATtiny? I think that the positive should go through my switches and then into vcc, but I'm not sure where to put the negative.
Thank you so much!