Offline
Newbie
Karma: 0
Posts: 3
|
 |
« on: February 06, 2013, 12:57:24 pm » |
Hello, ( I have searched for a few days and tried to write a program but failed in both aspects.) with that said... I have a project that I need some help with. I have an arduino micro and I am completely new to programing and have no idea what i am doing on the programing side of this project. What I would like to do is run a 12vDC motor bidirectionally for a set amount of time. and have it be triggered by a voltage signal (or ground???) to the arduino micro. So when voltage is applied to (input pin) the motor spins cw for (time) then stops even though power (or ground???) is still applied to (input pin). When power is removed from (input pin) motor spins ccw for (time) then stops until power is applied again. If i can be steered in the right direction or if someone is nice enough to write the program i would be very thankful. I attached a picture to show my setup/ or what i think is correct. im not sure completely as i am somewhat new to semiconductors 
|
|
|
|
« Last Edit: February 06, 2013, 01:00:10 pm by slovw3 »
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 27
Posts: 1541
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #1 on: February 06, 2013, 01:01:21 pm » |
Have you tried a regular H-Bridge? Also you cannot have both USB and battery plugged into the arduino together.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #2 on: February 06, 2013, 01:30:58 pm » |
Have you tried a regular H-Bridge? Also you cannot have both USB and battery plugged into the arduino together.
Sorry for my ignorance as i am totally new to programming and somewhat new to semiconductors. No i haven't, when you say regular h-bridge do you mean a semiconductor style? and i only would have the usb power to actually power the board the other power wire is the switched power to the pin, unless i can only have a switched ground?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 27
Posts: 1541
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #3 on: February 06, 2013, 01:38:39 pm » |
Yes, an actual chip. Or if you have a few transistors lying around, you can make your own H bridge. Look up H-Bridge IC
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
East Anglia (UK)
Offline
Edison Member
Karma: 47
Posts: 1390
May all of your blinks be without delay
|
 |
« Reply #4 on: February 06, 2013, 01:41:20 pm » |
Wow - that diagram is confusing. Do you really have ground and 12 volts going to each motor terminal as it appears ? I can't tell from the diagram which contacts on the relays are switching what. Can you post a more conventional circuit diagram ?
As has been suggested an H bridge (Google for it) would be the normal way to control motors using an Arduino. There is nothing wrong with using relays but they are on/off devices. An H bridge (motor shield) would allow speed control of the motors which, is nothing else, allows you to soft start them which can be kinder than starting them at full power each time.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #5 on: February 06, 2013, 01:51:53 pm » |
Wow - that diagram is confusing. Do you really have ground and 12 volts going to each motor terminal as it appears ? I can't tell from the diagram which contacts on the relays are switching what. Can you post a more conventional circuit diagram ?
As has been suggested an H bridge (Google for it) would be the normal way to control motors using an Arduino. There is nothing wrong with using relays but they are on/off devices. An H bridge (motor shield) would allow speed control of the motors which, is nothing else, allows you to soft start them which can be kinder than starting them at full power each time.
I dont even know how to write a program to do any of this, let alone soft start a motor, lol 
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Online
Edison Member
Karma: 27
Posts: 1541
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #6 on: February 06, 2013, 01:54:03 pm » |
Start with the examples and maybe even a forum search, there is plenty of codes in here to help you get started.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6313
-
|
 |
« Reply #7 on: February 06, 2013, 01:57:58 pm » |
You have a range of options available to you. A hardware based solution would need a couple of relays controlled by a couple of 555 timers, no electronics.
The easiest Arduino-based solution would use a UNO or similar with an H-bridge motor drive shield and a sketch that reads the input and turns the motor on forwards and backwards as required. Is your intended motor within the voltage and current capabilities of any of the commonly available motor shields? For example the L298N based shields supports voltages well in excess of 12V and will handle up to about 4A.
|
|
|
|
|
Logged
|
|
|
|
|
East Anglia (UK)
Offline
Edison Member
Karma: 47
Posts: 1390
May all of your blinks be without delay
|
 |
« Reply #8 on: February 06, 2013, 01:58:28 pm » |
I dont even know how to write a program to do any of this, let alone soft start a motor, lol  lol indeed. A clearer circuit diagram would be a start.
|
|
|
|
|
Logged
|
|
|
|
|
|