Blu-clear Briefcase to Light Up the Stage!

by pulcher in Circuits > Microcontrollers

295 Views, 1 Favorites, 0 Comments

Blu-clear Briefcase to Light Up the Stage!

briefcase-on-stage.jpg
IMG_20221007_223905590_HDR.jpg
IMG_20221007_223921452.jpg
IMG_20221003_212053527_HDR.jpg
IMG_20221003_203946992_HDR.jpg

I wanted a way to more dramatically present the winners their awards at the end of the various events in which I am involved. Here is the scene:

  • Walk out on the stage carrying the briefcase
  • Make a announcement that we have the winners
  • Place the briefcase on a table
  • The lights of the entire venue off
  • Open the briefcase to have lights emanating from the inside as it opens.


Supplies

1 - briefcase that you are ok with messing up

3 - Flexible 8x32 NeoPixel RGB LED Matrix PID: 2294

1- Header Kit for Feather - 12-pin and 16-pin Female Header Set PID: 2886

1 - Adafruit Feather M0 Bluefruit LE PID: 2995

4 - 4 pin JST SM Plug + Receptacle Cable Set PID: 578

4 - UBEC DC/DC Step-Down (Buck) Converter - 5V @ 3A output PID: 1385

1 - Half Sized Premium Breadboard - 400 Tie Points PID: 64

1 - Magnetic contact switch (door sensor) PID: 375

1 - Illuminated Toggle Switch with Cover - Red PID: 3218

1 - Adafruit Perma-Proto Half-sized Breadboard PCB - Single PID: 1609

1- Spektrum RC S155 G2 AC Smart Charger (2-4S/5A/55W)

1- Spektrum RC 2S Smart LiPo Hard Case 50C Battery Pack w/IC5 Connector (7.4V/5000mAh

1 - Spektrum RC IC5 4" Device Connector

1 - Lipo Battery Tester Monitor Low Voltage Buzzer Alarm

1 - LANGIR Lever Wire Connectors Set with 28-12 AWG, 60 PCS 2/3/5 Port Electrical Nut Connectors Assortment Kit for Quick Wiring <= You really on need a couple of theses. This was the cheapest set I could find on Amazon.

A bunch of VELCRO Brand Mounting Squares

A bunch of Adhesive Cable Ties. Something like these on Amazon.com: Honbay 100 Pieces Adhesive Cable Clips Drop Clamp Cable Tie Holder for Car GPS,Office and Home Cords and Wires Organization : Electronics

Enough Cable Ties(tie-wraps) to secure all the wiring

Vinyl Electrical tape for covering the exposed connections that may touch the case

Various sizes of shrink tube

Enough 16 AWG, 22 AWG, size wires for the various hookups.

Solder Iron and other assorted tools to put all of this together.

Prepare the Briefcase

IMG_20221009_115528478.jpg
IMG_20221009_114720132_HDR.jpg

The briefcase will need to be modified to mount the external on/off switch. In this case there was small hole on the front of the case where a clasp was riveted on. Used that hole as a pilot hole for the 1/2" drill bit.

I removed the foam padding from a couple of locations so that the either fit better into the space, or that they were more secure.

The Battery and the Magnetic contact are the examples of where the inner padding was removed.


Attach All the Parts to the Briefcase

IMG_20221003_203753965.jpg
IMG_20221003_203729319.jpg
IMG_20221009_114734066.jpg
IMG_20221009_114810142_HDR.jpg
IMG_20221009_115528478.jpg

Make liberal use of the velcro squares to attack all the parts. In the pictures you can see how to attach the perma-proto board, the LED panels, the battery monitor.

I used a big strip to secure the battery as it was a bit heavier, and I want to make sure that it would stay in place.

I also used the vinyl electrical tape to cover the exposed solder connections.

After some testing with the magnetic contact switch, the lower half needed to be better secured. I used some 5 minute epoxy and it seems to be holding. The top half is attached with velcro like the rest of the components.

Wire Everything Up

blu-clear_briefcase_bb.png
IMG_20221003_203950817_HDR.jpg
IMG_20221003_204058579_HDR.jpg
IMG_20221003_203945176_HDR.jpg
IMG_20221003_212108544.jpg
IMG_20221003_212128303_HDR.jpg

Use the lever nuts and the quick disconnects to plug everything together. The lever nuts are held on like most of the other components, with velcro.

Then secure the wiring with the adhesive cable ties. Put them where you feel that they need to be to hold the wiring in a safe place.

Color code the quick connects so that you can know which ones go where during reassembly.

Install the Mobile App

control-pad.jpg
projects_ColorPicker.jpg

You should now install an app for your mobile device. There is a guide for Bluefruit LE Connect for iOS and Android located on the Adafruit site.

After following that site, you will be able to connect and control the briefcase once the firmware has been uploaded.

For the control panel the following are the mapped functions:

  1. Run the breathing animation. <== this is the default.
  2. Run the color wipe animation
  3. Run the panel color wipe animation
  4. Run the theater chase animation


  • Up Arrow: Increase brightness
  • Down Arrow Decrease brightness
  • Left Arrow Stop all animation. The last frame of the animation will be left showing.

For the color picker:

There only two colors allowed at a time. The defaults are Blue and White.

Every time you pick a color, the firmware will push the primary color to the secondary color.

To completely replace the default colors, you will need to select 2 new colors.

Upload the Sketch

There is a github repository that contains all of this information located here:


The source code can be downloaded at nuclear-briefcase/src/blu-clear-briefcase at main · pulcher/nuclear-briefcase · GitHub.

Some of the relevant bits of the source code are below:

This is the main loop. It does the follow:

  • Check to see if there is input from the bluetooth device, with a timeout.
  • Check if the Lid is open. If it is, then run the animations. If it is no, then clear the LED panel and don't run animations.
void loop(void)
{
/* Wait for new data to arrive */
uint8_t len = readPacket(&ble, BCB_READPACKET_TIMEOUT);


handleBluToothPacket(&ble, len);


if (digitalRead(BCB_LID_PIN)) {
runAnimation();
isPanelCleared = false;
} else {
if (!isPanelCleared) {
delay(50);


// empty the lights so they dont burn in power with the lid closed.
panel.clear();
panel.show();
}


Serial.println("not gonna run an animation! Punk!");
isPanelCleared = true;
}
}


This is the how we determine which animation to execute:

We update the brightness level at the start of every animation execution.

void runAnimation()
{
panel.setBrightness(currentBrightness);

switch (currentAnimation) {
case BCB_ANIMATION_BREATHING:
gaussianWaveBreathing();
return;
case BCB_ANIMATION_COLOR_WIPE:
colorWipe();
return;
case BCB_ANIMATION_PANEL_WIPE:
panelWipe();
return;
case BCB_ANIMATION_THEATER:
theaterChase();
return;
default:
return;
}
}


The default animation is the "Breathing" animation.

I used information on how to make this animation at Arduino Breathing LED Functions — Maker Portal (makersportal.com).

void gaussianWaveBreathing()
{
float gamma = 0.20; // affects the width of peak (more or less darkness)
float beta = 0.5; // shifts the gaussian to be symmetric


for (int color = 0; color < 2; color++)
{
uint32_t currentColor = color % 2 ? color1 : color2;


for (int ii = 0; ii < smoothness_pts; ii++)
{
float pwm_val = BCB_MAX_BRIGHT * (exp(-(pow(((ii / smoothness_pts) - beta) / gamma, 2.0)) / 2.0));
if (pwm_val < BCB_MIN_BRIGHT)
{
pwm_val = BCB_MIN_BRIGHT;
}


// Serial.println(int(pwm_val));
panel.setBrightness(pwm_val);


for (int i = 0; i < BCB_NUM_LEDS; i++)
{
panel.setPixelColor(i, currentColor);
}


panel.show();
}
}
}


The other animations were fairly simple and algorithmic, so I am not including them here.

Compile and upload the sketch as you would any other arduino application.

Fire It Up

After loading in the sketch and ensuring all the electrical are safe

Make sure the battery is fully charged and connect up the battery monitor, then connect the battery.

If all goes well and the lid open, the breathing animation should start up.

At any time after the power on, you should see the briefcase show up in the Bluetooth connections.

Here is a short demonstration that begins with checking the magnetic lid switch and ends with connecting the mobile app to the briefcase and controlling it: (239) Blu-clear briefcase demonstration. - YouTube