Hi everyone,
I have a question regarding my project involving an ATTiny85 and a motor. I am trying to switch a motor on and off in various patterns. I have this part working with an LED (basically the Arduino Blink sketch), however when I switch to using a motor with a MOSFET transistor, the ATTiny begins to behave strangely, switching off / on randomly, the clock slows down etc.
When the issue occurs, I have been using 2 x AA batteries (3v). The issue resolves itself when I use a 3.7v 1000mA LiPo battery, however this does not suit my project and I would like to figure out the issue, because I am pretty sure the AA batteries should work?!
The ATTiny is rated at 3v / 3.6mA and the motor is also 3v and consumes around 300mA (stall current 680 mA). There is a diode across the motor wires.
Another thing to add: The MOSFET is in the circuit being switched by the ATTiny, however I split the same power supply to be used with both the ATTiny and the MOSFET together (please see my diagram attached). I would ideally like to use the same power supply and not have two separate supplies (my project requires limited space, and I cannot use 4x AA batteries) but I am unsure whether this is a reliable way of using a MOSFET, or if there are alternatives? Is an NPN transistor a better shout? (I am not aware of the differences between NPN transistor and MOSFET as they seem to operate very similarly...)
I assume this is a power consumption issue, and perhaps the motor causes a spike in current that upsets the ATTiny? Is there any way to resolve this or any advice on the design of my circuit?
I hope this is is all understandable. I am new to electronics at this level so any tips or lessons would be much appreciated
Thank you!
I have a question regarding my project involving an ATTiny85 and a motor. I am trying to switch a motor on and off in various patterns. I have this part working with an LED (basically the Arduino Blink sketch), however when I switch to using a motor with a MOSFET transistor, the ATTiny begins to behave strangely, switching off / on randomly, the clock slows down etc.
When the issue occurs, I have been using 2 x AA batteries (3v). The issue resolves itself when I use a 3.7v 1000mA LiPo battery, however this does not suit my project and I would like to figure out the issue, because I am pretty sure the AA batteries should work?!
The ATTiny is rated at 3v / 3.6mA and the motor is also 3v and consumes around 300mA (stall current 680 mA). There is a diode across the motor wires.
Another thing to add: The MOSFET is in the circuit being switched by the ATTiny, however I split the same power supply to be used with both the ATTiny and the MOSFET together (please see my diagram attached). I would ideally like to use the same power supply and not have two separate supplies (my project requires limited space, and I cannot use 4x AA batteries) but I am unsure whether this is a reliable way of using a MOSFET, or if there are alternatives? Is an NPN transistor a better shout? (I am not aware of the differences between NPN transistor and MOSFET as they seem to operate very similarly...)
I assume this is a power consumption issue, and perhaps the motor causes a spike in current that upsets the ATTiny? Is there any way to resolve this or any advice on the design of my circuit?
I hope this is is all understandable. I am new to electronics at this level so any tips or lessons would be much appreciated
Thank you!
Attachments
-
477.7 KB Views: 18