-
Question re: interfacing between computer & pic controlled light source.
Hey guys.
After realizing my post into a specialty group probably wouldn't get a response (considering the last post was in 2008), I remembered the resources I have here!
My situation is that I am trying to control a light source that uses a PIC interface. The "control panel" will essentially be a web page, inside a browser, running a locally stored file/web page. The computer will be connected to the light source (or intermediary circuits) via USB (or USB to Serial adapter, preferably just USB). I am trying to understand what would be the best setup and which parts are needed. This includes possibly the software and/or programming language that runs on Windows XP, the circuits to translate serial commands into PIC language and anything else. This is what I know about the PIC board:
1) The PIC board has four inputs, three digital and one analog.
a) Two (0,1) binary signals from the Mode switch whose 0-1 combination represent the binary code for the switch position.
b) An analog voltage which varies between 0 & 5 volts and represents the position of the Phase potentiometer.
Any advice would be greatly appreciated in understanding what would be needed to make this happen. Of course, like others, I am looking for a low-cost, reliable and more-so simple/efficient solution.
Many thanks in advance!
mados123
-
Hi,
Can you describe why you are wanting to do this? Is it a school project or..?
Just getting to the basics, a computer controlled light interface to the controls you describe can be done pretty simply, just using a parallel port or USB to parallel port. Use the parallel interface control bits to control the two binary signals and the 8 data bits in a resistor ladder to produce the dimming value. The parallel bits can be set using inpout32.dll and for your web interface some php or whatever your scripting preference is code, with an intermediary exe or maybe activex (never used it) program.
But, assuming you can program a PIC, you can have the pic SERVE a simple web page itself and be connected to the computer via a network. This would have the benefit of low power consumption and always-on capability, plus control flexibility. The code for PIC http service is available on the web. This is if you can re-program the PIC entirely, and modify the circuit extensively, and are somewhat of an embedded geek.
-
Here's a possible solution to your question -
A company called Lantronix makes a cute little part called Xport that's an embedded device server.
An Xport allows you to save a set of web pages onto the device, and using the magic of java, those web pages can access the serial port on the Xport.
The nice thing about this is that anything that has a web browser that supports java (mac/PC/smart phone) can view the web pages on the xport and then control your light source without having to have any software installed on the the controlling computer.
So the setup might be:
1/The web pages are uploaded and stored on the Xport.
2/The serial port on the Xport is connected to the serial port on the PIC.
3/ The 'client' computer logs onto the xport and displays the stored web pages.
4/The java embedded into the web pages will send out data to the serial port as the user adjusts sliders /clicks buttons on the web page .
5/The pic will then interpret this data and then control your light source.
On the plus side - this method will allow control over the internet, and there's also a WIFI version called the wiport for wireless control
.
On the down side , this will require quite a bit of java programming in addition to the pic programming side of the project
.
There's a few application notes on how to do this on the lantronix website, and there's other examples if you do a google search...
If that's all to complex , you can also use this device as a transparent "virtual" serial port over a network.
Barney.
Last edited by fuzcub; 04-06-2009 at 02:17.
Reason: Details, details...
-
Little help from the programmers?
Andrew, Barney;
I'm glad you both replied to this thread. I can tell you that this is absolutely *not* a class project.
Adam (that is, Mados123 - one of the other "Adams") is working on an enhancement for an existing illumination product. Can't say a lot about it, but I can tell you that it's not for a laser projector, and it's not going to compete with anyone here.
Adam has been working on this for quite some time, and he's experimented with several different approaches. He called me over the weekend to discuss this new idea, but I was busy at work and missed his call. I have to admit that this current idea is *way* over my head though. Hopefully some of the wiser members here can point him in the right direction. I should mention that reliability is very important with this project... No unexpected (or should I say un-commanded) behavior can be tolerated.
Adam
-
Adam - You blew my cover!
Thanks Adam for the boost and thanks Andrew and Barney for your input! And I thought the school project question was for a student discount
I do respect the hard work others have put into their projects and if there is a solution that exists like the requested, I would be more than happy to integrate it with full recognition and provide b2b.
Both of the proposed solutions look very interesting and I will investigate further. The Xport solutions looks quite sophisticated and flexible whereas the parallel port one looks the least costly and I guess less complex. As Adam mentioned, any advice from programmers would be greatly appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules