And that’s a wrap. Well, almost. I need to bump up the amplification on the headlights and decal the model, but other than that, it is finished! The entire point of the exercise was a proof of concept on an accurate modern emergency vehicle lightbar, and boy oh boy did I learn a lot along the way. I’ll list those things after the video.
As the prototype of what is sure to be many incarnations to come, I dub this ’07 Ford Shelby GT500 my ‘Demonstrator‘! Please ignore the 8xAA battery pack on the side. Normally, this car can be powered by a 9V that fits nicely into the engine compartment, but I was plumb out of 9V batteries. Yes, there’s some in the house smoke detectors, but Murphey’s Laws have taught me a thing or two, so I left those 9Vs where they were 🙂 Anyways, using a 8xAA power supply tested the circuitry against a 12V source, so it’s all good! Enjoy:
The lightbar project work continues! All the proper ohm value SMD resistors *finally* arrived in the mail, and a few short evening work sessions later, the resistors are in place, dud LED light modules replaced and leads carefully soldered in… we have an operational Lightbar!
Now, the front 3 Red and 3 Blue are electrically different than the rear 3 Red and 3 Blue, so add in the working center takedown and 2 alley lights, there are 15 independent LED modules on this bar. However, the software that was on the MSP430 I hooked them up to only was written for the front 3 Red and 3 Blue only, so the bar is not flashing at its full potential…. yet!
Here’s a short video that’s a bit out of focus. I didn’t catch the focus issue when I uploaded it because it was well past midnight 🙂 Once I update the software I’ll film a higher quality version.
Between dealing with a terrible manager at work, switching jobs and the family being perpetually sick, all hobby dollars and time were sucked into the void. 🙁 The parts I ordered from http://futurlec.com/ finally arrived recently, so I finished up the initial attempt at building a light bar.
And it was a total failure. The 1206 SMD LEDs weren’t getting good connection and some where blowing out. So I scrapped it and started fresh.
I hit upon a decent manufacturing process and refined it in the build, so the current (2nd) prototype still needs improvement but is infinitely more stable than the first. Solder traces are not very tidy, wire management could be better, etc, etc. But it works and sure looks purty!
Last round of modifications to this project for a while. Rev 2 was pretty good, but the memory limitations of the MSP430G2553 chip posed a challenge: 512 bytes of ram! I was only able to get three flashing sequences plus the logic loops into that little memory. So another rework was needed.
Instead of using a byte broken down into 1bit/7bit status/time chunks, for Rev 3 I went with a hardcoded 50ms time chunk constant and used every bit in each byte as a status flag. Example: 00111100 would tell the logic loop that the first two 50ms steps are ‘OFF’, the next 4 steps are ‘ON’ and the last 2 are ‘OFF’. This allows me to compress 8 steps into one byte… an initial 8x memory efficiency increase.
The trade off to this is that counters like ‘CurrentStep’ are now moved out of the flashing sequence. Which, when you think about it, the notion of which step a sequence is on is not necessarily an attribute of the sequence itself, but rather a bookkeeping value by the logic loop. This increases memory usage however, stealing the thunder of my previous 8x decrease in memory use.
The overall effect is still a large reduction in memory use. Rev 3 ups the number of LEDs controlled from 8 to 11 (3 red, 3 blue, 2 yellow, 1 white takedown light, and 2 headlights.) as well as increasing the flashing sequences from 3 to 10 (Technically 15). The LEDs are also now grouped into 3 groups which allows for changing of the flash sequence on one group without interrupting the sequence of the other groups. Rev 2 had a ‘jitter’ problem when the sequences changed. Barely noticable, I think, but the power of my OCD compelled me to fix it.
The final feature enhancement is the concept of ‘Modes’. Currently, there are only two modes installed: Demo and Random. Demo will iterate through each sequence, spending about 8 seconds on each sequence. Random will pick a sequence at random and spend 2-6 seconds on that sequence. (Note: There is some room for improvement on the random chooser)
Anyways, code and how-to are posted below, so for now here’s a video of what Rev 3 can do:
Spend some time reworking the core code as well as the storage format for the flashing sequence. Turns out that I was spoiled working with the Arduino boards, which has significantly more memory. I am endeavoring to put multiple flashing sequences into one code binary and switch them with a pushbutton attached to a DI pin on the Launchpad. Installed an old copy of Adobe Premiere and started playing with that as well. Here’s the results: