On Friday, May 27, 2011 1:17:03 PM UTC-4, Azam Saleem wrote:
>
> I need to ask that I have a project of solar tracking system using 
> microcontroller ... I was asking that could I control the hardware 
> through android phone such as stepper motor.


There are various methods with various advantages and disadvantages.  First, 
if the mechanical device (or its drive voltages) are of a scale that could 
be of any danger, a re-purposed android device is probably not a safe choice 
as there is too much unknown complexity which could lead to surprising 
mis-operation.  With that out of the way, some ideas:

- Especially if the phone only needs electrical output and obtains its input 
by built in sensors, I'd be tempted to plug something into the headphone 
jack.  You could do something with tone decoders, or even build a full 
bidirectional low baud rate modem (using software modulation/demodulation on 
the android side).

- Conceivable you could affix photocells to areas of the display screen, 
effectively making left and right "buttons" which the software could push by 
lighting them up, and thus causing an external circuit to turn the motor.  
You would have to spend some time making sure nothing else ever displays in 
those areas.

- Bluetooth is fairly clean and I hear embedded serial modules are now in 
$20 range, so it's both one of the most cost effective choices and one of 
the least likely to risk damaging the phone hardware

- Some phones can function as usb hosts by [rooting and] installing a 
customized kernel, but they require odd cabling as they do not supply usb 
bus power.  A few recent tablets have usb host mode out of the box. There 
are many USB-based stepper drivers 

- Some of the early HTC phones such as the G1 have low-voltage serial ports 
which can be enabled by [rooting and] installing a customized kernel. You 
will need level translation circuitry as the allowable input voltage is 
below even that of 3.3v logic.  You will also need to source a special 
HTCUSB connector, either by modifying the full headset adapter or getting it 
from someplace like sparkfun.
- You can use a USB host capable external board and if the device runs 
Android 2.3.4? or later use Google's official 
ADK<http://developer.android.com/guide/topics/usb/adk.html>protocol to talk to 
software on the android device; if the android version 
is earlier, there are unofficial projects which talk the ADB protocol and 
should work with most devices (perhaps with small modifications). Both are 
designed to remain within unprivileged userspace on the android device - no 
rooting, no kernel modifications.  Most of the boards people are using on 
the external side should be capable of talking to common stepper drive amps.

- Instead of an android 'phone' you can get a different embedded device with 
better native I/O, such a beagle board or bugbase, which is capable of 
running android (amongst other OS choices)

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to