Slashdot Mirror


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?"

18 of 453 comments (clear)

  1. parallel vs. serial by Anonymous Coward · · Score: 3, Insightful

    I would use the parallel. You get 8 pins out instead of just the one. Sure, you can play games with the serial, but... parallel would be easier.

    Depending on how many LED's per color and whether you are using transistors or relays to drive the circuit, you may want to use an external power source and use op amps to convert your parallel control to a stronger signal for the LEDs.

    Anyway, just my idea.

    Sure, I could probably design the circuit now (Since I am learning so I can build my own 160-6m SSB/CW rig), but I don't want to. Sorry.

    1. Re:parallel vs. serial by Grab · · Score: 3, Insightful

      Yeah, except that using USB requires a processor on the "stone" to handle stuff. Choice for electronics newbie:-

      1) USB interface. Add a microcontroller, learn to program microcontroller (maybe 2-3 months to learn, if you're a competent coder already), get the programming hardware ($20 if you make it yourself, $100 if you buy it), connect LEDs and resistors to microcontroller.

      2) Parallel port interface. Use a wall-wart power supply, connect LEDs and resistors directly to parallel power, all set up in a day at most.

      What would you rather pick? :-)

      Grab.

    2. Re:parallel vs. serial by harrkev · · Score: 3, Insightful
      Ya know if you were to make it work via USB it coudl grab its power off the bus as well.

      Since the original post mentioned "relays," it is likely to assume that this person is not extremely experienced in do-it-yourself electronics.

      USB is NOT for the faint of heart. While the hardware for USB is easy with some processors from Cypress, the software for USB is quite complex. Using an old-fashioned RS-232 port is easy compared to USB stuff. Definately not for beginners. I have a master's degree in electrical engineering, but I would have problems getting the USB software to work.

      My recomendation: use the parallel port, and create your own D/A converter. You get 8 data bits, plus one or two handshaking bits.

      Assuming that you are only using 8 bits, I would assign 3 to green, 3 to red, and 2 to blue. Then, for each channel (R,G, or B), wire up one bit to the color channel of the LED through a resistor (10 ohms might be a good starting point). The next bit for that color would have double the resistance (20 ohms), and the next bit would have double the last one again (40 ohms).

      One thing to keep in mind with parallel port stuff is that you CANNOT use this method easily with any NT-kernal OS (this may include Win XP) because of the way that the hardware layer is abstracted. This method is guaranteed to work with DOS, Win3.1, Win 9X, and probably Win ME.

      The web is full of information on parallel port interfacing. A control program would be almost trivial to write in C.

      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
    3. Re:parallel vs. serial by ncc74656 · · Score: 2, Insightful
      1) USB interface. Add a microcontroller, learn to program microcontroller (maybe 2-3 months to learn, if you're a competent coder already), get the programming hardware ($20 if you make it yourself, $100 if you buy it), connect LEDs and resistors to microcontroller.

      You might want to have a look at this page. In particular, you might find the FT245BM interesting...it supports a "bit-bang" mode that allows you to read/write bits on an 8-bit parallel port. I've designed it into a pan/tilt interface for some security cameras we've obtained that supports up to 8 cameras. That interface uses this chip, a couple of 8-to-1 muxes, and some passive components...no microcontroller is needed. Connecting to the parallel port would still be easier/cheaper/faster, but the hardware and software exist to make USB much less hairy than it initially appears. (Two FT245BMs cost less than $20, shipped from Australia to the US in about a week. There is a distributor in New York, but that company has a $30 minimum order.)

      --
      20 January 2017: the End of an Error.
  2. You don't want relays by dozer · · Score: 2, Insightful

    A relay is a mechanical switch. The constant clacking would drive you nuts (though, that would also be a good indication of the activity of your stocks...)

    Google knows all. Click on the first link. Or any of the others.

  3. Re:Better Investment by smylie · · Score: 3, Insightful

    If you read the post, you'll see the whole point of this was to avoid spending the $200.
    Instead he wants to spend a few dollars on LEDs and a few more on resin and cables. I'd imagine this costing somewhere less than $30.

    Now if you were offering to be a hummer for $29.99, that would be a different story . . .

  4. Use parallel port or microcontroller by AaronW · · Score: 5, Insightful
    One easy method of doing what you describe is with some simple microcontrollers. Years ago I worked with Motorola 68HC11s using a serial interface. If you want to control LEDs, you should be able to hook them up directly without requiring relays. You could even adjust brightness by pulsing them quickly in software. Many modern microcontrollers have built-in serial port support as well as embedded flash and RAM.

    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 a buffer (i.e. 74LS244)
    /\/\/\ is resistor
    | (+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.
  5. Lots of solutions... by morcheeba · · Score: 4, Insightful

    Quick answer: combine RJ45 web server with serial relay driver and presto!

    There are lots of these serial relay drivers ... 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.

    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!)

  6. two similar DIY projects with software by studboy · · Score: 2, Insightful
    In these two projects, you hook up wire and sme stuff to the serial port. They both include circuit diagrams, theory (for modifications), and Linux software:

    - two LEDs and a switch

    - TTY control: 7 buttons and 3 leds.

    I built a simpler version of #2 last week, and it was a lot of fun and very easy!
  7. Portable? by supabeast! · · Score: 3, Insightful

    How about designing a portable version? I would gladly pony up a pile on cash for an orb that fits in my pocket, allowing me to track money, family, friends, and the health of my networks just by looking at the colors!

    This thing this where cool tech should be going. Make it small and wireless and you have a killer app.

  8. Interesting Project by grimsweep · · Score: 2, Insightful
    I hope this has been tried (as I'd love to get ahold of one):

    Take one of these balls in a smaller form and place it within your computer. Have it's color be entirely temperature based.

    As the heat rises, it shifts from an electric blue to a horrifying shade of red.

    ...Yeah, sure, it'd probably do more harm than good, but if I have to lose another T-Bird, I want it go out in style.

  9. Re:Better Investment by dubl-u · · Score: 4, Insightful

    There are a ton of uses for it.

    Note that people happily pay $30-50 for a little blinking light that tells them when they have voicemail. They'll pay a lot more than that for extra gauges on a car dash. And companies have paid millions for fancy "war room" conference rooms that continuously display important business data.

    The basic prinicple is that people have to deal with a lot of invisible data, and if you can make it visible, it's easier for people to manage. Take a look, for example, at the many designs for in-house power meters. The idea is that if people have a better idea of how much electricity they're using, they'll waste less of it.

    Personally, I would be tempted to hook it up so that it went slowly from green to red whenever I got behind on my email, a visible reminder of the people I'm ignoring when I get absorbed in a project. Or since I'm a freelancer, it'd be interesting to hook it up to a moving average of billable hours, so that I have a quick objective reference to check when I wonder whether a sunny day is better spent biking than coding.

    Or at a company, I'd love to set it up so that it got redder and redder when people put in too much overtime on a project. Or you could hook it up so that it responded to an anonymous web poll on morale. And then perhaps another one tied to the number of open bugs. Or perhaps percentage of code covered by test suites.

    I'd agree that $200 is too steep. But for $50, I could find a lot of uses for these!

  10. Re:That's missing a key point... by DarkZero · · Score: 2, Insightful

    That's missing a key point... 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.

    If you already have a computer, the wireless network aspect of this seems completely pointless. The damn thing already needs to be plugged into the wall, so is it really that big a deal if it also has to be plugged into the ethernet/serial/parallel port about a foot away from the electrical socket? It's not like it's a battery operated cloak hooked into the signal from the Atomic Clock or some sort of little wireless communication device like a Hiptop. It's already anchored, so adding another anchor isn't going to make it any less mobile.

  11. Hack this: prebuilt color-changing LED balls by kriegsman · · Score: 2, Insightful

    Color Kinetics (aka CK Sauce) makes a line of color-changing LED balls, wands, lights, etc.. They have several "modes", and presumably could be hacked to do whatever you wanted. Some of them run on batteries, some run on AC current, and all are cool. Chiasso carries their stuff. Fun.

    -Mark

  12. Be careful of patents... by slipandfall · · Score: 2, Insightful

    It sounds like a cool project but companies like Color Kinetics and others have patents in the color changing LED arena that you should be aware of before you go too far down this road.

  13. Re:That's missing a key point... by cybermace5 · · Score: 2, Insightful

    $5 or less plus a handful of components vs. $50-$70 for something slower and not as flexible....

    I'd like to stay on the cheaper side.

    --
    ...
  14. Fine, you don't want SOLID STATE relays by dozer · · Score: 2, Insightful

    A solid state relay (S101S05v) is not a mechanical switch.

    Who brings up solid state relays when talking about hooking to a parallel port? You've never done this, have you? Solid state relays are too expensive, have high hold currents and forward voltage drops, burn quiescent power, and are very large in comparison. In other words, they are simply wrong for this application.

    But, you're right, they are not mechanical switches.

  15. Transistorphobia by Jennifer+E.+Elaan · · Score: 2, Insightful
    Why are so many "geeks" nowadays afraid of a 2N2222? I built a circuit to do this with my C128's User Port when I was 12. Transistors aren't all that frightening.

    When working with a +-5V logic signal like the parport, just put some 1K input resistors on some 2N2222 or BC547's, and hook the LED with a 220 ohm resistor into the collector path.

    If the LED's require more current (like a blue LED does) recalculate the 220 ohm by using ohms law of (5V - 0.7V [transistor drop] - (whatever the LED forward voltage is listed at)) / (LED typical forward current). Simple really. For something more robust, you could even use a current-source circuit, but these can be a little tricky for a beginner.