Maker Pro
Maker Pro

Talk to computers?

  • Thread starter Gregory L. Hansen
  • Start date
G

Gregory L. Hansen

Jan 1, 1970
0
I've been thinking of playing around with computer-controlled systems.
Just for funsies, at least at first. E.g. a robot, or a data acquisition
system for a pendulum experiment. But I was thinking at first of a motor
that spins something, as a toy to play with control systems. So to sum
up my technical demands-- pretty light, I think.

I think I can figure out AD/DA, and I know there are chips that take much
of the work out of that if I don't want to roll my own. But what are
some options for simply moving digital signals to and from the real
world? I'd rather use something like USB than a sound card, but I
don't know how involved that is from the hardware perspective, or what
might be available to ease it.
 
C

Chris

Jan 1, 1970
0
Gregory said:
I've been thinking of playing around with computer-controlled systems.
Just for funsies, at least at first. E.g. a robot, or a data acquisition
system for a pendulum experiment. But I was thinking at first of a motor
that spins something, as a toy to play with control systems. So to sum
up my technical demands-- pretty light, I think.

I think I can figure out AD/DA, and I know there are chips that take much
of the work out of that if I don't want to roll my own. But what are
some options for simply moving digital signals to and from the real
world? I'd rather use something like USB than a sound card, but I
don't know how involved that is from the hardware perspective, or what
might be available to ease it.

--
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it. "
-- Gene Spafford, 1992

Hello, Mr. Hansen. If you'd like to get into USB-based digital and
analog I/O at a very reasonable price with most of the programming
overhead already done for you take a look at the Lab Jack U12. It has
8 12-bit A-D, 2 D-A, up to 20 digital I/o, timer/counters, and software
which will allow you to easily program in VB or C.

http://www.labjack.com/labjack_u12.html
They go at $119 USD ea. in single quantities.

Good luck
Chris
 
Take a look at PIC microcontrollers, www.microchip.com. They have a
huge following and many user sites describing how to program them and
how to interface with them. In general, you can talk to them over a
serial port, for which you can find software here or there or roll your
own.

Chris
 
G

Gregory L. Hansen

Jan 1, 1970
0
Hello, Mr. Hansen. If you'd like to get into USB-based digital and
analog I/O at a very reasonable price with most of the programming
overhead already done for you take a look at the Lab Jack U12. It has
8 12-bit A-D, 2 D-A, up to 20 digital I/o, timer/counters, and software
which will allow you to easily program in VB or C.

http://www.labjack.com/labjack_u12.html
They go at $119 USD ea. in single quantities.

Looks very interesting. $119 is more than I had in mind, but I know from
experience that although electronics are cheap, do-it-yourself tends to
wind up costing more than I expect when I've bought the connectors,
switches, and so on. And even personal time is worth something.

I suppose it's too much to hope for Linux or Mac drivers. The Linux crowd
might have something, depending on how widely used the product is.
 
G

Gregory L. Hansen

Jan 1, 1970
0
Take a look at PIC microcontrollers, www.microchip.com. They have a
huge following and many user sites describing how to program them and
how to interface with them. In general, you can talk to them over a
serial port, for which you can find software here or there or roll your
own.

Chris


Wow. I hardly know where to begin, this is totally new to me.

Datasheets -> General Description is probably a good place. Looks like
these are little computers that take little programs in their own 33 word
language. But I'm not sure that's what I was looking for since I still
wanted to talk with my macrocontroller to, e.g., save data and graph
things. It's like an intermediate computer that I still can't communicate
with, Baseline Flash Programmer aside.

I am getting the impression, though, that I should pick up a Windows box
from somewhere if I want to do much with this sort of thing.
 
H

HappyHobit

Jan 1, 1970
0
Wow. I hardly know where to begin, this is totally new to me.

Datasheets -> General Description is probably a good place. Looks like
these are little computers that take little programs in their own 33 word
language. But I'm not sure that's what I was looking for since I still
wanted to talk with my macrocontroller to, e.g., save data and graph
things. It's like an intermediate computer that I still can't communicate
with, Baseline Flash Programmer aside.

I am getting the impression, though, that I should pick up a Windows box
from somewhere if I want to do much with this sort of thing.

PIC's are fine microcontrollers, but, also take a look at Atmel's AVR
microcontrollers and compare their features.

Atmel's site
http://www.atmel.com/dyn/products/param_table.asp?family_id=607&OrderBy=part
_no&Direction=ASC

You'll find all the tools, assemblers, compilers, etc... at AVR Freaks,
http://www.avrfreaks.net/index.php

J
 
A

Anthony Fremont

Jan 1, 1970
0
Gregory said:
I've been thinking of playing around with computer-controlled systems.
Just for funsies, at least at first. E.g. a robot, or a data
acquisition system for a pendulum experiment. But I was thinking at
first of a motor that spins something, as a toy to play with control
systems. So to sum up my technical demands-- pretty light, I think.

I think I can figure out AD/DA, and I know there are chips that take
much of the work out of that if I don't want to roll my own. But

You know about microcontrollers, right? (PIC, AVR, 8052 etc...)
what are some options for simply moving digital signals to and from
the real world? I'd rather use something like USB than a sound card,
but I
don't know how involved that is from the hardware perspective, or what
might be available to ease it.

My favorite way to get data from a micro (I like PICs) is to use serial
comm. You can use USB as well, but the PICs I tend to use don't have
any native USB support so I would have to get a serial/USB adapter
cable. Some people like shoving data thru the parallel port, but there
is risk involved there.

If you want to look at PIC chips, check out www.picbook.com for a nice
book (college level I suppose, but not that hard) help get you going and
a free blank circuit board for a development system. Digikey sells a
kit of parts to complete the dev board and mine cost me US$59.00, pretty
cheap for what you get IMO. The board uses an 18F452 that can run at up
to 40Mhz (~10MIPS). It also has a small LCD, an RPG, some LEDs, an LM35
temp sensor, and a 2 channel DAC chip. The PIC has built in ADC. You
can use a boot loader in the chip and upload your code with a terminal
program instead of needing to buy a seperate programmer board to flash
the PIC.

I primarily use solderless breadboards for all my tinkering.
 
G

Gregory L. Hansen

Jan 1, 1970
0
You know about microcontrollers, right? (PIC, AVR, 8052 etc...)

They've been mentioned. But I'm really not sure they're what I'm looking
for right now because I'm not looking for a little computer to put into a
self-contained project. I'm just looking for a way to communicate with my
big computer, and it doesn't really look like having a microcontroller
would help me communicate with that.

The Lab Jack U12 that Chris mentioned looks a lot closer to what I had in
mind, although a bit higher in price and MS-centric than I had in mind.
 
C

Chris

Jan 1, 1970
0
If you'd like to have something that costs less and can work
cross-platform, how about the GP-3 PC I/O Board Kit, which goes for
less than $50.00 and operates from a serial port. It has 8 general
purpose I/O lines, 5 10-bit A-D inputs, and the capability for PWM
output (which you can use to make a good 8 or 9-bit analog output with
an op amp).

It uses the serial port, and while the drivers are Window$-centric, you
can communicate through your serial port with any programming language,
even good ol' QBasic. Interface is easy. The GP-3 PC I/O Board Kit is
based on a PIC, which should delight those to whom the PIC is the
answer to everything.
http://www.awce.com/gp3.htm

Glad to be of help
Chris
 
G

Gareth

Jan 1, 1970
0
Gregory said:
I've been thinking of playing around with computer-controlled systems.
Just for funsies, at least at first. E.g. a robot, or a data acquisition
system for a pendulum experiment. But I was thinking at first of a motor
that spins something, as a toy to play with control systems. So to sum
up my technical demands-- pretty light, I think.

I think I can figure out AD/DA, and I know there are chips that take much
of the work out of that if I don't want to roll my own. But what are
some options for simply moving digital signals to and from the real
world? I'd rather use something like USB than a sound card, but I
don't know how involved that is from the hardware perspective, or what
might be available to ease it.

USB can get quite complicated. If you don't need high speed data then I
would suggest that you look at the serial port and/or parallel port.

Sending data out of the parallel port is probably easiest from a
hardware point of view since you can just send data to the port to set
the data bits high or low and get logic highs or lows on the
corresponding pins. You can then use these to control transistors or
FETs. If you just want to switch motors on and off this is probably the
way to go.

I have seen the parallel port used as a low speed serial port by using
one of the pins as a clock and another for data. PIC programmers often
do this.

I do not know how you send data to the parallel port in Linux but I
imagine it is fairly easy.

The serial port can be a bit more difficult from the hardware point of
view since you need to deal with start bits, stop bits and timing. The
voltages are a bit strange for RS232 as well, something like -10V for a
logic 1 and +10V for logic 0. Fortunately there are ICs which take care
of voltage translation for you.

A technique I have used is to interface a PIC to a PC via the serial
port and have the PIC control the electronics. The reason I did this
was I needed accurate timing. I could easily get this with a PIC
clocked at 20 MHz whereas you don't really know exactly what a PC is
doing in any given clock cycle.

Most microcontrollers have serial port hardware on the chip to deal with
the timing and start/stop bits, though you still need to do the voltage
translation.

Maxim make several RS232 line drivers:

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1798/ln/

I think Analog Devices have some as well:

www.analog.com

Gareth

--
 
G

Gregory L. Hansen

Jan 1, 1970
0
If you'd like to have something that costs less and can work
cross-platform, how about the GP-3 PC I/O Board Kit, which goes for
less than $50.00 and operates from a serial port. It has 8 general
purpose I/O lines, 5 10-bit A-D inputs, and the capability for PWM
output (which you can use to make a good 8 or 9-bit analog output with
an op amp).

It uses the serial port, and while the drivers are Window$-centric,

Hmm...

"you can write programs in practically any language (Visual Basic, Visual
C++, C#, Windows Scripting Host, Delphi -- even Active Server Pages)"

I guess that's practically every language.
you
can communicate through your serial port with any programming language,
even good ol' QBasic. Interface is easy. The GP-3 PC I/O Board Kit is
based on a PIC, which should delight those to whom the PIC is the
answer to everything.
http://www.awce.com/gp3.htm

That actually looks more like what I had in mind. Quite interesting.
 
A

Anthony Fremont

Jan 1, 1970
0
Gregory said:
They've been mentioned. But I'm really not sure they're what I'm
looking for right now because I'm not looking for a little computer
to put into a self-contained project.
What exactly are you trying to communicate? Microcontrollers are like
magic glue that can connect a PC to the "real world". They usually
contain all the abilities necessary to connect to various sensors and
then pass that data to a full fleged PC for extended processing,
graphing, making it visible on the internet, etc etc etc. As you learn
about the sensors you might use on a robot, you will begin to appreciate
how micros fit into it all. They can offload work from your main
controlling pc as well as do work that your pc really can't do without
special equipment, like the precision timing you might use in range
finding. They are cheap, extremely powerful devices that can save you
allot of frustration, keep an open mind about them.
I'm just looking for a way to
communicate with my big computer, and it doesn't really look like
having a microcontroller would help me communicate with that.

I don't think you understand what they can do for you. As for
communicating to the PC, they are fully capable of doing so in numerous
ways (rs232, lpt port, usb, ir etc). The magic is in the fact that most
sensors don't output data in a form compatible with your pc. The micro
has the ability to transform that data into something that you can use.
The Lab Jack U12 that Chris mentioned looks a lot closer to what I
had in mind, although a bit higher in price and MS-centric than I had
in mind.

They are ok, if you don't mind being tethered to a pc. It's nothing
compared to what you can do with a micro. :)-) For example, a PIC
16F88 has 2 comparators, 16 i/o pins, a 7 channel 10-bit ADC, 3 timers,
hardware PWM ability, hardware USART for rs232/spi/i2c, internal
multispeed oscillator that's switchable on the fly from 32khz to 8mhz,
4k words code space, 368 bytes ram, and 256 bytes eeprom memory. Not
too bad for something that only uses ~75uA running at 1Mhz and costs
just over $3.00. BTW, PICs don't care who they talk to. ;-)
 
M

Mike Fields

Jan 1, 1970
0
--
This also applies to teenagers !!

I think I just dated myself -- I remember when Gene used to post
all the time back then.
 
G

Gregory L. Hansen

Jan 1, 1970
0
What exactly are you trying to communicate?

+5V and zero. Exact details are a little sketchy now, I'm just trying to
see what the terrain looks like. But I had in mind things involving an
address bus, command bus, and data bus. To tell a particular peice, for
instance, "Hey, motor, turn on", or "Spinny thing, report position".
Microcontrollers are like
magic glue that can connect a PC to the "real world". They usually
contain all the abilities necessary to connect to various sensors and
then pass that data to a full fleged PC for extended processing,
graphing, making it visible on the internet, etc etc etc.

The ones I saw were, e.g. 6 pin IC packages. And I thought to myself
"Okay, so I have a microcontroller in my little device. I still don't
know how to talk to the microcontroller with my computer." It didn't seem
to put me ahead.
As you learn
about the sensors you might use on a robot, you will begin to appreciate
how micros fit into it all. They can offload work from your main
controlling pc as well as do work that your pc really can't do without
special equipment, like the precision timing you might use in range
finding. They are cheap, extremely powerful devices that can save you
allot of frustration, keep an open mind about them.

Certainly. But they also seemed a little adult for me just now. I'm
still about at the level of "Hey, motor, turn on!"

That timing thing is interesting, though. I'd wondered how I might move
data in with precise timing information over, say, a USB, which I gather
communicates in chunks basically when it feels like it. An external clock
and about 32 bits of memory seemed sufficient if I only needed to know
when a value occured rather than ensuring something happens at a
particular time-- send the time along with the data.
I don't think you understand what they can do for you.

That is a very strong possibility. The world of microcontrollers is about
seven hours old for me now.

But I fear also that my competence has been over-estimated. I have about
the electronics skills you would expect from a physicist that has never
done electrical engineering work more complicated than a few op-amp
circuits.
As for
communicating to the PC, they are fully capable of doing so in numerous
ways (rs232, lpt port, usb, ir etc). The magic is in the fact that most
sensors don't output data in a form compatible with your pc. The micro
has the ability to transform that data into something that you can use.

What do you mean by numerous ways (rs232, etc.)? From my brief reading of
datasheets, it seemed that simply means data can be digitized and stored
in memory so that it can be read by a computer if only I were able to
build the electronics that would turn a communication standard into
suitable digital signals to tell the microcontroller what to do. Which is
exactly the problem that I came here with.

If you mean that, say, the pins of a serial port connector mounted on the
board can be connected to the designated pins of the controller and then
talking to it immediately reverts to a software problem, that is more
interesting.
They are ok, if you don't mind being tethered to a pc. It's nothing
compared to what you can do with a micro. :)-) For example, a PIC
16F88 has 2 comparators, 16 i/o pins, a 7 channel 10-bit ADC, 3 timers,
hardware PWM ability, hardware USART for rs232/spi/i2c, internal
multispeed oscillator that's switchable on the fly from 32khz to 8mhz,
4k words code space, 368 bytes ram, and 256 bytes eeprom memory. Not
too bad for something that only uses ~75uA running at 1Mhz and costs
just over $3.00. BTW, PICs don't care who they talk to. ;-)

All that for just over $3.00 is impressive. But microcontroller or not, I
wanted to save data to the PC to graph or analyze, so it would be there
anyway. At least in the shorter term projects.
 
G

Gary J. Tait

Jan 1, 1970
0
On Thu, 3 Feb 2005 03:25:41 +0000 (UTC),
That is a very strong possibility. The world of microcontrollers is about
seven hours old for me now.

But I fear also that my competence has been over-estimated. I have about
the electronics skills you would expect from a physicist that has never
done electrical engineering work more complicated than a few op-amp
circuits.


What do you mean by numerous ways (rs232, etc.)? From my brief reading of
datasheets, it seemed that simply means data can be digitized and stored
in memory so that it can be read by a computer if only I were able to
build the electronics that would turn a communication standard into
suitable digital signals to tell the microcontroller what to do. Which is
exactly the problem that I came here with.


At a fundamental level, the micro would be able to read the real world
sensors, and control motors, valves and things, and convert to/from a
serial bus, and also handle the addressing, so you can command
individual chips.

Ideally, the micro board would be something smarter, running the
operation, with the PC/network connection used to monitor, adjust, and
coordinate the operations of the boards.
If you mean that, say, the pins of a serial port connector mounted on the
board can be connected to the designated pins of the controller and then
talking to it immediately reverts to a software problem, that is more
interesting.

Yes, the smarts are in the software code.
All that for just over $3.00 is impressive. But microcontroller or not, I
wanted to save data to the PC to graph or analyze, so it would be there
anyway. At least in the shorter term projects.

You can still have it log stuff to a PC.
 
A

Anthony Fremont

Jan 1, 1970
0
Gary J. Tait said:
On Thu, 3 Feb 2005 03:25:41 +0000 (UTC),



At a fundamental level, the micro would be able to read the real world
sensors, and control motors, valves and things, and convert to/from a
serial bus, and also handle the addressing, so you can command
individual chips.

Ideally, the micro board would be something smarter, running the
operation, with the PC/network connection used to monitor, adjust, and
coordinate the operations of the boards.


Yes, the smarts are in the software code.


You can still have it log stuff to a PC.

Thanks for saying that, I have a hard time putting into the proper
words.
 
G

Gregory L. Hansen

Jan 1, 1970
0
Yes, the smarts are in the software code.

The micros I looked at seemed to be less handy than that. Can you
recommend a specific part?
 
R

Rich Grise

Jan 1, 1970
0
They've been mentioned. But I'm really not sure they're what I'm looking
for right now because I'm not looking for a little computer to put into a
self-contained project. I'm just looking for a way to communicate with my
big computer, and it doesn't really look like having a microcontroller
would help me communicate with that.

The Lab Jack U12 that Chris mentioned looks a lot closer to what I had in
mind, although a bit higher in price and MS-centric than I had in mind.

If your desktop comp. has a serial port or printer (parallel) port, and
you get the right software, you can just write bits.

http://www.google.com/search?q=pc+parallel+port+spec
http://www.google.com/search?q=pc+serial+port+spec

Good Luck!
Rich
 
R

Rich Grise

Jan 1, 1970
0
Looks very interesting. $119 is more than I had in mind, but I know from
experience that although electronics are cheap, do-it-yourself tends to
wind up costing more than I expect when I've bought the connectors,
switches, and so on. And even personal time is worth something.

I suppose it's too much to hope for Linux or Mac drivers. The Linux crowd
might have something, depending on how widely used the product is.

http://www.google.com/search?hl=en&q=linux+pc+port+drivers

Have Fun!
Rich
 
Top