powering solenoid using arduino

Hi people I’m a student studying engineering and I’m currently doing a project using Arduino UNO and a solenoid (12VDC , 1A).

However because i’m fairly new to arduino I do not know how to wire both of them together… I need some guidance from all the seniors here thanks!

Here are the list of components I have now:

Arduino UNO
Grove - Base Shield
Grove - Relay (v1.2)
12VDC Solenoid

Also, May I ask if I still need to use a transistor even though I’ve a relay?


  1. Please use the instruction here is to connect Arduino + Base Shield + Grove Relay.

2.Use digitalWrite() to switch On & Off the relay. Before connecting a solenoid test the relay code.

3.The relay acts like a switch.
—Connect GND of Solenoid to GND of power solenoid supply.
—Connect 12V to one pin of Green Terminal on the relay board,
—Connect the other end to other pin of Green Terminal to positive of Solenoid code.

Note: Make sure there is enough delay between On & Off of relay.

Thanks and Warm Regards.

Subject: powering solenoid using arduino

Hi there thank you for your help!
I’ve got a problem with this solenoid which can be seen in the attachment below…
Both wires are of same colour and there is no indication of which is gnd!
May I also ask how do I determine which is it?

Also, is a diode required for this project?

Thanks again!


This article would help you to identify solenoid polarity. Solenoid is a coil of wires. If you web search for “Identify Solenoid polarity” there are many resources including videos on identifying polarity.

You could use a flyback diode for addition protection.

Thanks and Warm Regards

thinks for everything