Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A program to control lamps

  1. Aug 11, 2015 #1
    A friend asked me to write him a program that contorls a lamp with USB or LAN cable
    I've seen people using printer cables with Matlab to control an LED matrix ..
    I use c# as programming language if there is any way or any command that i can use to control it with windows form application or console application ..
     
  2. jcsd
  3. Aug 11, 2015 #2

    berkeman

    User Avatar

    Staff: Mentor

    How are you going to physically control the lamp? Do you have a lamp that has a relay inside it that can be controlled via USB or something? Or do you have a dim-able lamp with some intelligent interface?
     
  4. Aug 11, 2015 #3
    He said he just needed a program for one lamp ... He might use transistor to control a higher current
     
  5. Aug 11, 2015 #4

    berkeman

    User Avatar

    Staff: Mentor

    Well, you can write your program to control a USB widget that has a relay in it that has the safety approvals and male and female AC Mains outlets on it. That would be one way to control a lamp.

    You might try Googling Computer Controlled Lamp to see what-all is available hardware-wise... :smile:
     
  6. Aug 11, 2015 #5

    Nidum

    User Avatar
    Science Advisor
    Gold Member

  7. Aug 11, 2015 #6
    I dont want to use micro controllers or something like that
    All i want to do is to set one port of my USB or LAN to 1 or 0 whenever i want to
    I've looked in many websites i couldnt find an easy solution
     
  8. Aug 11, 2015 #7

    berkeman

    User Avatar

    Staff: Mentor

    I used Google Images to search USB Controlled Power Outlet, and got lots of good hits. Click into a few of the images to see what-all is available. I even see a WiFi controlled outlet, which would make for a fun project... :smile:

    https://www.google.com/search?site=..._ODW7E#tbm=isch&q=usb+controlled+power+outlet

    .
     
  9. Aug 11, 2015 #8
    Thanks ..
    The more im thinking about it the more idiotic my friends idea sounds ... I can easily controll 10 or 15 electric devices with a micro controller why should i bother myself turning one on and off with my usb o_O
     
  10. Aug 11, 2015 #9

    jedishrfu

    Staff: Mentor

    some USB sticks have LED indicators showing when the stick being written or read so by simply having it plugged into to your USB port and writing to it you will turn on the indicator.

    Other possibilities are to use a Raspberry PI kit where you can wire an LED to a breadboard and then control it via the PI.

    A third possibility is to buy a IOIO card that can be plugged into an Android device and programmed via Android SDK+Processing or the standard Android IDE to activate the LED connected to the IOIO card.

    There is also probably a way to directly hardwire an LED to a USB cable and via the USB power feature light it up but I think you'll need some additional components.

    http://www.instructables.com/id/How-to-light-a-LED-or-regular-light-with-USB/

    http://www.instructables.com/id/The-USB-powered-LED-CD-lamp/
     
  11. Aug 12, 2015 #10
    The first method seems possible and convenient .. I can use 2 diodes to get a positive current from any of two commanding ports which is 1 and then control the higher current with a transistor
    Now how can i keep using a usp port with a programming language like c# ?
     
    Last edited: Aug 12, 2015
  12. Aug 12, 2015 #11

    jedishrfu

    Staff: Mentor

  13. Aug 12, 2015 #12

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A program to control lamps
  1. Explain this program. (Replies: 3)

  2. Programming languages (Replies: 16)

  3. HMI programming (Replies: 1)

Loading...