3

I am new to Arduino and have a small query. I am building a simple system that switches on a motor and switches it off after some time and repeats this in a loop.

The Arduino that I am using is a "DIY UNO Play Breadboard -ATMEGA328P with FT232 Breakout Board" (Rs. 825, or 12ドル.38USD, from Mangalore). The Arduino board is similar in size to a Nano but without USB. The FT232 board has a USB B port on one end and serial pins on the other. picture of boards and cable My query is whether I should connect the positive end of battery supply to the motor and then connect in series using a motor controller circuit to port 7 and connect the negative terminal to the gnd port.

Or do I need a separate voltage source for my Arduino, because this Arduino has no built in USB ports.

This is my code to switch on and switch off the motor:

int motorPin = 7; pinmode(motorPin,OUTPUT); digitalWrite(motorPin,HIGH); //turn motor on delay(500); //wait digitalWrite(motorPin,LOW); //turn motor off delay(500); //wait

asked Apr 16, 2016 at 16:20
2
  • Can you please specify operating voltage/current rating of your motor. and some info related to your motor controller circuit. Commented Apr 16, 2016 at 20:26
  • My motor is a 5V motor and this is the circuit that I want to build: instructables.com/files/orig/F5O/D77S/I0VOVRVX/… Commented Apr 17, 2016 at 0:26

2 Answers 2

1

Using same Voltage supply to power Arduino Board and motor simultaneously is usually not a good practice.

So, what you can do is use separate batteries to power Arduino and motor as shown in image below enter image description here However you can also power arduino and motor from single power supply, but in this case you should first think of current ratting of your battery and current consumption of your Arduino (normally 500mA) and motor. As shown below, enter image description here Hope it help. Any question Comment below.

answered Apr 17, 2016 at 6:11
4
  • thanks for answering. Just another doubt, why can't I connect the positive terminal of the battery to the Vin Port. Commented Apr 17, 2016 at 12:50
  • oh, really sorry, did a mistake there. edited. you are right. you actually have to connect to vin which in voltage input port whereas 5V is a voltage output port. Commented Apr 17, 2016 at 16:26
  • Last doubt. Do I need to connect the negative terminal in the first diagram of the battery connected to motor to the gnd pin of the Arduino or will it work without the connection? Commented Apr 19, 2016 at 15:58
  • you have to. It wont work without that. What we are doing there is called common ground. All GNDs in your circuit must be connected. Commented Apr 19, 2016 at 17:19
0

You can use the same power supply for both if it can source enough current for both; USB ports usually can not. But what you must not do is try to supply motor current through the Arduino, from any power supply. You need the Arduino to control a transistor switch which manages the motor current.

answered Apr 17, 2016 at 12:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.