I am trying to figure the safest way to have the arduino activate a 12v solenoid. I've done a lot of reading up before posting, just had a few questions.
1) Two separate power supplies are needed, a 12v one for the solenoid, and the arduino one. I don't want to use the 12v for the arduino because the vreg will get very hot.
2) I will need to tie the grounds together. I heard this can lead to issues like backfeeding through the mcu pins and possibly damaging it. I tested with my multimeter and the potential across the two - for both supplies was around 48v AC. Apparently this kind of measurement is normal from what I read, it's just a matter of bringing grounds to the same potential.
3) It seems a mosfet is the best way of switching the 12v side. I don't know if this would protect the mcu pins well though. Using a relay instead of a mosfet still gives problems with current usage of the coil along with needing another diode, (The other one being across the solenoid) so it makes sense to go with a mosfet instead.
4) Optoisolating the 5v and 12v sides might be a solution, but is it necessary? Is there a decent optoislation chip anywhere? There was one on sparkfun but it was limited to 50ma, not sure if that would be enough for switching the mosfet? I saw this solution here:
http://playground.arduino.cc/Learning/SolenoidTutorial