tags:

views:

650

answers:

3

Hi, I need device switch component which an be controlled by code(.net,C# Or vb) ON/OFF state is enough.. i have code knowledge in C#,.net window application, i need to make a switch that can be controlled using code via USB port ... so that using that switch i will turn on/off electrical devices(fan,light) for a specific time interval..For my MINI Project

Note: i need the brief note regarding components needed and how to assemble it.

If you know any link which resembles this type of project pls refer me.

thanks.

A: 

Are you sure you have to do this with the USB port?

You'd need a device that implements a whole USB interface. This isn't as simple as using a line on the COM port (RTS/DSR etc...) or using the parallel port.

A quick search found this...

GrendleM
A: 

You could try something like the Arduino or one of its clones like the Sanguino. It's probably a bit overkill for your project, but they come pre-assembled and have a large support base.

You would also (for any low voltage switching circuit) need some form of relay board to switch electrical appliances that run on mains power. See here for some ideas.

Jacob
+2  A: 

You'll probably want to look into using an FTDI chip for this purpose. They do have a .NET interface available as well as traditional C DLLs.

FTDI offers two types of drivers - one emulates a simple COM port (Virtual COM Port, which is probably enough for you), and the other is more of a direct USB control (D2XX), although it still shows up as a COM port when the USB device is connected.

On the other hand, if you really only need on/off support, you could probably just use the .net serial port drivers for the most basic communication. Of course, the serial port drivers don't let you tie a serial port pin high or low, so you will need some method of reading the data coming from the PC. Many microcontrollers have freely available UART libraries exactly for this purpose, but you will need to also obtain an RS232 level shifting IC for this because the serial port from the PC outputs +/- 6V IIRC (might be +/- 12V), while most microcontrollers run off of and accept signals at 0/5V or 0/3.3V.

Mark Rushakoff
+1 for FTDI chios, I have used them in my project with c# .NET, communication was done via virtual COM port read/write.It works excellent!
Gordon Freeman