Maker.io main logo

3D Printed Flora Band

2021-02-16 | By Adafruit Industries

License: See Original Project Wearables FLORA

Courtesy of Adafruit

Guide by Ruiz Brothers

Overview

Keep that New Year’s resolution of getting fit by staying safe with a neopixel motion activated running band powered by Flora, Adafruit's wearables electronics platform.

This is the activity monitor you'll want to wear outside and at the dance club!

 

Parts & Supplies

parts_1

Tools

floraband_2

floraband_3

3D Printing

printing_4

Flexible Filament

NinjaFlex is a specially formulated thermoplastic elastomer (TPE) that produces flexible prints with elastic properties. This material is both strong and smooth. The filament properties enable you to create printable parts for wearable electronics projects. Flexible filament works with most FD 3D printers that use 1.75mm or 3mm filament.

Get Ninja Flex

Flora Band

The band is designed to be worn on your wrist or fore arm. It's a classic 6-hole adjustment band that has pins that snap into the holes. A cover fits on the bottom of the circuit and your wrist secures the components in place.

Table_1

Download STL

Printing Techniques

Build Plate Preparations

There's a great video tutorial by Dr. Henry Thomas who demonstrations a great technique for preparing acrylic build plates for awesome prints. Wipe down the plate with a paper towel lightly dabbed in acetone. Use another paper towel and apply a tiny dab of olive oil. Wipe down the plate so a small film of oil is applied, this will allow the parts to come off the plate easier.

Live Level

We recommend going raft-less for each piece because it will have the best quality result. Each piece will require a well leveled platform. We tend to "live level" our prints, meaning we adjust the build plates thumb screws while the print is laying down filament. This way we can make adjustments directly and improve the leveling by seeing how the extruders are laying down the first layer onto the build plate. We recommend watching the first layer so that you get a more successful print. If you see the layers aren't sticking or getting knocked off, you can always cancel print, peel it off and try again.

Circuit Diagram

circuit_5

Prototyping

Use alligator clips to test the circuit before soldering the components. Let’s start with getting the accelerometer to light up the neopixel ring. We can use USB to power the FLORA after we have our components clipped together.

Accelerometer

  • GND to GND
  • SCL to SCL
  • 3V to 3.3V
  • SDA to SDA

NeoPixel Ring

  • IN to D10
  • GND to GND
  • Vcc to VBATT

Arduino Sketch

Copy the code below into your Adafruit Arduino IDE and click Upload. The colors can be specified in the myFavoriteColors array, and the sensitivity to motion can be defined with MOVE_THRESHOLD.

Download: file

Copy Code
#include <Wire.h>
#include <Adafruit_LSM303.h>
#include <Adafruit_NeoPixel.h>

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, 10, NEO_GRB + NEO_KHZ800);
Adafruit_LSM303 lsm;

// Here is where you can put in your favorite colors that will appear!
// just add new {nnn, nnn, nnn}, lines. They will be picked out randomly
// R G B
uint8_t myFavoriteColors[][3] = {{200, 0, 200}, // purple
{0, 117, 255}, // blue
{200, 200, 200}, // white
};
// don't edit the line below
#define FAVCOLORS sizeof(myFavoriteColors) / 3

// mess with this number to adjust TWINklitude :)
// lower number = more sensitive
#define MOVE_THRESHOLD 300

void setup()
{
Serial.begin(9600);

// Try to initialise and warn if we couldn't detect the chip
if (!lsm.begin())
{
Serial.println("Oops ... unable to initialize the LSM303. Check your wiring!");
while (1);
}
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}

void loop()
{
// Take a reading of accellerometer data
lsm.read();
Serial.print("Accel X: "); Serial.print(lsm.accelData.x); Serial.print(" ");
Serial.print("Y: "); Serial.print(lsm.accelData.y); Serial.print(" ");
Serial.print("Z: "); Serial.print(lsm.accelData.z); Serial.print(" ");

// Get the magnitude (length) of the 3 axis vector
// http://en.wikipedia.org/wiki/Euclidean_vector#Length
double storedVector = lsm.accelData.x*lsm.accelData.x;
storedVector += lsm.accelData.y*lsm.accelData.y;
storedVector += lsm.accelData.z*lsm.accelData.z;
storedVector = sqrt(storedVector);
Serial.print("Len: "); Serial.println(storedVector);

// wait a bit
delay(100);

// get new data!
lsm.read();
double newVector = lsm.accelData.x*lsm.accelData.x;
newVector += lsm.accelData.y*lsm.accelData.y;
newVector += lsm.accelData.z*lsm.accelData.z;
newVector = sqrt(newVector);
Serial.print("New Len: "); Serial.println(newVector);

// are we moving
if (abs(newVector - storedVector) > MOVE_THRESHOLD) {
Serial.println("Twinkle!");
flashRandom(5, 1); // first number is 'wait' delay, shorter num == shorter twinkle
flashRandom(5, 3); // second number is how many neopixels to simultaneously light up
flashRandom(5, 2);
}
}

void flashRandom(int wait, uint8_t howmany) {

for(uint16_t i=0; i<howmany; i++) {
// pick a random favorite color!
int c = random(FAVCOLORS);
int red = myFavoriteColors[c][0];
int green = myFavoriteColors[c][1];
int blue = myFavoriteColors[c][2];

// get a random pixel from the list
int j = random(strip.numPixels());
//Serial.print("Lighting up "); Serial.println(j);

// now we will 'fade' it in 5 steps
for (int x=0; x < 5; x++) {
int r = red * (x+1); r /= 5;
int g = green * (x+1); g /= 5;
int b = blue * (x+1); b /= 5;

strip.setPixelColor(j, strip.Color(r, g, b));
strip.show();
delay(wait);
}
// & fade out in 5 steps
for (int x=5; x >= 0; x--) {
int r = red * x; r /= 5;
int g = green * x; g /= 5;
int b = blue * x; b /= 5;

strip.setPixelColor(j, strip.Color(r, g, b));
strip.show();
delay(wait);
}
}
// LEDs will be off when done (they are faded to 0)
}

Flora+NeoPixel Assembly

Flora Band Pin Out Diagram

Each components pin is marked as reference points for making soldering process easier.

pinout_6

Mark Pinouts

Use a thin sharpie marker to make the reference dots. Follow the circuit diagram for the pin layout.

layout_7

Make Holes

Use a fairly large needle to puncture the marked reference points. Stretch them out so that the 30 gauge wire can thread through the body of the band.

holes_8

Thread Wires

Use lengthy stripes of 30 gauge wire wrap to thread through the marked reference points. Pull the wires through so they are about half-way through the body of the band.

wires_9

Tinning Flora Pads

It's best to tin the pads of the Flora with solder so that you can easily solder the wire once threaded to the body of the band.

Thread Flora

Align up the USB port of the flora with the cut out on the inside of the body. Thread the appropriate wire to the pads of the Flora.

flora_10

Solder Flora

Strip the tips of the wires. Bend the striped tips of the wire on the Flora down so that they're secure while applying solder to the pads.

solder_11

Secure Flora

Position flora into place by pressing down inside the body. It needs to be nice and flush with the band, so the components are tightly packaged.

Thread NeoPixel Ring

Thread the appropriate wires to the NeoPixel ring and position it so its flush with the body of the band.

Neopixel_12

Secure NeoPixel Ring

Once the wires are threaded, bend down the wires so that the NeoPixel ring is secure while soldering.

secure_13

Trim Wiring

Pull the access wire that's soldered on the NeoPixel so that it's flush to the band and trim the wire.

trim_14

Solder Flora Wiring

Solder the 30 gauge wire to the appropriate pins on the NeoPixel Ring.

solderwire_15

Trim NeoPixel Wiring

Trim the access wire using scissors or diagonal wire cutters.

accesswire_16

The solder connections would be trimmed and clean for a nice look.

connectionstrim_17

Accelerometer Assembly

Position Accelerometer

Thread the 30 gauge wire through the appreciate pins on the LSM303 accelerometer sensor so it’s in the center and flush with the body of the band.

thread_18

Lock it Down

Bend down the wiring on the LSM303 so its tightly secure into place.

bend_19

Solder LSM303

Strip the wiring on the accelerometer and bend down the tips to secure the wires. Solder the pins to make the connections solid.

strip_20

Clean & Trim Wiring

Trim down the access wire from the accelerometer so it’s nice and clean.

clean_21

Power Circuit

Prep the JST Extension cable

Measure the length of the cable from the JST Connector to the USB port.

power_22

Build Switch

Cut the positive (Red) cable in half and solder to one of the pins on the slide switch. Remember to slide a small piece of heat shrink to seal the connections.

build_23

Battery Cable size

Shorten the battery cable by carefully cutting the wires and then heat shrinking each wire connection.

battery_24

Use a third hand tool to help keep the wires aligned, solder and heat shrink the wires together.

hand_24

hand_25

Reroute Power

For a compact circuit we can reroute the power by soldering the JST Extension cable to the on-board battery connection.

reroute_26

Make sure to leave the onboard power to on.

onboard_27

Pop the slide switch through the cavity for a tight fit.

switch_28

Carefully position the battery on top of the circuit.

position_29

Finalize Band

Align the back cover to the cut out of the slide switch.

align_30

Press down on the edges of cover to protect the circuit.

snap_32

The USB cut out allows you to easily plug into to the flora to reprogram sketches.

USB_33

The pins on the band snap in to securely hold the body together.

band_34

complete_35

制造商零件编号 659
FLORA ELECTRONIC PLATFORM V3
Adafruit Industries LLC
制造商零件编号 1463
ADDRESS LED RING SERIAL RGB
Adafruit Industries LLC
制造商零件编号 1131
JST-PH BATTERY EXT CABLE
Adafruit Industries LLC
制造商零件编号 1247
FLORA ACCEL/COMPASS SENS LSM303
Adafruit Industries LLC
制造商零件编号 291
MAGNIFIER STAND 2.5" 4X
Adafruit Industries LLC
制造商零件编号 615
NEEDLE SET SIZE 3-9 20PC
Adafruit Industries LLC
制造商零件编号 1446
WIRE WRAP THIN PROTOTYPING & REP
Adafruit Industries LLC
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum