PNP transistor


Turn the LED on with this code:

  1. void setup() {                
  2.   pinMode(13, OUTPUT);    
  3. }
  4.  
  5. void loop() {
  6.   digitalWrite(13, HIGH); // Turn on LED
  7.   delay(5000);
  8.   digitalWrite(13, LOW); // Turn off LED
  9.   delay(5000);      
  10. }

DC motor

You will need:
- DC Motor
- Power diode
- TIP 120

Turn the motor on with this code:

  1. void setup() {                
  2.   pinMode(8, OUTPUT);    
  3. }
  4.  
  5. void loop() {
  6.   digitalWrite(8, HIGH); // Turn on motor
  7.   delay(5000);
  8.   digitalWrite(8, LOW); // Turn off motor
  9.   delay(5000);      
  10. }