Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: geekay on September 12, 2011, 03:09:33 AM

Title: How Do I React to USB input
Post by: geekay on September 12, 2011, 03:09:33 AM
Hello all,

I am dreadfully new to hardware engineering and my track record for success when it comes to playing with hardware is--- well colorful to say the least (I have the Midas touch--- but in place of gold, I leave broken parts--- and on occasion a puff of smoke).

However, I am a pretty darn good programmer, if I do say so myself;

Now to my question:

Let me first start off by describing what I have in mind, and let me know if such a thing is even possible or if I am not thinking about it properly;
I would like to take a USB cord, have one end connect to a computer, and the other connect to some sort of circutboard; I would like it so that from the computer I can send a message that allows me to send a power/go signal to something that is connected to that board (a motor or a light,... really does not matter at that point).

I have been looking at some of the Arduino- and trying to make heads or tails of it all (all of this hardware stuff is very much beyond me--- but it is a subject that I very much want to learn about). If I am looking at it properly, it sounds like you write programs that are stored on a chip on that thingy--- but ideally I would like to use an independently running computer to send it messages to do stuff (not only can I use higher level languages to my advantage in complex programs, but also might have much better performance if I wanted to do any real number crunching).

So I guess my question is: Is this possible and what type of board/hardware-thingy am I looking for to put something like this into action.


Thank you very kindly for your time,
-GK
Title: Re: How Do I React to USB input
Post by: 123laurens on September 12, 2011, 04:33:06 AM
I'm also only good at coding! I do have some electronics experience, but I definitely don't know it all. I simply look at designs and how they work, and copy it into whatever I make.

anyhow, i own an arduino, basically its USB port is a COM port emulator, so you can send data through the COM terminal of your choice (or use the provided one) and you will receive it via UART, character by character. simply write some code to add all these letters to the end of a string and when it finds no more, you got the mesige!

sending data back to the computer via USB is even easyer, Serial.println("hello world!"); will give you hello world! in the console, when you want it.

if you want to do it yourself, however.. there are probably COM emulators on sparkfun, hookup the thing via UART, and it shud do the same.
Title: Re: How Do I React to USB input
Post by: Soeren on September 12, 2011, 03:26:30 PM
Hi,

I have been looking at some of the Arduino- and trying to make heads or tails of it all (all of this hardware stuff is very much beyond me--- but it is a subject that I very much want to learn about).

 If I am looking at it properly, it sounds like you write programs that are stored on a chip on that thingy--- but ideally I would like to use an independently running computer to send it messages to do stuff (not only can I use higher level languages to my advantage in complex programs, but also might have much better performance if I wanted to do any real number crunching).

So I guess my question is: Is this possible and what type of board/hardware-thingy am I looking for to put something like this into action.
Sounds to me like you'd be better off with no hardware building and no hardware programming.
VM140 from Velleman (http://www.vellemanusa.com/us/enu/product/view/?id=523886) is a 33 line data acquisition/interface board that use a firmwared microcontroller, but is controlled completely from the PC it connects to. You can receive analog and digital inputs and send analog and digital signals plus PWM (Pulse Width Modulated) signals.

You get .dll files for developing your own apps, plus a few demo programs.


[quote authou=Specs]
    * 8 analogue 10 bit resolution inputs: 05 or 10VDC / 20k ohms
    * 8 analogue 8 bit resolution outputs: 05V or 10VDC / 47 ohms
    * 8 digital inputs: open collector compatible (connection to GND=0) with on-board LED indication
    * 8 digital open collector outputs (max. 50V/100mA) with on-board LED indication
    * one 10 bit PWM output: 0 to 100% open collector output (max 100mA / 40V) with on-board LED indication
    * USB port: USB 1.1 & 2.0 compatible
[/quote]