Power issue using LM7805 (Resolved)

Hi everyone,

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:
image

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.

Thank you for your help

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?

Is C2 connected across the LM7805 OUT and GND pins?
-Yes

470uF is too big. 0.33uF on the input and maybe 10uF on the output should be OK
-I will try this right now

Is there a 0.1uF cap connected to the Tiny Vcc pin?
-No I didn't

Are you sure the 12V is putting out 12V?
Yes my battery is actualy 13v

the relay needs about 70mA, the ATTiny can because it works fine when power without the LM

If you just have the battery, the LM7805 and the two capacitors, do you get 5V output?

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.

I do have 4.98V but when i conect the Vout of the lm straight to the relay i have 2.6V and no click
using C1= 0.33uF C2=10uF

one more time. Link for relay data, please. Something's wrong, if a 7805 won't power it sans ATTINY.

The Attiny works perfectly when powered by the arduino, I beleive my issue is with my wiring of the LM7805

Either the LM7805 is bad or the relay is shorted.
If you have a 220 ohm resistor, connect it to the output of the LM7805 and see if the voltage drops.

i don't want interfere your believe. bye.

If i put a 220ohm at Vout ang ground it I read 4v at the resistor

if the realy is shorted could it still work fine with the arduino 5V suply?

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

Are you using just a relay or a 5V relay module?

Thank you for your help, I will buy another LM and try it
The power shouldn't colapse like that under load

I'm just using a relay

From the tiny85 datasheet, page 161, max output pin current = 40mA:
https://ww1.microchip.com/downloads/en/devicedoc/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
max IO

1 Like

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

For the relay:

I would put at least 6mA into the transistor base, 680Ω for R1.