Building Your Own Glowing Cyber-Balls?
krezel asks: "So I've been drooling over the Ambient Orb, a cool little gadget 'glowing ball' that you changes colors based the 'health' of things you specify. It can do stuff like fade from red to yellow to green as your stock portfolio improves. However, being a poor college student I can't afford its $200 price tag. I've found lots of sources for super bright multi-color LED's. Cast a couple of them in some translucent resin, hook them up to a power source, and you've got yourself a cheap glowing ball. But I've yet to find any good information on how to build hardware that will let me control relays for devices like this through my serial or parallel port. Basically I'm looking for a cheap way to build a board that will let me control 4-8 relays (for each color) over my serial port, and some info on how to write the software for it. This could be a very cool project, and I plan on making the plans available, and the code Open Source, when I'm done with it. Any ideas?"
Usually I try to avoid being afflicted by glowing cyber balls, myself.
You know you need to get laid if "Hey baby, wanna cyber?" gets your balls glowing...
IBM had PL/1, with syntax worse than JOSS,
And everywhere the language went, it was a total loss...
Looks like we have a new candidate for this old poll.
Don't you want more than 8 colors? If you use relays, you can only turn on or off each of the red/green/blue colors. But if you vary the current through each led, or vary the duty cycle by pulsing the leds quickly, then you can get more colors (like 24 bit color!).
--Tim
Karma be damned, this is easily one of the dumbest things I have ever seen. It's a ball. That glows. The glow shifts, for example, on the rise or fall of the stock market.
Cliff, give me $200 dollars. You can call me whenever you want. Sometimes I'll hum. Sometimes I'll hum louder.
My
Limekiller
the Ambient Orb runs off a wireless network... no computer needed, and you can control it from anywhere in the world (theoretically). To manage that, you'd have to build an 802.11b -> relay interface, at least - if not a cellular one.
Now, assuming you don't want to muck about with that (and who does), your best bet would be to not use relays in the first place - they're loud, slow, and not gradual. Use a Basic Stamp from Parallax and write some code to output a PWM (Pulse Width Modulated) voltage to three different pins - one for each color. (Chances are you'll be using either one 4-pin, 3 color LED or 3 leds (red, green, blue). Infrared or UV leds could be interesting, but aren't recommended...) Then you can either leave the BASIC stamp connected to your serial port and controlled via DEBUG or SERIN (IIRC) commands from your host computer (and write some corresponding code for the host), or you can leave it standing alone and interface to it using any one of the who-knows-how-many add-on boards Parallax sells. (you might want to check out the Communications page - that modem looks like a good thing to try)
This
A solid state relay (S101S05v) is not a mechanical switch.
So I can easily keep track of the ever-changing terrorism threat level.
Having done some large castings in casting resin (clear and with opaque or translucent dyes), I can tell you that it's not all that simple to just cast a ball that size either. The casting material is going to be expensive to begin with. And if you don't get the hardner mix ratio just right, that stuff it going to crack and craze like crazy (split a few "paper-weights" in half). It gives off heat (from the chemical reaction as it "cures") which can damage really thick objects, like a 6 inch ball. I'd be willing to bet that what they have is not "hobbiest grade" casting material. It's more likely commercial grade plexiglass type material with a translucent dye added. It might not even be chemically cured like epoxy resins but may be cure thermally or by UV light (former - likely, later - possible but highly unlikely). Plexiglass resins become soft and pliable as you warm them (within reason - moderately high heat burns them easily) but casting resin does not - it cracks and crazes and shatters. The dye would be similar to the casting dyes you would get at a hobby shop. You MIGHT be able to cast a ball that size, if you are lucky, in casting resin but keep it away from large temperature changes and bright sunlight (which damages through both large temperature gradients and UV breakdown damage). You may find that this isn't a cost-effective "do it yourself project" after all.
But seriously, I've always wanted something like this for work. A simple status indicator whether the cluster of machines I'm responsible for is Working Fine (green), Having Issues (yellow), or Completely B0rked (red).
Currently, I keep a persistent browser window open to a simple web-based script that checks on the status of everything and sets its background to one of those colors based on what it finds (it's quite a bit more verbose than just that should something be wrong, but that's not the point). This is fine and dandy for my use, but for the sake of being interupted during an emergency...
It'd be really cool (and actually useful) to have a separate orb that glows the same color... so the next time my PHB runs in to tell me I forgot my TPS report cover sheet.. er.. to tell me that he's noticed a problem with the site, he'll first see the big red glow and realize I'm already aware of it.
(that, and when I'm deep into a Quake match, and can't see the little window...)
I pity the fool touches my cyberballs!
Of course controlling 8 relays or LEDs with the parallel port is much simpler.
Since the parallel port output is basically just TTL levels, just buffer it through a 74LS244 or something similar and use that to drive the LEDs directly. You can directly control each of the 8 data pins on a parallel port by writing directly to the base I/O port (i.e. port 0x378 is the default for LPT1). It's easiest to use inverting output with TTL driving LEDs.
Something like the following circuit:
D0 ---|>---/\/\/\---| D0 = parallel port data pin 0
/\/\/\ is resistor
|> is a buffer (i.e. 74LS244)
| (+5) is a 5 volt power source separate from the parallel port.
Make sure that the ground pin of the parallel port is connected to the ground of your circuit. For the 5 volts, a 7805 is a simple solution when using a separate DC power supply.
All of the above listed parts should be available at your local Radio Crap.
When D0 is 0 (low) current will flow from the 5 volt supply, through the LED and resistor and from the buffer to ground. When D0 is 1 (high), no current will flow.
When choosing a resistor, take into account the voltage drop across the LED. Blue LED's typically have a higher voltage drop than red or green. Red LEDs are typically around 0.7 volts whereas blue can be upwards of 3v.
Also make sure that whatever buffer you use can sink the appropriate amount of current. Most LEDs typically will take up to 15-20ma of current. It might also make sense to use an inverter instead of a buffer since the above circuit will cause a LED to light when the data bit is 0. a 74LS04 is a cheap easy-to-use inverter chip that is readily available.
With 20ma of current, choose a resistor based on the voltage.
Use the basic equation, V = I*R, where V is voltage in volts, I is current (in amps) and R is resistance in Ohms.
For example, for a red LED with 20 ma with a 5 volt source use:
R = (5 - 0.7) / 0.020 = 215 ohms. Since resistors come in standard values, choose the next highest value, i.e. 220 Ohms.
For blue, with a 3.6 volt drop you would use
R = (5 - 3.6) / 0.020 = 70 ohms. The closest match is 68 ohms, but it's usually best to error on the side of caution so choose the next larger value.
One thing you do not want to do is use the parallel port to drive LEDs or relays directly as you could possibly damage it. TTL outputs typically are not designed to output much current and are typically better at sinking current than sourcing it.
Note that I'm no expert on this and I'm sure you'll see better solutions listed here.
-Aaron
This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
Quick answer: combine RJ45 web server with serial relay driver and presto!
... google for it. They have all sorts of nice features (current limit, fault detection, cascadability and are controlable through the parallel port (you have to bitbang the data and clock bits). The webserver above has 3 general purpose I/Os - enough to control a relay driver.
There are lots of these serial relay drivers
But, you probablly want an actual A/D converter (preferably with a current output) or a digital potentiometer. There are lots of mfgs of these products, but Maxim is pretty liberal with samples (plus they have some neat innovative products!)
HIV Crosses Species Barrier... into Muppets
One thing to remember though is that you're not allowed access to the ports under Win32 NT-family kernels except through a Ring 0 driver. That can get a little ugly.
Google for "Beyond Logic" and you'll find a site that lays out more info on the legacy ports and on making peripherals for them (and for USB) than you could read in a day.
(Mind, it's pretty easy to make a serial one too. There's a UART called the CDP6402 that's specifically designed to run without a master uC; just add an osc to get 4x the desired baud rate and use an octal latch to maintain the output with an RC circuit to generate the rcv ack pulse, and you're set.)
All you need are the following:
1) 25 PIN MALE DB Connector (like would plug into the parallel port) - OR, probably easier, grab like a 6' or longer 25pin Parallel Printer or extension cable and chomp the end which doesn't plug into the computer off.
2) 8 superbright leds.
3) 8 10K resistors.
4) 8 2N2222 or other NPN transistors (Just go to radio shack and get a bulk package of "NPN switchint ransistors")
5) 8 "smaller" resistors. Like roughly 500 ohm, but be prepared to experiment with the value. Lower value=brighter, but if you go too low you will burn out the LED. There *IS* a formula for the smallest permitted value. I won't go into that here.
6) Perfboard to put it all on
7) 9 or 12V DC wall-mount supply (or similar).
A little background:
The parallel port on the PC has 8 outputs, on pins 2-9 of the 25 pin connector. The ground for these are on pins 18-25.
You can technically get away with just wiring the led directly to an output port, then to a resistor which then connects to the ground. Google for "parallel port led"
However, it is likely that you will need more current than the parallel port will provide. For this you can use a transistor to act as a solid state switch.
Here's a description of the schematic:
For each output pin:
1) Wire the output pin on the parallel port to one side of a 10K resistor.
2) Wire the other side of the 10K resistor to the base pin on the transistor.
3) Wire the emitter pin on the transistor to circuit ground.
4) Wire from the collector pin on the tranmitter to the pin closest to the "flat edge" on the LED.
5) Connect the other LED pin to the "smaller value" resistor.
6) Connect the remaining pin on the "smaller" value resistor to the + wire of the power supply.
ALSO, do the following:
1) Connect the ground pins (18-25) of the parallel port connector to the "circuit ground" mentioned above.
2) Connect the "-" wire of the power supply to the "circuit ground".
You can test this before plugging into the computer by plugging the DC adapter in and then jumpering between the + wire of the power supply and each output pin on the cable you are going to plug into the computer. The corresponding LED should light.
I'd recommend just doing the first led first to make sure everything works.
NOTE: YOU CAN BLOW OUT THE COMPUTER PORT IF YOU DO THIS WRONG. I HAVE NOT CHECKED THE ABOVE DESCRIPTION SO IT MIGHT BE WRONG AND MAY CAUSE THIS EVEN IF YOU FOLLOW THE INSTRUCTIONS EXACTLY.
If you need more LEDS on a given output (like 2 or 3 to get enough light), you can just connect a LED/resistor pair in parallel with the existing one (all of the LEDS are connected to the transistor, all of the resistors are connected to the + power supply connection, and each led is connected to it's own resistor).
You basically drive this by outputting data to the parallel port. You output a single byte at a time - the most recent byte is what the leds are set to on or off.
If you want to vary the brightness of the LED's you can actually do it by turning them on and off quickly in software. A simple timing loop which have the leds on 50% of the time would result in the leds being 50% dimmer than if they were just left on. Of course you have to do this fast enough so they don't "flicker" or blink.
Lotsa links here...
First of all, the 2002 Burning Man project I did that involved a couple hundred RGB LEDs spinning in a persistence-of-vision-based nighttime animated display. Here is the best picture of it. This is the page about the development details.
The LEDs I used were manufactured by Kingbright. The model I used, the LF819EMBGMBC, is big (10mm) and relatively bright for an RGB LED. I couldn't find any U.S. retailers that actually told the truth about whether they stocked them, so I ended up buying 400 directly from Kingbright for I think a little more than $2.50 each. I still have a few left.
Atmel AVR microcontrollers are just a few bucks each, easily programmable with the STK-500 programmer, also cheap at around $80. I used the ATMega8, which was more than sufficient for my needs. I imagine the original Slashdotter could use one of the ATTiny MCUs, since it really needs only 3 or 4 I/O lines (fewer depending on how many helper circuits you decide to use).
The boards were manufactured by PCBExpress and I was very happy with them. The CAD/CAM software was Eagle, which except for some crashing/redrawing bugs was really amazing. The version I used was free. I tried to buy it but CadSoft has (had?) a fairly crazy pricing scheme that actually left you worse off in terms of acceptable usage if you paid them money than if you used the free version.
The best part of using the Atmel MCU was that GCC can cross-compile for it. So you're basically writing regular old C code but it runs on a little tiny piece of silicon. You'll want to subscribe to the quite active avr-gcc mailing list. Save every message from Marek Michalkiewicz; in my opinion he's the god of GCC-for-AVR development.
download a set of drivers called "PortTalk", they work very well for allowing programs to access the parallel port under nt/2k/xp and they include quite a bit of sample code for doing it also.
In terms of hardware, you'd need the jack for the port, the power cord, a PIC chip, a transistor for each color, and a bunch of LEDs/resistors of each color. Easy stuff really. Let me know what you come up with. If you use USB, I'd be especially interested, as I have a Mac (no serial port). Good luck!
I hereby place the above post in the public domain.
I read the topic, and after reading the beginning "krezel says: So I've been drooling..." I didn't know if I should continue. :-O
Beware: In C++, your friends can see your privates!
I've actually done this with eight LEDs (four red, four green) and the parallel port on my firewall machine. I did it mostly because it had a cool smoked perspex cover that slides over the drive bays, and the LEDs shining through it looks pretty cool. Especially when you make them flash and do stuff. Have a look at some pics.
In this case, the LEDs have their anodes connected together, and brought back to the 5v rail, and their cathodes connected to the parallel port pins through 220 ohm resistors. You then bring the appropriate pin low to turn the LED on. There's a good reason for doing it "backwards" - the gates driving the parallel port can sink more current than they can source. That is to say, the transistor pulling the pin to ground is "stronger" than the one pulling it to +5v, so it's more suitable for turning on an LED. You could use two resistors and a small transistor per pin, too. If you like.
Actually you can get 12 "output" channels out of a parallel interface if you really want to... the 8 data channels, plus the "strobe", "autofeed", "init", and "select-in" channels (pins 1, 14, 16, 17, but 1, 14, and 17 are "inverted" watch out).
c uit.jpg
I use the parallel port to drive three stepper motors. Pretty easy to do, and your circuit would be just as easy. You could actually use the same circuit, but simply change the +12V input to the correct voltage, and hook the LED's in where the motor phases would be.
See my crude circuit diagram here:
www.lenticularshareware.com/downloads/stepper_cir
FYI, you can also get 4 "input" channels from the parallel port at the same time, I use them for limit switches to set the position of the steppers to "home". (see diagram)
MadCow.
I used to have a sig, but I set it free and it never came back.