Society of Robots - Robot Forum
Electronics => Electronics => Topic started 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.
-
do you mean that you want to drive a solenoid with a max232?
-
yes, is this possible, and does a springed dc solenoid need pwm?
-
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.
-
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
-
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)
-
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.
-
Alright, but how do I invoke/call it? What command do I use? Since its not programmable, how does it work?
-
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.
-
Alright, but my question is how do I call upon the high/low of the transistor? Do I use hyperterminal, what?
-
are you using a microcontroller?
-
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
-
Ahhh ok so I guess that was my real question... thanks a bunch guys
-
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.
-
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?
-
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
-
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
-
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.