Project tutorial
Tutorial on how to control 12V Devices with Arduino

Tutorial on how to control 12V Devices with Arduino © LGPL

Relay VS Transistor.

  • 4,780 views
  • 0 comments
  • 5 respects

Components and supplies

Apps and online services

About this project

This tutorial will show you how to control the higher voltage devices e.g. 12 V LED with Arduino.

I will show you how to do it with both relays and transistors.

I hope you will find it useful

Full tutorial can be found here:

If you like this content and you want to support me in creating similar videos go to my Patreon webpage

https://www.patreon.com/MariosIdeas

Or

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7PD67JWZ9S3EJ&source=url

Code

Diming 12V LED with potentiometerArduino
int LED_Intensity;
#define LedPin 5
#define PotentiometerPin A6

void setup() {
 pinMode(LedPin, OUTPUT);
 pinMode(PotentiometerPin, INPUT);
}

void loop() {
  LED_Intensity=map(analogRead(PotentiometerPin),0,1023,0,255);
  analogWrite(LedPin, LED_Intensity);
}
Switching on 12V LED using Motion SensorArduino
int motion_detected;
#define LedPin A3
#define MSPin 10

void setup() {
  Serial.begin(9600);  
  //Calibrating sensor 
  Serial.println("Calibrating sensor "); 
  delay(60000); 
  Serial.println("Done"); 
  pinMode(LedPin, OUTPUT);
  pinMode(MSPin, INPUT);
}

void loop() {
 motion_detected =digitalRead(MSPin);
 if(motion_detected == HIGH)
   digitalWrite(LedPin, HIGH); 
 else
   digitalWrite(LedPin, LOW);      
}
Switching 12VLED on with photoresistorArduino
int light_intensity;
#define LedPin A3
#define PhotoresistorPin A5

void setup() {
 pinMode(LedPin, OUTPUT);
 pinMode(PhotoresistorPin, INPUT);
}

void loop() {
  light_intensity=analogRead(PhotoresistorPin);
  if (light_intensity > 290) 
    digitalWrite(LedPin,HIGH); 
  else     
    digitalWrite(LedPin,LOW);

Schematics

Diagrams
Diagram sx1jfevcwu

Comments

Similar projects you might like

Control an LED with the Remote Control

Project showcase by Nicholas_N

  • 32,094 views
  • 17 comments
  • 26 respects

Control Your Computer With A Remote Control

Project tutorial by Arduino_Scuola

  • 12,731 views
  • 4 comments
  • 11 respects

Control Up to 65,280 Relays with Your Arduino!

Project tutorial by Christian

  • 52,649 views
  • 17 comments
  • 97 respects

Blinds (Or Any AC Power Motor) Control

Project tutorial by gomecin

  • 38,359 views
  • 47 comments
  • 112 respects

Servo Control with TV Remote Control

Project showcase by eldo85

  • 25,277 views
  • 8 comments
  • 48 respects
Add projectSign up / Login