Yes, it's safe because the voltage is low* and the 24VDC power supply provides isolation from the AC power line. I'd recommend getting a power supply capable or slightly more current instead of running one at it's maximum rating.
But, if the Arduino isn't isolated from the 24V a blown/shorted MOSFET could send 24V into the Arduino and fry it. That shouldn't happen (if you design your driver correctly) but if you are paranoid you can drive the MOSFET with an opto-isolato.
Or yes, you an use a relay (which does isolate the 24V from your Arduino).
Regular electro-mechanical relays need a driver because the Arduino can't put-out enough current for a relay coil. Or, you can get relay boards with the driver built-in.
There are solid state relays that can be directly driven from the Arduino, but make sure to get one designed to switch DC. AC solid state relays usually latch-on with DC and they won't turn off (until power is removed).
The regulatory agencies usually set a limit of 50V for anything that a human might touch. Anything less than that is considered safe.
I had a similar mist generator (maybe slightly more powerful) and I had a handy float for it that kept it the correct distance under the water surface. (I don't remember where I bought it.)
It worked pretty well for a "low lying" fog effect. I tried it in the bath tub and it pretty-much filled-up the tub with mist and you couldn't see the water, and the mist would float-out and spill-over the top. If you put it in a terrarium you probably couldn't see anything!
But the mist dissipated quickly as the mist spilled-over the top. I was trying to make a fog machine (with a bucket and a fan) but it didn't work. I think the water droplets were too big/heavy and the mist would quickly disappear (fall to the floor?) when I tried to blow it around.
An n-channel logic-level MOSFET of 40V rating or so, with on-resistance < 0.2 ohms would be fine.
This would be a low-side switch, note, source to ground, drain to load.
Consider getting a slightly larger 24V power supply. Add a inexpensive buck converter and adjusting it for about 8V and connect to the Vin of the Arduino (I do this for the extra filtering). Then a avalanche Rated MOSFET (check UIS rating) will drive the solenoid, no extra diodes needed as it is in the MOSFET. You can add a fuse or poly-fuse in the output if you like.
DVDdoug:
I had a similar mist generator (maybe slightly more powerful) and I had a handy float for it that kept it the correct distance under the water surface. (I don't remember where I bought it.)
It worked pretty well for a "low lying" fog effect. I tried it in the bath tub and it pretty-much filled-up the tub with mist and you couldn't see the water, and the mist would float-out and spill-over the top. If you put it in a terrarium you probably couldn't see anything!
But the mist dissipated quickly as the mist spilled-over the top. I was trying to make a fog machine (with a bucket and a fan) but it didn't work. I think the water droplets were too big/heavy and the mist would quickly disappear (fall to the floor?) when I tried to blow it around.
Thanks for sharing your application of the mister. I'm actually trying to grown plants with fog so I'm going to see if the fog reaches the roots at the top of the bucket (not sure what the height will be yet). So I might need a small fan just to slowly move the mist upwards... We'll see.
DVDdoug:
I'd recommend getting a power supply capable or slightly more current instead of running one at it's maximum rating.
What is the problem in using the AC adapter with the specified current rating? Just in case the AC adapter does not perform well over time and the device will make it heat because it draws more current from it?