Sunday, 4 June 2017

Turning water pump on/off using Arduino Uno R3


I'm trying to build a simple system to turn a water pump every 24 hours for 10-20 seconds. I have 5V pump. When I connect it to 5V, GND it works but when I connect it to pin 12 (or any other digital pin) and GND it does not work. Here's my sample sketch:


int led = 12;


void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}

void loop() {
digitalWrite(led, HIGH);
}


What am I doing wrong?




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...