Question:
i have a project that i should control the LED conected in serial port of a desktop computer tru website?
arvin o
2008-07-05 09:46:11 UTC
I have a project guys pls help me.. i should Control the OFF and On of a LED that is connected in the serial port of the desktop computer and should be able to controll and access it tru other computer using tru website. software to controll the LED should be able to acces to other computer using the internet.

pls help me guys how can i do this.
pls suggest what should i need to learn to do this.. any sugestion pls... thnx..
godbless
Three answers:
ANDRE R
2008-07-05 10:04:43 UTC
A few things are missing from your question for me to make a final suggestion though I can point to you in the right direction.



You should take this project and split it in 3 steps. First step is to figure out how to get the LED to turn on and off. Once you can write a program that does that, you can easily call that program through CGI, PERL, PHP, ASP... you get the idea...



Assuming you're using Linux, writing data to the serial port is pretty straightforward. Poke around in the man pages and search the web for RS232 to get more info about serial communications.



If you're using windows, I suggest you check out the codeproject (http://codeproject.com) to see if they have any examples of writing to the serial port.



Finally, once you get the LED going, you need to figure out what you're going to use for your web interface. There are dozens of solutions ranging from simple script-type languages like PERL to complex applications written in C. Again, you pick which technology you want to use, and a couple quick web searches will get you your answers.



Hope this helps you out! If you need more help, please elaborate which platform (windows, *nix) and which languages you would prefer to write this in, and I'll give you more precise advice.



Oh, one more thing: Make sure you have a resistor in series with that LED or that it's rated to handle the power coming out of the serial port! Most serial ports run at 12V/10mA which can easily fry an LED if you're not careful...



Good luck

a.
oshell
2016-10-07 04:16:43 UTC
The parallel port is plenty extra easy. Over a serial port, you will prefer basically a microcontroller with I/O code. An Arduino or different less difficult microcontroller can try this for you (you could would desire to code it, if there is not any longer code already made and public).
Trev
2008-07-05 10:37:07 UTC
I only know how to do this with the parallel port, sorry



see this page to control parallel port over web

http://www.epanorama.net/circuits/parallel_output.html#webcontrol

Files here:

http://www.epanorama.net/circuits/lptoutphp.zip



Not what you asked for but this is how I did it.





I also wrote a simple web server in VB to serve a controlling page and access the port

Here is one of my interfaces to the VB .exe server/port controller

http://dumdum.mark.googlepages.com/led.html

View Source, save & change the IP it calls

Download my ledcgi.exe that it calls here:

http://dumdum.mark.googlepages.com/ledcgi.exe

stick it in a cgi-bin in a Windows box

You'll need to install inpout32.dll (see below)

and regsvr32 it



Ports in XP are blocked, so you will need this driver to access the p. port -- inpout32.dll

http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html



It's much easier to use the parallel port than serial port!





Once you can control the port over the web you can hack remote controllers and control toys that way. I had a 8 legged infra-red controlled spider walking around viewed by a webcam -totally pointless -just like turning LEDS on or off -but loads of fun. Where there are buttons to press you just hard wire them to the port.



Connect power relays and you can turn anything on or off.



Here is a program that enables you to test your LEDS in the parallel port:

http://www.geocities.com/lalimparallel/index.html



!!!!!! !!!!!! !!!!! !!!!! !!!!!

N.B. I used opto-isolators( http://en.wikipedia.org/wiki/Opto-isolator ) to ensure that I did not fry the parallel port card by trying to draw too much current. It's the card you need to worry about, not the things plugged in.

But for LEDS you can just use the current limiting resistors as described in first answer. Full details are in my links above.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...