0

I have an idea for a game room score board. I would like to turn a light bulb on or off depending on a flag in a database. So let's say I have a column called "out". For out=1, one bulb would be lit, for out=2, two bulbs, etc. Would this be possible? What would I need? Setting up the database and insert the data is no problem.

2
  • Yes, it's possible. To start, you will need a basic understanding of electronics and programming.
    – Phil Frost
    Oct 28, 2014 at 13:17
  • You may want to look into Arduino.
    – root
    Oct 28, 2014 at 13:24

4 Answers 4

1

Conceptually, you'll need the following:

  1. hardware that receives the request and displays the appropriate number of lights
  2. software that turns the retrieved number into a request to hardware
  3. software that polls the database

Considering these in that order:

Hardware interfacing

One of the simplest ways to interface hardware is by using the parallel port (if your computer is so equipped). There are generally 8 or more available outputs which can be independently controlled. Second easiest is a serial port. In either case, you'd need either relays or LED drivers or the equivalent to change from the voltage levels on those interfaces to something that your lights can use.

Software to hardware control

If you can write code in C or C++, you will probably have no trouble writing software on your particular system (Windows, Mac, Linux) to send out a single byte to either a parallel or serial port. Examples abound on the internet. The code could listen on a IP socket for the value to send to the hardware.

Software to poll the database

Generically, this would be a simple database query that would run on a periodic basis of your choosing. You could set it to poll every 60 seconds, for example, fetch the value from the database and then send the value out an IP socket to the listing software mentioned above.

Because your question is quite broad, so is this answer, but if you have specific questions about any part of this, ask another question. Note, though, that Electrical Engineering is concerned primarily with the first two items and not generally with the purely software portions.

2
  • I'd add to hardware interfacing: FTDIchip.com FT232 supports USB bit-banging 8 bits (UM232H for ready-made module). Or FT4232H to bit-bang even more bits.
    – MarkU
    Oct 27, 2014 at 0:14
  • Depending on the software used to insert the data into the database, it would be preferable to not have the client poll continuously, but send a server-client request to update the light bulbs, if that's possible. This would make it react faster and reduce the load.
    – user187676
    Oct 27, 2014 at 0:15
0

This would be simple to do. My suggestion:

1) Instead of using individual lights, use an addressable RGB LED strip. This will be a lot easier than driving individual lights, and will make it straightforward to get different colors and dimming. You can put Ping-Pong balls over the leds if you want a different look.

2) I'd use an arduino to handling driving the LED strip. It can connect to your PC over a serial port, and a program on the PC can simply do the database query, grab the value, and send it over the serial port to the arduino. The arduino reads the value and sends it out to the LED strip.

You will find a lot of stuff at adafruit.com, including tutorials that will help you out.

0

This sounds like the perfect application for a raspberry pi. It is a mini linux computer that is more than capable of hosting software that can query a database. (And host one). It also has GPIO pins that can control stuff.

http://www.raspberrypi.org/

You need to decide what on the type of light before you can find out how to turn it on.

If it is an LED you may need an LED driver, if it is an 240V light bulb you may need a relay, etc.

Other variants that you may want to look at include Beagle Bone, ODROID and don't forget to just google "mini linux computer" for more options.

0

My minimum effort solution was to use a disco light (that uses the DMX protocol) and an 'electric imp' which presents a web api for you to hook into.

It can also talk to leds or neopixels as an alternative.

Here is a video of a simple demonstration I created.

https://www.youtube.com/watch?v=RxttrlHJntw&list=UU2vDg0Cv64FmkmjJYpVnWuQ

You must log in to answer this question.