I doubt you will fry your u-controller. However, driving soleniods directly from digital electonics is usually not a good idea. I've seen too many systems driven like that that cause the digital portions to be "upset" by the transients produced by the coil switching. The free wheeling diode helps, but the very best way to do this is to use isolation and totally separate power supplies and grounds, along with the diodes to insure there is no interference between the solenoid and digital system.
You do realize that in your schematic, the opto-device is configured as an inverter, right? A 5-V signal from your u-controller will de-energize your soleniod. Also, look at the data sheet for the opto. You're operating the diode at the edge of the forward current transfer curve. Try to find some schematics that uses your part, or a similar one.