Custom Display Case Lighting

In my last post I briefly mentioned I’d been working on a little project for myself. Well I’m at a point I’m quite happy to share the results with everyone. Basically I’ve setup some controllable display case lighting using RGB LEDs. I can control their behaviour, colours etc using a C# GUI on my laptop which communicates with an mbed microcontroller over USB. Read on if you want to find out more about the system.

The idea

Display case lighting is something I’d wanted to do for a while now because it allows me to put this ‘to be’ Electrical & Electronics degree to use and also gives me a system I can use myself without being “graded” on it. Getting the correct components together was a bit of a pain what with everything shrinking in size. I also didn’t want to be using any solder, which makes the task of getting what you need even harder (wires for example). Luckily I’d been introduced to the mbed (an ARM based microcontroller that allows for quick prototyping) through my university and stumbled across the Shiftbrite RGB LED online. I gathered together all the bit’n’bobs I’d be needing for this project and set to work. This is the general plan I was working towards:

Techno-mumbo-jumbo below if you are interested or just skip this section. Check out the linked websites if you want to find out more.

Mbed:

Homepage – http://mbed.org/

The mbed itself is a neat little microcontroller which provides a huge range of features and data buses making it ideal for rapid prototyping. The mbed can be programmed without downloading any software packages because the required C/C++ compiler is hosted online and accessed through a web browser. This has it’s disadvantages (some very big ones like no debugger!) but for small projects like this the online compilier is good enough. It also makes transferring code between machines much easier. The mbed website also allows you to publish code for others to use and search through other peoples submissions, which again helps speed up development times. Need servo motor control? just search Servo and import the program.

In order to interface with other languages, such as C#, the mbed also has a set of RPC libraries. This allows you to remotely control the mbed without having to re-download a new C program every time. The disadvantage of this however is communication is rather slow, so sending huge streams of data up and down the USB cable isn’t a clever idea. Finding the correct balance between code on the mbed and the data sent over RPC is the key to creating responsive systems.

Shiftbrite:

Product Page – http://docs.macetech.com/doku.php/shiftbrite

Shiftbrites are easy to use RGB LEDs with a shift register style interface. Data is clocked into the shiftbrite module serially which allows for the changing of LED colours and other features. The advantage of using Shiftbrites is most of the components needed to get one up and running are all built into the module (current controls, voltage regulators etc). This makes interfacing with digital systems very easy for the analogue inept engineers such as myself :lol:. You can also easily chain together multiple shiftbrite units and still have full control over individual units.

C# GUI

I’ll skip all the coding stuff. Basically I’ve setup a system that allows me to control the mbed over USB using C#. I’ve got a piece of C code in the mbed which performs the RGB LED control; and on the host computer I’ve got some C# code which provides a GUI to change various parameters. The result; control of a lighting system from a host PC.

Here’s a snapshot of my current GUI setup. RGB values are set as 10-bit numbers (0 – 1023), Current control can be set, and a little fading algorithm can be started. You can also select RGB colours from the standard windows color dialogue (that pop-up box in Paint where you choose more colours) and values are entered for your selected colour.

Display case wiring setup:

Ontop of the display case is wiring access, a breadboard, power supply and the mbed. You’ll notice the mbed is within a little motherboard, it’s not needed, I’m just using it because I have easy access to pins via screw terminals. This board is from my university and hopefully I’ll be buying one to keep once I’ve graduated.

Check out my ub0r wiring skillz. Top shelf:

I thought it would be a good idea to wrap the glass shelves in paper so if I decide to change things I can simply rip it off without damaging the glass. You’re going to spend most of your time looking at the contents from a distance and the top of shelf as opposed to the underside anyway. Second shelf:

The wiring snakes the underside of each shelf. Third shelf:

Fourth shelf:

The Results!

So how does it look when the power is on?

Red (low current setting):

Orange:

Magenta:

Green:

Cyan:

Blue:

Some Videos

The “fading” algorithm I mentioned previously will transition from one colour to another random colour infinitely. It looks quite nice, but static pictures don’t capture it unfortunately. I do however have this little test video you might want to check out.

And finally a video showing the system in operation (recorded at 720p, so watch at that res to see the GUI pop-up dialogues). It shows changing the colours from my laptop and a snippet of the fading algorithm at work. I’m a chicken and didn’t appear in the video or speak, my accent sounds embarrassingly more Scottish than when I hear myself so I cut it :oops:.

Future Development

In terms of future developments I hope to be able to set different shelves to different colours, since currently when I set a colour it goes to all shelves. I had a piece of code for this, but it didn’t quite turn out as expected due to unseen problems on the analogue side of things. I also want to make it so the user can specify colour combinations to fade between as opposed to transitioning between random ones. I’ve got the mbed code for this, it’s just a case of working it into the C# GUI somehow.

Overall I’m quite happy with the results. I’ve still got some other features I’d like to add in and some weird behaviours to sort out (mostly analogue type problems, urgh). Sure my wiring could be neater and glass wrapping could have been made to look better on the underside of each shelf. Now that I know the system actually works I could improve on these areas.

So, what do you think? Also if you want any further information about mbed, shiftbrites or specifically this lighting system let me know in the comments. I’ve published some Shiftbrite code on the mbed website, but I’ve yet to publish this system and the GUI.

Posted on 02/04/2011, in Random Rambling. Bookmark the permalink. 15 Comments.

  1. Wow, looks like you’ve take the concept of lighting for display shelves to a much more higher level. Which really makes me wanting to get one as my collection is already overcrowding my table… ^^

    • I used to use a frosted glass shelving unit for my figures, but it wasn’t very big and obscured them. Getting a Detolf display case has given me more space and looks great. Also keeps the dust off them.

  2. WOW…. thats some wicked stuff you have there… can already imagine what one can do, changing the lighting color to suit the character which you will be displaying.

    Do you need to constantly plug the microchip into a USB port for it to be powered?

    • Thanks ^^. Being able to customise the lighting for each shelf is great. I could potentially have different fading patterns and speeds for each shelf as well since it’s all controlled by software.

      You can power the microcontroller off the USB port, or you can use an external power supply (4.5-9V).

      Once a signal has been sent to a shiftbrite, so long as you maintain a constant and stable power it will output the colour value sent. So you could set the system up such that you don’t need to keep the microcontroller powered.

      For this system I’m having to refresh the colour and current values sent out by the microcontroller to stop them drifting (my own fault), which as a result the microcontroller is always powered. In fact using some non-volatile storeage might be a good idea… Thanks ^^

  3. the figures deserve to get some nice light =D
    That looks impressive!Im totally unskilled with such diy electronical things, so thats nearly all I can say about it ^^

    I didn’t know you had this sexy Yoko in your collection
    ^o^

    • Yeah, they really deserved to get some light on them. They’ve been hiding in the dark for too long :D.

      Amiami Yoko is really nice; she caught my eye when amiami first opened their English site. Although I look now back at the pictures I took of her and cringe. I should do a brief re-shoot of some of my figures both for practice and fun.

  4. I think it looks cool, it must be great to have so much control over the lighting for your figures. Now I kinda wish I paid attention during my electrical engineering classes. It wasn’t my engineering specialization so I really didn’t care for it at the time.

    • Having full control is really cool. It opens up lots of possibilities. The only thing stopping you is your own imagination (and the effects of sending high frequency signals down a length of wire, yay).

      I like the embedded software/systems & image/signal processing areas of my course which isn’t really taught outside the electronic engineering discipline. I don’t really like the analogue side of things (resistors, ohms laws etc) which tends to be taught alongside the other disciplines as an extra. At least that’s how it’s been at our uni.

  5. This is a really really cool idea. That display case is rocking! It’s like a little mini-show in each level. I can also just imagine those girls dancing in a club. ^ ^

    Anyway, impressive impressive work!!

    • Thanks ^^.

      Yes, the LEDs don’t have to be used for display case lighting. You could easily use them as part of a scene or for photography.

  6. That is really cool; I’ve kinda wanted to do something in a similar vein with my Detolf lights but I’ve never gotten around to it. I had this idea for connecting the lights to a photodetector so that they’ll flip on whenever I turn on my room lights. I don’t have any experience with embedded stuff, though, and I’m terrible with analog. My school barely had any classes that taught embedded hardware; most of the department’s resources went towards communications, optics, and device physics, it seemed.

    • Ah yes, it’s getting these projects started that’s a pain. I’ve got the ideas, but not the equipment (and sometimes motivation).

      If you’re interested in looking to start using an embedded microcontroller I’d highly recommend the mbed, it’s ideal for learning, although the online compiler can be restricting at times. The mbed takes care of a lot of the low level stuff for you, such as setting up buses or moving data around (no assembly language, yay). Reading and writing pins is simple and they have a huge website with example code to get you started. If you know C/C++ syntax you should be fine with programming it.

      Our uni sounds similar at PhD level – comms, optics & MEMS. Image Processing is also quite big here. The good thing about our undergraduate courses though is we get a broad spectrum of topics – so bits of analogue, power, embedded, digital, signal processing etc.

  7. Holy crap.. this is freakin awesome!
    but it seems very confusing even after reading what to do. whats great is that now you can change to what color you want ..where as for peeps like me..only one color -.-

    • I guess a good place to start would be just messing around with an mbed microcontroller – or any microcontroller really. It’ll give you some exposure to embedded software programming and an idea of how to go about building such a system.

      You could also go for a pre-build lighting system, although from what I’ve seen they’re quite expensive.

  8. Very cool and unique RGB-LED lighting set up! Thanks for all the pictures and tutorial instructions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 34 other followers

%d bloggers like this: