Power problems --> Relay --> LCD

Hi to all.

I'v started to schematics for PCB board that will be plugged onto arduino mega board.
All pins are set on bottom double connector to simplify pcb design and all power( for arduino board / LCD, coin machine / relay/ keypad etc.) will come from this board. Main external power source will be 12V transformer ( cca 40W, standard ).

When i was testing the whole project i run on one possible problem.
If i power arduino board ( for now, still over USB ) system starts OK and welcome message is displayed correctly, but when i plug power for relay ( which is powered from external 12VDC power adapter),LCD start to output random characters and signs. This will not happen if i start relay power source, first.

I dont know if this will happen when the PCB is done, but it may...

In end effect, i can start reley first and then arduino, but i dont know why is this happening.
Relay is connected over BC547 and diode so there shouldn't be any problem.


2.)
What is the optimal external power source for sainsmart mega board ?
Can i power it with 9V or maybe 12V ?. On they web site is mentioned that there is a voltage range from 7-12V so 9V should be optimal solution ?. Any practical suggestions ?

Seems that's a fairly common problem with LCDs and relays, lots of times it takes more decoupling capacitors and such, can you post a wiring diagram?

Seems that's a fairly common problem with LCDs and relays, lots of times it takes more decoupling capacitors and such, can you post a wiring diagram?

** Unfortunately i can not, but there is not much to say regarding HW.
I put 1K resistor on BC547 and this line goes directly to arduino, emitter line is grounded on arduino board.

Like:

http://duino4projects.com/wp-content/uploads/2013/04/Connecting-a-12V-relay-to-Arduino-circuit.jpg

LCD power lines come directly from arduino...

A.

Try to remember to wrap your links in tags... some people have smartphones and lack of takes is unfriendly.

While no one will argue that the drawing you provided is not correct, saying that you cannot post a diagram makes me raise an eyebrow. The drawing you provide is bog standard for using a relay with an arduino and there is no improvement needed there.

When working with relays, "it takes more decoupling capacitors", as was mentioned.

This was an invitation for you to research "decoupling capacitors" to understand why you might need them and where they would be placed in your circuit.

A common reference to decoupling is here: Decoupling