Problem with LCD and Motor

liudr:
If you get problem when you disengage the solenoid, then it is the diode's problem or how it is connected. If you have it correctly connected then the diode will bypass the back EMF. Let us see the connection diagram and the actual photo.

Attached is a photo of the relay and solenoid. I was trying out different length of the wires, and it seems that a long wire between NO of the relay to the cathode of the diode yields the best result (even though it still does not completely suppress the back EMF). The power supply is a dedicated 12V with 10A rating, and has no connection to the Arduino UNO. The 12V solenoid draws about 1A when active. Please let me know if you have any suggestion or need more information. Thanks.