Problem with LCD and Motor

liudr:
Help me here, is this what you want to do?

Turn on a relay that powers a solenoid? The diode needs to be at the relay coil side. The solenoid? separate the 12V supply ground from arduino's. They don't have to and should not share grounds.

I only see the box (you held it in your hand in the other picture). Is the relay inside the box or is it outside your picture?

Yes, there is also a diode on the relay coil side. Attached are the schematics of the customized 8-unit relay board and a photo of the relay PCB. I am using the Arduino to control the two input pins of each relay (a matrix configuration), so I can control 256 relays with one Arduino. The box in my hand is the solenoid. The relay is shown in this attachment.

Regarding the ground, Arduino is powered by its own 12V power supply, which is separate from the 12V power supply for the solenoid. The relay is 5V and is powered from Arduino. Thanks.

Protel Schematic.pdf (23.8 KB)