Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Solenoid with TIP120 Transistor and 9V Battery

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Solenoid with TIP120 Transistor and 9V Battery

Circuit Documentation

Summary

This circuit is designed to control a solenoid using an Arduino UNO. The solenoid is powered by a 9V battery and is switched on and off using a TIP120 Hi-Current Darlington Transistor. A diode is used to protect the circuit from back EMF generated by the solenoid, and a resistor is used to limit the current to the base of the transistor.

Component List

  1. Solenoid

    • Description: Electromagnetic device used to convert electrical energy into mechanical motion.
    • Pins: pin1, pin2
  2. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  3. 9V Battery

    • Description: Power source for the circuit.
    • Pins: -, +
  4. TIP120 Hi-Current Darlington Transistor

    • Description: NPN power transistor used for switching and amplification.
    • Pins: BASE, COLLECTOR, EMITTER
  5. Diode

    • Description: Semiconductor device that allows current to flow in one direction only.
    • Pins: cathode, anode
  6. Resistor

    • Description: Passive electrical component that limits current flow.
    • Pins: pin1, pin2
    • Properties: Resistance: 1000 Ohms

Wiring Details

Solenoid

Arduino UNO

9V Battery

TIP120 Hi-Current Darlington Transistor

Diode

Resistor

Documented Code

int solenoidPin = 4; // This is the output pin on the Arduino we are using

void setup() {
  // put your setup code here, to run once:
  pinMode(solenoidPin, OUTPUT); // Sets the pin as an output
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(solenoidPin, HIGH); // Switch Solenoid ON
  delay(1000); // Wait 1 Second
  digitalWrite(solenoidPin, LOW); // Switch Solenoid OFF
  delay(1000); // Wait 1 Second
}

This code sets up pin 4 on the Arduino as an output to control the solenoid. In the loop function, the solenoid is switched on and off every second.