After some (read; MANY of pages and videos) research, I’ve learned most of the basics.
In the attachment, is the schematic I have managed to make.
How it should work:
A 12v battery supply is used for the motor, and the ATtiny85 is powered via a LM7805 5v regulator.
The MOSFET for switching the motor is IRF1324IBF, but it needs minimum 10v(not 5v logic) for the gate. The ATtiny85 controls the MOSFET via a transistor.
The motor is NOT going to be PMW controlled for now.
To protect the regulator and MOSFET from the EMF spike the motor creates when “turned off”, a (schottky) flyback diode is set in parallel, reversed-biased.
The reason for using an ATtiny85, is so I can detect the Voltage-drop when the motor start, and thus counting the amounts the motor has started. A simple voltage-divider is used to get the voltage from 12v to a readable ~5v signal. The accuracy is irrelevant, because only the sudden drop of voltage is important for me to detect.
Why not using the switch for controlling the MOSFET to count? I hear you say! Well, in most cases the switch(and my MOSFET here) will not turn the motor ON and OFF, but a completely different MOSFET will do the job for me. My MOSFET will mostly be used only to stop the motor after X amounts of startups.
So, my questions:
Does this look like somthing that wont blow up in a moment? my main concern is the spike from a collapsing magnetic field, and the MOSFET operation.
How to find a appropriate transistor for driving the MOSFET. the MOSFET datasheet said: Gate-to-Source Forward Leakage = 200nA, Is the current draw for the gate realy that low?
Current-draw is not realy that important now, as the operating-time only will be 2-4 hours at a time, and it will be close to nothing compared to the motor current-draw.
As I think have all the components to make a ArduinoUNO “prototype”, but only have a limited amount of the diode and MOSFETs, and don’t want to destroy my UNO, I hope to not blow things up yet
And as this was my first schematic in over 2 years (and then, only super-basic ohms-law circuits), don’t hesitate to criticize bad habits.