Iād actually seperate the 12V side of the curcuit from the Photon via an opto isolator.
Motors tend to produce a lot of noise which will still carry back into the Photon via GND.
But if you want to stay connected, you should at least add some caps and possibly a free-wheeling/flyback diode - thatād be advisable in any case thoā.
Just for nit-picking:
And please donāt use the red rails for GND - it just gives me the shivers when I see a short between red and GND
You could put the +12 on the red top rail and that respective GND on the top blue with an optional bridge (or even a 12V->5V step-down converter) down to the bottom blue (GND) and the 5V rail at bottom red and connect Vin of the Photon to bottom red and GND of the Photon to bottom blue.
While you pull all the 12V connections up to the higher level rails.
Just for further nit-pickingā¦ Many breadboard have a ābreakā in the rails in the middle. In this case your 12V in wouldnāt be connected to the other components.
Just sayinā since this has messed me up more often than Iād like to admitā¦
Usually the ones with 8 pin ones contain two optocouplers.
The 6 pin ones do have an additional base pin to āwire switchā in addition to the opto switching, but youāll probably only need the 4 pin one.
The FET would go where you got the bipolar transistor in that schematic
Even though the schematic looks somewhat right, the breadboard sketch looks off to me. I followed the guide lines generated in Fritzing when I did the schematic sketch to place the jumpers on the BB.
And Iām still not sure about the red and blue rails.
This schematic is the best so far, IMHO. I canāt speak to the breadboard layout, since I donāt use fritzing, and am not a huge fan of breadboards in general.
So, the components Iāll need:
1 Diode 1N4148
1 Capacitor 10uF/50V
2 Resistor 120ohm
2 Resistor 100ohm (The shop Iām thinking of buying from does not have 220ohm)
1 FOD817B DIP-4 Optocoupler
1 N-Channel MOSFET 60V 30A
DC Barrel jack
12V axial fan
Wires
Breadboard
My last question is how I best can cram all this into a casing.
Im thinking something in the range of 120 to 150mm x 100 to 120mm.
Why casing? This is going to be a magnetic stir plate when itās ready.
I feel that a bread board will have a hard time fitting in a casing like that.
The breadboards that come with the Particle kits are 80x55mm, and there are even smaller ones available.
You also might want to get medium (insertion) force breadboards if you intend to move components from time to time.
If they have no 220Ohm resistors you should also be OK with 330Ohm. https://docs.particle.io/datasheets/kits/#photon-kit
@TripleJr, you can absolutely use that buck regulator (in fact, I have)! I suggest you power the Photon via the Vin pin instead of the USB connector. Make sure you add a 0.1uF decoupling capacitor between the Vin pin and GND.
So, I tried bypassing the MOSFET directly to the opto coupler. That somewhat failed too.
I could get the fan to spin really slowly if I helped it start. When I put the fan directly to the power source it worked as expected though.
My DC adapter is rated at 300mA at 12V and the fan at 140mA.
The only problem is that the fan makes a beeping sound in lower RPMs, but thatās not something that concerns me much. Next step or an upgrade would be swapping it for some kind of brushless motor.