Saturday, May 9, 2009

Required Code in language C for driving a hardware ckt. connected through serial or parllel port?

can someboday give me programme code in Language C and the ckt. diagram of optocouplar driven realy ckt. that i can run by using C programming?





Actually, i want to operate a relay with the help of C programming language , now the signal through the parllel or serial port will not be enough to drive the relay , so i need an electronic circuit that will accept the signal from the parllel or serial port and them amplify it or process it and make the signal so strong , so that it can further operate the relay. this electronic circuit will contain optocouplar IC in oder to have isolation between relay circuit and Computer,


So can somebody provide me some link or can email me this circuit diagram and programming Language C code for operating this circuit?

Required Code in language C for driving a hardware ckt. connected through serial or parllel port?
The simplest thing is to use simple driving CCT, using Transistor to drive relay, and don't forget to put a diode to kill the magnetic feedback of the relay coil (free wheeling diode).


You may search the internet for such CCT.





The programming is the funniest part, where you play with the logic binary to control the relay(s)





regards,


:)
Reply:Its so simple its not funny





you use a 9 pin comm port


send a DTR signal to it


a single transistor inverts the logic and


provides the current for the relay coil





I did that over 20 years ago when I invented


the cash drawer that opened by program command


on an 8 bit Atari computer . Later modified it so


it would work on Novell Network Stations


so Video stores could use them.


Added a modem port DTR command to the end of the printer routine. after reciept printed drawer opened





Find the Line feed pin in your centronics port and use the


printer line feed command to change state of pin


will go high for a short duration . feed the high into a NPN


transistor with a good voltage supply at collector


coil voltage will appear at emitter until base goes low


No comments:

Post a Comment