Pages: [1]   Go Down
Author Topic: Need help getting started.  (Read 2131 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I am new to all this. I grew up in a techknology filled home, so I am comfortable around tech. However when it comes to controllers and programming I'm as fresh as they come, kinda..

I have a project I thought up to solve a problem, and need help figuring out what I will need to make it work. The goal is to move a device (roughly 6 pounds) that gets plugged in via USB when it gets turned on, and then again when it gets turned off. I need a way of monitoring that USB port (externally. Maybe with some sort of UBS passthrough cable) and then telling a motor to run for a set amount of time at a set speed. Again both when it gets power/data sent too it and again when power and data stop.

What will I need?! please any help would be greatly appreciated!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Rather than using timers you should probably put in limit switches to detect the start and stop positions.

How will your motor be powered?  USB doesn't supply much (5V at 500mA is 2.5 Watts).

Does the device have a pilot light that could be used to detect being ON and OFF?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had thought about using start stop switches. However this device is more on the sensitive side and I would prefere the movement of the motor to be programmed to ease in and ease out instead of coming to a sudden stop.

Also I had planned to give power to this knowing that USB wouldn't provide enough.

It does have an indicator light. However I would like to keep the modifications of the device itself to a minimal. All I want to do is make a stand that I can put this device on and have it work independently.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I wanted to do this I would consider a sense resistor (1 ohm?) in the ground line of the USB and measuring the voltage across that resistor to sense a current draw. For example if the device draws 50mA when ON there would be a 50mV drop across the 1 Ohm resistor.  Using the internal 1.1V analog reference you should be able to sense 50mV easily enough.

For the limit switches they don't have to be a hard limit...  You can have them tell the Arduino to "start ramping down speed now".
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thats a great tip about the sense resistor. Not sure how I would get to the ground line of the USB though (that being one of three challenges). At this point nothing is off the table, and I'm open to what will end up working the best. But what I need to get off the ground is a list of three main things:

  • some way of reading the USB port without interrupting it.
  • a controller that can be programmed (not sure what arduino would be best for this.)
  • a proper motor than can be controlled by the arduino. Nothing to big.

Those are the three puzzle pieces I need for this project. And once those are solved, then it will be time to figure out the finer details of it.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

> some way of reading the USB port without interrupting it.

To inset the sense resistor:  Get a USB extension cable.  Remove most of the cable.  Connect the non-black wires straight through.  Connect the black wires to either end of a 1 Ohm resistor.  Connect the 'device' through this extension to the PC (or USB hub).  Connect the 'device' side of the resistor to the Arduino analog input pin.  The Arduino should be powered by a USB cable to the same PC (or USB Hub).  The voltage sensed by the analog input will be proportional to the current draw of the device.  The draw should be higher when the device is ON.

> a controller that can be programmed (not sure what arduino would be best for this.)

Any Arduino.  If space is not absolutely critical I would use the common UNO.  If you can find a Leonardo it will be the same size but a bit cheaper and allows things like USB keyboard/mouse emulation on a PC/Mac.

> a proper motor than can be controlled by the arduino. Nothing to big.

Don't forget that you need some way to control the motor.  Perhaps a motor control shield.  This will allow you speed and direction control for a DC motor.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So it looks like the USB part will be fairly easy to accomplish, that's exciting.

At this point in the process, size isn't an issue. However, if I get this project to the final stages the smaller the better. I was looking at the arduino pro (assuming I would just build it into my end project).

Do you have an example of how to control a motor with an arduino?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://lmgtfy.com/?q=Arduino+motor+control
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And if I wanted a trillion possible answers I would do that. But I posted this forum because I wanted to talk to someone about it, and hopefully get a more specific answer.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, then here:

http://www.ladyada.net/make/mshield/use.html

That's what I found when I Googled "example of how to control a motor with an Arduino".  If you had tried that before asking the question you could have had your answer much sooner.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Maryland
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Mechanical engineering
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess you're building some type of robotic cleaner based on your post, but you basically need a micro-controller (arduino) a motor controller (because the payload is 6 pounds you probably need a powerful one (go with a sabertooth motor driver) some type of frame with electric motors. The electric motors should connect to the motor driver and the motor driver should connect to the micro-controller (arduino), then its just tweaking and simple programming from there.
Logged

Pages: [1]   Go Up
Jump to: