2
\$\begingroup\$

I have a circuit which uses an ATtiny85 output to a transistor (S9013), which will trigger a relay that controls a motor.

The reason for the transistor to relay is because I do not have a transistor that can take the current of the motor, so I am isolating it with a relay.

While I can purchase all these, it will take time to ship.

Here is the circuit:

SCHEMATIC NOT UPDATED, I HAVE A DIODE GOING ACROSS THE MOTOR, AND A 100uF CAPACITOR GOING ACROSS THE VCC AND GND TO SMOOTH OUT THE VOLTAGE (have also tried 100nF).

Everything works if I don't connect the motor OR if I isolate the motor with its own power source.

The issue now is that when the motor is switched on, there is a massive voltage drop and the ATtiny85 will reset. Here is a waveform of the motor trying to turn on three times:

Is there a way to prevent this drop or at least reduce it to a point where the ATtiny85 won't reset? I'm thinking wire up a simple voltage regulator but not sure if the added complexity will introduce other issues. I also know I can go out and buy a motor or voltage regulators but let's avoid that option.

EDIT: so as per the answer, a diode (cathode at +ve, anode at VCC) was added between +ve and VCC, assuming that there is a capacitor connected in parallel with the ATtiny85 (+ve end at VCC, -ve end at GND). Theory is that the cap gets charged while the motor is off to VCC. When the motor turns on, it's going to drop that voltage down to below VCC and the diode is going to be reverse-biased and prevent any conflict from the supply to going into the ATtiny85. The capacitor can now freely discharge into the ATtiny85 without the supply affecting it (without the diode, supply will average capacitor down faster than if it would just discharge alone). For reference, the bulk capacitance value I used was 100uF.

\$\endgroup\$
2
\$\begingroup\$

Put a diode between the supply and the bulk capacitor for the MCU. Since the diode will be reverse biased when the motor causes the brownout very little current will flow through it, preventing the MCU from browning out (at least until the bulk cap gets too low).

\$\endgroup\$
  • \$\begingroup\$ Thanks for the tip. Can you clarify on connection points a bit more? Are we talking in series (VCC -> cathode -> anode -> capacitor -> GND) or parallel where diode's cathode is on +ve of cap? \$\endgroup\$ – PGT Feb 18 '15 at 6:52
  • \$\begingroup\$ Nevermind, just needed to think about the theory your words were implying instead of trying to get an image of what your words were directly telling me to do. \$\endgroup\$ – PGT Feb 18 '15 at 7:27
  • \$\begingroup\$ @PGT And could you now answer for me? :) After some thinking I'm still doubting between these two options. \$\endgroup\$ – eigenein Oct 26 '17 at 9:39
  • 1
    \$\begingroup\$ I eventually just added a dc-dc converter between the battery to the ATtiny85 so that even a drastic dip will be ok. This works because the ATtiny85 takes very little current so to boost from say 1.8v to the 5V-5.5V that the MCU needs will be fine. My battery couldn't handle the motor's starting voltage at all. Another option is to have multiple batteries in parallel so the current requirements are met and voltage will not drop. \$\endgroup\$ – PGT Oct 26 '17 at 21:57
1
\$\begingroup\$

I put a 100uF electrolytic cap between the output of my voltage regulator (which is the 5v input to my Nano) and ground. Solved the problem. No more re-setting when the motor starts.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.