KEypadand lcd not responding when 24V supply switched on

I am using 24 power supply to power the proximity switches and the output of the proximity switches, switches the relay 24V coil. then I have supplied the arduino 5v to the normal close contact of the relay to the inputs of arduino. I have also an lcd and keypad and a motor drive, driving the motor. when i test the keypad and screen its working fine but as soon as i switch on the 24V power supply the screen and keypad wont display pressed keys

I have tried to draw a rough sketch of how everything is connected but a drive and a motor are not shown.