Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Control Hardware through Software

Control Hardware through Software

Scheduled Pinned Locked Moved C#
tutorialcsharphardwaredata-structuresregex
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thund3rstruck
    wrote on last edited by
    #1

    Hi guys, I'm trying to do a very simple project where I can turn a light on and off via a software component. For example, when a mail message is received in a critical queue a light mounted on the ceiling blinks on and off in a certain pattern. It sounds so easy but I have no idea where to start. I'm not sure how I can connect a tangible object with physical mass (Light fixture) to a logical object such as software (PC). Can anyone recommend a kit or something like that where I could have a USB or Serial port connected to a circuit board which then in turn connects to a light switch or something to that effect? I think codeproject has some articles on how to talk to a serial port in c#. Thanks

    L A 2 Replies Last reply
    0
    • T thund3rstruck

      Hi guys, I'm trying to do a very simple project where I can turn a light on and off via a software component. For example, when a mail message is received in a critical queue a light mounted on the ceiling blinks on and off in a certain pattern. It sounds so easy but I have no idea where to start. I'm not sure how I can connect a tangible object with physical mass (Light fixture) to a logical object such as software (PC). Can anyone recommend a kit or something like that where I could have a USB or Serial port connected to a circuit board which then in turn connects to a light switch or something to that effect? I think codeproject has some articles on how to talk to a serial port in c#. Thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I think, what you need is : http://www.codeproject.com/KB/cs/csppleds.aspx[^] It used LPT...

      T 1 Reply Last reply
      0
      • L Lost User

        I think, what you need is : http://www.codeproject.com/KB/cs/csppleds.aspx[^] It used LPT...

        T Offline
        T Offline
        thund3rstruck
        wrote on last edited by
        #3

        Holy Cow! Thanks!

        L 1 Reply Last reply
        0
        • T thund3rstruck

          Holy Cow! Thanks!

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Since most PCs nowadays don't have a parallel port any more, it may be useful to know you can do similar things with a serial port; on a typical DB9 connector there are some 5 so called control lines; some are inputs to the PC, others are outputs. And you can observe the inputs and control the outputs using the SerialPort class, once you have opened the appropriate port. You will find several relevant articles on CP about this. BTW: if you are not really familiar with electronics, I strongly recommend you experiment with a USB-to-serial cable; that way, when you damage the goods, it is just that cable that has to be replaced, not your I/O card or mother board. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Voting for dummies? No thanks. X|


          T 1 Reply Last reply
          0
          • L Luc Pattyn

            Since most PCs nowadays don't have a parallel port any more, it may be useful to know you can do similar things with a serial port; on a typical DB9 connector there are some 5 so called control lines; some are inputs to the PC, others are outputs. And you can observe the inputs and control the outputs using the SerialPort class, once you have opened the appropriate port. You will find several relevant articles on CP about this. BTW: if you are not really familiar with electronics, I strongly recommend you experiment with a USB-to-serial cable; that way, when you damage the goods, it is just that cable that has to be replaced, not your I/O card or mother board. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Voting for dummies? No thanks. X|


            T Offline
            T Offline
            thund3rstruck
            wrote on last edited by
            #5

            Ah.. great advise. Any chance there is an aftermarket kit that I could purchase on the hardware side that could demonstrate how this 120v lamp connects to a circuit board and then from the circuit board to the serial/parallel/usb port on the PC?

            L 1 Reply Last reply
            0
            • T thund3rstruck

              Hi guys, I'm trying to do a very simple project where I can turn a light on and off via a software component. For example, when a mail message is received in a critical queue a light mounted on the ceiling blinks on and off in a certain pattern. It sounds so easy but I have no idea where to start. I'm not sure how I can connect a tangible object with physical mass (Light fixture) to a logical object such as software (PC). Can anyone recommend a kit or something like that where I could have a USB or Serial port connected to a circuit board which then in turn connects to a light switch or something to that effect? I think codeproject has some articles on how to talk to a serial port in c#. Thanks

              A Offline
              A Offline
              Alex UEA
              wrote on last edited by
              #6

              For USB based control and measurement of external devices I'm a big fan of the miniLAB 1008[^] 2 10 bit analog outputs 4 12 bit analog inputs or 8 11 bit single ended 28 dio Slight overkill for just turning one device on and off (for which you would need to use the miniLAB to switch a relay), but should you progress to analog contol and measurement or decide to control several devices it's pretty cheap and very easy to set up and use. No doubt there are loads of other similar bits of kit - I've just had a lot of success with these.

              1 Reply Last reply
              0
              • T thund3rstruck

                Ah.. great advise. Any chance there is an aftermarket kit that I could purchase on the hardware side that could demonstrate how this 120v lamp connects to a circuit board and then from the circuit board to the serial/parallel/usb port on the PC?

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Hi, don't know what is available in your area. the link Alex provided also has "high voltage" stuff, things that would control 120/230V equipment. DIY stuff would be cheaper, provided you get it right from the beginning... :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                Voting for dummies? No thanks. X|


                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups