title: How to wire a 12V double solenoid to an Arduino?
body: <p>I have recently been trying to pneumatically actuate a cylinder using a 12 V double solenoid and an Arduino Uno. The solenoid works when tested without code and wiring, however when I try to actuate the cylinder using code, nothing happens. I have a feeling that the way in which I wired everything to the breadboard may be incorrect, so I was wondering if anyone had any tips or good schematics by which I could wire it all together.</p>
  
  <p>The materials I am using are two PNP transistors, two resistors, two diodes, and then the actual solenoid and similar hardware. My code is just a simple LED blink code which can be used to send signals to the solenoids, so I do not believe that is the issue. However, I have attached it underneath just in case.</p>
  
  <pre><code>int solenoid1 = 4;
  int solenoid2 = 5;
  
  void setup() {
    // put your setup code here, to run once:
    pinMode(solenoid1, OUTPUT);
    pinMode(solenoid2, OUTPUT);
  }
  
  void loop() {
    // put your main code here, to run repeatedly:
    digitalWrite(solenoid1, HIGH);
    delay(1000);
    digitalWrite(solenoid1, LOW);
    digitalWrite(solenoid2, HIGH);
    delay(1000);
    digitalWrite(solenoid2, LOW);
  }
  </code></pre>