I want to control a servo motor attached to an arduino through hand movements. I am just beginning the project and my idea is to attach a couple of accelorometers to each finger and then send that data to the arduino through Xbee . Firstly is this the right approach to doing this , or are there ready made sensors which I can wrap around my hand and send data to the arduino. Secondly I am stumped as to how to attach a Xbee sender to each accelerometer on my hand. Is this how its generally done? Does kinect even use accelerometers. Or is it some other kind of sensor. What would be the right approach to this project?
Electronic – arduino – Gettting hand movements registered and sent to an arduino
arduinokinect
Related Solutions
If your device shows up as a CP2013 when you plug the device into a computer's USB port, and you want to replace your Computer with an Arduino, then that isn't really easy to do, or generally possible. The methods you mention in the question have to do where the AVR/Arduino is the device, not the Host.
The device already has a USB-UART converter embedded inside it, and only shows you the USB side of it. This means that your arduino needs to function as a USB host. Functioning as USB host is not straightforward. You need to set up a USB Host/Hub controller, and figure out how to handle enough of the USB protocol stack to talk to the CDC compatible USB-UART device. Using a USB OTG Host controller may be marginally easier, but still nowhere close to being trivially easy. Your best bet would be to see if you can bypass the CP2013 on the device and access the UART lines directly. This may not always be possible. If the CP2013 is actually some other piece of hardware or firmware masquerading as a CP2013, then you're fresh out of luck.
Issue 1: Driving a motor directly from an Arduino
Driving a motor directly off the Arduino pins is not advisable for multiple reasons:
- Load current, especially at motor start-up and stall conditions. As rightly pointed out in the question, the Arduino pins may simply not be rated to supply sufficient current. The Arduino might heat up or even get damaged by sustained high current draw.
While each Arduino pin for ATmega-based Arduinos is rated for 40 mA, I personally prefer to keep any sustained loading to under 30 mA, your risk appetite may differ. Without seeing the datasheet of the motor in question, it is impossible to surmise how much current the motor requires - Back-EMF from the motor, both during motor turn-off, and possibly during motor commutation - As a DC motor spins, the contact brushes "commutate" between split rings, at least in the traditional types of brushed DC motors, generating tiny little sparks each time.
Back EMF is basically reverse voltage generated by the motor coils (or any inductive load at turn-off), transients (spikes) that can momentarily far exceed the acceptable voltage range the microcontroller pins can tolerate.
Back EMF remains a risk, albeit abated, even if a fast diode is connected in reverse bias across the motor's leads, a strongly recommended practice. - Thus, an isolation of some sort between the Arduino and the motor drive is strongly recommended. For simplicity of implementation, this would be a motor shield.
If you are comfortable with basic electronics, this can also be achieved by directly wiring up a suitable motor driver IC and flyback diodes. (Edit: This is excellently described in the answer by Manishearth)
The motor driver, whether a shield or an IC, should be powered independently of the Arduino, but with the two power source ground lines connected together. See further down.
Issue 2: Controlling accelerometer and motor shield simultaneously
- Yes, the accelerometer can be controlled and read from the Arduino with the motor shield in place, by ensuring that the pins selected for accessing the accelerometer are ones not actually in use by the motor shield. They would all be connected to the shield, but with no internal function or connection within the shield. The documentation for the selected shield will typically provide this information.
For convenience, look for a motor shield with stackable headers, i.e. with the Arduino header pins replicated on the motor shield for attaching additional hardware, in your case the accelerometer. Not all shields provide stackable headers. Thus complicates using the pins not utilized by the shield, needing wires to be soldered to the relevant header pads on the PCB, or some such arrangement.
On the off chance that the motor shield you select uses up all GPIO pins, as can be the case with shields for driving multiple motors, you may have a problem. Since only 1 motor is to be driven, avoid multi-motor shields which do not leave enough unused GPIO pins.
Issue 3: Power distribution between Arduino and motor shield
- The problem with the suggested 6 x AA arrangement (nominal 9 Volts maximum) is that while it provides sufficient voltage for the DC input jack available on many Arduinos (usually rated for 7 to 12 Volts input), it is too high for the motor to be driven directly off it.
- There are, however, several motor shields that accept a direct power input (e.g. 7 to 25 Volts), and then provide a nicely regulated 5 Volts to the Arduino they are attached to. So the Arduino does not need to be separately powered at all, and should not be either. This is absolutely the only type of motor shield one should buy.
- Kludgier alternatives include tapping across 4 of the 6 AA cells to power the motor, and all 6 cells to power the DC jack (PWRIN) of the Arduino, or using a separate 6 Volt buck regulator for the motor power, while feeding the 9 Volts directly to the Arduino DC jack.
- Attempting to power the Arduino with the battery pack and then powering the motor from the Vin pin of the Arduino is a bad idea because
- The M7 diode between DC jack and Vin pin on several Arduino reference designs is rated for 1 Ampere, the motor could conceivably draw more, at least momentarily
- All the electromagnetic noise generated by the motor, commutation noise plus flyback transients, will be feeding back into the Arduino board unless very stiff decoupling is implemented, not a simple matter. This EMI feedback will cause intermittent, hard to debug, issues with the Arduino's operation.
Related Topic
- XBee API mode help
- How to build a node sensor network with a base unit to publish to the web
- Potential project: Wireless Security Camera with the Arduino Yun
- Electrical – python – How to create a network of multiple xbee s2 with python and arduino
- Electrical – Arduino 3.3 V to 5 V to controll Stepper Driver MA860H
Best Answer
There are a lot of questions embedded in there! Let's try and unpack them:
Hope that helps!