Should i ground the coils back to the arduino? (where im grounding the registers). I had my laptop bruttaly turn off after one conection so getting woried its a grounding issue and im about to burn everything.
So please reply if you care for a non burned berlin
The ground (negative) for each part of the circuit must be connected, so the ground for the Arduino connects to the ground of the 595s which also connects to the source connection of the FETs which connects - of course - to the negative of the power supply which feeds the electromagnets.
Why would you PWM electromagnets? Making some "levitation" gadgets?
actually the reply was not confusing at all. So i should just ground everything to the arduino.
Had some doubts after reading about star ground configuration when using high current loads.
Im using about 10 amperes.
If you are afraid of burning down, it's a must to use potential isolation.
A very convenient way you might find with SSRs (Solid State Relays). Most of them have built-in optocouplers but mostly switch only AC using triacs. Using triacs with DC would be very complicated - possibly you switch once on and (if power lasts) never off.
So you better use optocouplers. I guess you can get such things (assume you are German) from Reichelt (ILD 74: Optokoppler =MCT6 =CNY 74-2 bei reichelt elektronik). There are two independent couplers in each case. This would be the best way do get a galvanic isolation between your low power electronics and the power part. Of course you need a separate power supply for the coils (and don't forget the diodes in parallel to them).
didnt know optocoupler were better at isolating from mosfets.
I am actually running out of time at the current phase in my project to switch from mosfets
You need to keep high current supply/ground wiring away from the delicate stuff.
So the path from supply to electrmagnets, MOSFET drain, MOSFET source back to
the ground of the supply is the high current path.
Connect the logic stuff only to the MOSFET source and gate, at the MOSFET(s) so that
no high current path is shared with the sensitive logic side of things. This is a star ground
but the important point is the centre of the star is on the source lead of the MOSFET(s).
Another way to think about this is the MOSFET (or other switching device) has two
"ports", a control port with low current and drive by the logic is made from the
gate and source. The output port is the source and drain connections, carrying
the load current. These ports happen to intersect at a single node, the source pin,
but other than that keep them apart.
Avoid big loops, keep all the high current wiring as twisted pair where possible so that
outward and return current's cancel out from an interference perspective.
Since you have two supplies, 5V for the logic and 12V for your coils, its possible their
grounds are already connected via the mains earth, which would prevent a star ground
being possible - a ground loop is forced - this may lead to issues and if so the
optocoupler is the way to go if neither of the supplies can be made floating (safely).
hi, thanks a lot for the intuitive answer.
I now clearly understand im confused
I upload a simplified version of my circuit incase someone has a mi nute
So the pulldown resistor should ground to arduino?
mosfet source just goes then to the negative of my power supply.
But in the end it all leads to the power socket so it might not matter anyway ?
???
In the present case it will be perfectly adequate just to jumper the two negative rails on the breadboard together. Returning multiple grounds to the Arduino is just what you do not want to do and you use only the nearest ground on the Arduino.
As MarkT has explained, the common ground point should be the MOSFET source pin and given that the lead between the breadboard negative rail and the actual source pin is very short and reasonably stout, that will work well on the breadboard.
On a PCB, you would have a large ground "land" adjacent to that source pin where all other ground points would return.