Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: MaltiK on February 09, 2009, 02:35:21 PM

Title: Cheap computer -> output?
Post by: MaltiK on February 09, 2009, 02:35:21 PM
Is using a Max232 and connecting say a 12v DC solenoid, and of course 12v and GND into the V+ and GND, to the output of the Max chip as easy as I describe it?

How would I invoke the output's high?

Please don't suggest a Phidgets, as my budget is beyond maxed.
Title: Re: Cheap computer -> output?
Post by: paulstreats on February 09, 2009, 02:57:05 PM
do you mean that you want to drive a solenoid with a max232?
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 09, 2009, 03:09:07 PM
yes, is this possible, and does a springed dc solenoid need pwm?
Title: Re: Cheap computer -> output?
Post by: Webbot on February 09, 2009, 05:18:32 PM
Not tried it - but sounds feasible.

Just a few thoughts off the top of my head ... If using PWM then I guess you would have to use a lowish frequency due to the mechanical movement in the relay. And would the spring add some kind of contact bounce? If so - it would effect the accuracy of your motor control - assuming that is important.

Title: Re: Cheap computer -> output?
Post by: MaltiK on February 09, 2009, 06:13:27 PM
Well it isnt very important, and I dont understand why a simple 12v NPN transistor wont suffice, I only need one direction cuz its springed
Title: Re: Cheap computer -> output?
Post by: Webbot on February 09, 2009, 06:44:59 PM
This may? help : http://www.me.umn.edu/courses/me2011/robot/technotes/motorcontrol/motorcontrol.html (http://www.me.umn.edu/courses/me2011/robot/technotes/motorcontrol/motorcontrol.html)
Title: Re: Cheap computer -> output?
Post by: Soeren on February 09, 2009, 06:47:56 PM
Hi,

The MAX232 haven't got the power required for a relay.
Just go ahead with your transistor, but remember a free wheeling diode to catch the inductive kick from the relay coil, or your transistor will be toast.
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 09, 2009, 06:50:30 PM
Alright, but how do I invoke/call it? What command do I use? Since its not programmable, how does it work?
Title: Re: Cheap computer -> output?
Post by: Webbot on February 09, 2009, 07:23:53 PM
Alright, but how do I invoke/call it? What command do I use? Since its not programmable, how does it work?

Check my previous link for a design to drive it by a transistor. Then use PWM for speed control or just an I/O pin if you only need stop/start.
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 10, 2009, 05:18:43 AM
Alright, but my question is how do I call upon the high/low of the transistor? Do I use hyperterminal, what?
Title: Re: Cheap computer -> output?
Post by: paulstreats on February 10, 2009, 06:24:35 AM
are you using a microcontroller?
Title: Re: Cheap computer -> output?
Post by: HyperNerd on February 10, 2009, 10:00:45 AM
if you're using a PC with a serial port them you will need a microcontroller to 'decode' the signal. I.E the computer tells the uC to move the solenoid, then the uC turns on an output pin connected to the transistor, which then powers on the solenoid.

PC -> Max232 -> uC -> Transistor -> Solenoid

Hope this helps :)

 -HyperNerd
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 10, 2009, 02:03:29 PM
Ahhh ok so I guess that was my real question... thanks a bunch guys
Title: Re: Cheap computer -> output?
Post by: dunk on February 11, 2009, 10:59:05 AM
as long as you do not intend to use a recent version of windows it is fairly easy to control the pins on a PC parallel port individually.
you'll need to do a small amount of programming in C or C++ and drive any loads of more than a few mA through a transistor but it is fairly simple.
i did this some years ago under Linux.

things become far more complicated if you are using windows NT, XP or vista but i believe it is still possible.
there's quite a bit of information on hot to do this online. eg: http://www.epanorama.net/circuits/parallel_output.html#windowsprogramming (http://www.epanorama.net/circuits/parallel_output.html#windowsprogramming)


although it is not the correct way to use the serial port it is theoretically possible to control the logic of some of the signal pins on the serial port as well.
look into setting the level of the RTS and DTR pins.
i don't know how easy it would be (or if it's is possible in windows) but it would be worth looking into if you don't have a parallel port.

as HyperNerd says, the more correct way to use a serial port is to use a microcontroller to decode what is being sent from it. that way you can get far more useful output.


dunk.
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 25, 2009, 07:18:12 AM
So would I connect said solenoid voltage wire to pin #14, with a transistor of course?

(http://www.best-microcontroller-projects.com/image-files/chip-pinout-max232.png)

And connect the GND to the GND of the chip.

I read up on the side dunk, and it was rather confusing.

My PC is running vista, so HyperTerminal is not a problem, how would I go about writing a C# proggy for making an output high to the chip?
Title: Re: Cheap computer -> output?
Post by: HyperNerd on February 25, 2009, 02:09:56 PM
The MAX232 chip is just a converter to allow the microcontroller to communicate with the PC. The data pushed from pin 14 of that chip is of no use without a microcontroller, as it is stream of 1's and 0's, not a solid on or off signal - what you need to drive the solenoid. Also I reccomend the MAX233. Although more expensive, the wiring is simpler, as you don't need the external cap's.

To use this chip with a microcontroller, connect pin 11 of the MAX232/233 to the Rx pin on the uC, and pin 12 to the Tx pin of the uC. Then connect pin 14 to pin 2 of a serial connector, pin 13 to pin 3, and ground to pin 5. Then upload a UART test program to the microcontroller, and see if it works!

EDIT:
Also, check out Admin's Tutorial (http://www.societyofrobots.com/microcontroller_uart.shtml) :D

 -HyperNerd
Title: Re: Cheap computer -> output?
Post by: MaltiK on February 25, 2009, 06:48:40 PM
Look at these:

http://wwwold.ecs.tuwien.ac.at/lehre/Microcontroller/Docs/IOBoards.shtml

It seems that I could use one of them to connect directly as an output...

If not, then can anyone provide a source code... preferably a commented one
Title: Re: Cheap computer -> output?
Post by: Soeren on February 26, 2009, 11:52:20 AM
Hi,


You could use this http://That.Homepage.dk/PDF/DTR_to_Relay.pdf (http://That.Homepage.dk/PDF/DTR_to_Relay.pdf) and then go to beyondlogic.org for a good read.