The switch to the ATTiny is an input and the ATTiny to the relay is an ouput.
My goal is to activate the 5v relay for 50ms when the switch is on.
I've got the following circuit:
If I use an arduino as power suply (5v after the lm7805) everything work fine.
When I try to power my circuit with a 12v battery it does't work.
Using the 12v battery:
-When I disconect the wire fron the ATTiny to the relay and power the relay straigh from the LM7805 i read 1.6v at the relay (no capacitor)
I tried with a lot of different capacitors but was unlucky to make it work (even with 0.33uf Vin & 0.1uF Vout)
My best result is using a 470uF in Vout (C2) and no C1, the relay clic when power straight out of the LM but then voltage drop to 2.2V. When I use the ATTiny to power it, it just goes on & off for ever istead of clicking once.
Does anyone have an idea on how I could have a good and constant 5v output from the LM7805?
Else my last resort will be to use a usb socket to have a good 5v supply.
Is C2 connected across the LM7805 OUT and GND pins?
470uF is too big. 0.33uF on the input and maybe 10uF on the output should be OK
Is there a 0.1uF cap connected to the Tiny Vcc pin?
Are you sure the 12V is putting out 12V?
what is the current demanded by the relay, what is it's resistance, what is it's voltage rating(or, provide a link to what you have so we can understand), and can the ATTINY provide that current when it's output is set high?
how powerful is the pin of ATtiny85 ? show this relay.
forget it. take 12V relay and logic level MOSFET to control it. not forget current limiting resistor and flyback diode.
Either the LM7805 is bad, or you have a capacitor in backwards, or a bad connection somewhere.
If you are using a solderless breabboard try moving the components to a different location
True. Yes I think a new LM7805 is needed.
However, you should never connect a relay coil directly to a microcontroller pin especiaaly if it requires more current than the pin can supply