0

FLORAbrella Build - Help
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

FLORAbrella Build - Help

by eppic on Mon Nov 05, 2018 4:27 pm

So I'm working on the FLORAbrella build from the site...ordered everything I needed and started work on it over the weekend. I've run into a few snags, however, and was hoping someone could help...
Capture.JPG
Image of what I purchased.
Capture.JPG (109.16 KiB) Viewed 197 times


I purchased:
- 2 power supplies (3.7v 2500mAh)
- Adafruit NeoPixel Digital RGB LED Strip - White 30 LED 5m - WHITE
- FLORA - Wearable electronic platform: Arduino-compatible - v3
- Flora Color Sensor with White Illumination LED - TCS34725
- Adafruit Micro Lipo - USB LiIon/LiPoly charger - v1

I was able to get most of the code into the FLORA and run the test routine...worked fine.

Here are my snags:

1) Neither battery seems to power the FLORA when fully charged (to the green light coming on level)...it will only work when connected to the computer via USB or to an external charger via USB. So this begs the question...can I run this off of an external charger if I can't get the lithium ion batteries to work? I'd prefer to get them going, but I have a 20,000mAh charger that would work nicely if this is the case. I just need to make sure the voltage, power supplied, etc. won't damage anything in the system.

2) I installed the switch as described in the tutorial between Ground and D10...if I hold the button down, it will light up (when connected to USB...still not with the lithium batteries), but it won't stay on. Unless I misunderstood the tutorial, I should be able to hit the button to turn on and then keep hitting it to switch through modes...is this not the case?

3) The color sensor doesn't seem to do anything...its LED comes on, but it never does the 3 second flash like it's testing anything and the color of the LED's never changes. I'm wondering if this is an issue with the Arduino code because when I try to load the code I get the error: 'Adafruit_TCS34725.h: No such file or directory' pops up.

4) When I release the switch and the colors stop moving in the LEDs, I can still see a faint red glow in many of the LED's that doesn't go away until I completely remove the power source. What would be causing this?

This is all I have so far, but they're all substantially hindering my progress...any help/direction would be appreciated as I'm trying to finish the project in the next 3 days.

Thanks!

David

eppic
 
Posts: 4
Joined: Mon Nov 05, 2018 3:51 pm

Re: FLORAbrella Build - Help

by adafruit_support_mike on Tue Nov 06, 2018 12:50 am

1) Check the Flora's power switch to make sure it's in the ON position. If it's OFF, the board won't take power from its battery jack or pads.

2) For that project, the Flora starts by reading the color sensor. The first time you push the button, it goes into the display modes, then cycles through the display modes as you continue to push the button.

3) The error message is saying you need to install the Adafruit_TCS34725 support library:

https://github.com/adafruit/Adafruit_TCS34725

That's probably one of the biggest problems right now.

4) I'd guess that's related to the problems with the color sensor. Try installing the library and getting that code to buid/upload/run and see if the problem continues.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Re: FLORAbrella Build - Help

by eppic on Tue Nov 06, 2018 3:02 pm

Okay I worked through some of it last night...I did install that library as you mentioned after a few trial and errors...the push button now does cycle the color sensor instead of just being on when I hold it.

The 'on switch' was definitely what was stopping the battery from pushing juice...I've been trying to figure out the math...to run that LED strip of lights (30/m @ 5 meters), I would need what?

if a 1 meter strip with 60 lights at 60 mA is 3600 mA (3.6 A max)...does that equate to 1 meter with 30 lights at 60 mA is 1800 mA... x 5 meters is 9000 mA so 9 A max?

I'm trying to determine how large of a mAh battery I would need to run this 5m strip of lights for a number of hours at full power. I'd like to power it for around 6 hours, but I'm unfamiliar with how the length of time relates to the voltage or amps needed. Can you help or point me to where I can find the math?

Soldering these tiny wires to the tiny connections is also proving difficult...very tedious...is there an easier way to do it to avoid overlap of the solder? A clip connection perhaps?

eppic
 
Posts: 4
Joined: Mon Nov 05, 2018 3:51 pm

Re: FLORAbrella Build - Help

by adafruit_support_mike on Wed Nov 07, 2018 12:41 am

You're right that each NeoPixel can use up to 60mA, and that the worst-case estimate for current load on 5m of 30-pixel/meter strip is 9A. You'll only hit that limit if all the pixels are 100% white, which the Florabrella project doesn't do.

The maximum brightness in the code is about 75% of the maximum value, and in most cases only two LEDs will be lit at any time. In practice, the maximum current will probably be around 2A. We know the 2500mAh LiPo listed in the project tutorial works.

I'm afraid there's no substitute for soldering the connections to the NeoPixel strips.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Re: FLORAbrella Build - Help

by eppic on Wed Nov 07, 2018 1:23 am

Thank you Mike...based on those calculations, can you help me determine the amount of time one of these 2500mAh lipos will last in this configuration?

Also...I know I'm using the code specific to the FLORAbrella project, but are there other codes that would work as well? I'm having trouble finding any.

eppic
 
Posts: 4
Joined: Mon Nov 05, 2018 3:51 pm

Re: FLORAbrella Build - Help

by adafruit_support_mike on Thu Nov 08, 2018 12:33 am

Pretty much any code that controls NeoPixels will work. As far as the hardware is concerned, it's just a microcontroller talking to a NeoPixel strip.

Battery life depends heavily on how often the LEDs are lit and how long they stay on, so it's kind of like asking how long $2500 will last on a vacation.. the answer for Vegas is probably different from the answer for a back-country hike through Yellowstone.

A 2500mAh LiPo has enough stored energy to keep all three LEDs in a single NeoPixel running continuously for about 40 hours. You'd use the same amount of energy keeping 40 NeoPixels lit at 100% for an hour. Running the same 40 NeoPixels at a 50% duty cycle would make the battery last 2 hours.. the LEDs would spend 1 hour actually lit and 1 hour dark, but would alternate every few microseconds. To the human eye it will look like the pixels are lit for 2 hours, just slightly dimmer than the ones running at a 100% duty cycle.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Re: FLORAbrella Build - Help

by eppic on Thu Nov 08, 2018 3:30 am

Makes sense.

I've been experimenting with the code side of things today...this may be getting away from the original question a bit, but I built a colorsensor and button into this FLORAbrella build...using the colorsensor code, the button cycles between the two sequences. I cannot figure out how to input a similar code into the 'AllEffects' Arduino file so that I can have each of the effects in sequence, but have them cycle indefinitely until I press the button to switch them...does that make sense?

See attached for the two I'm trying to combine...the 'button' feature to toggle between sequences that are found in 'Case 0 - Case 18'

Sorry if this is going too far off topic, but I've been hunting for how to do this for hours...thanks again for all your help so far.
Attachments
AllEffects_NeoPixel.ino
(20.76 KiB) Downloaded 22 times
buttoncycler.ino
Button Cycler INO File
(4.92 KiB) Downloaded 22 times

eppic
 
Posts: 4
Joined: Mon Nov 05, 2018 3:51 pm

Re: FLORAbrella Build - Help

by adafruit_support_mike on Fri Nov 09, 2018 12:28 am

The code you have should step through the states properly, but you have to think about the amount of time it takes for each animation to run.

As it's writen, your startShow() function uses the switch() statement to call one of several functions that animate the LEDs. Each of those functions has a loop that amounts to:

Code: Select all | TOGGLE FULL SIZE
for ( int i=0 ; i < frames_in_animation ; i++ ) {
    for ( int p=0 ; p < pixels_in_strip ; p++ ) {
        set_pixel_for_frame( p, i );
    }
    strip.show();
    delay( frame_delay );
}
Depending on the animation, execution can spend several seconds in that function. Only when the whole sequence is done will execution go back to loop() where you check for a button press again. Pressing the button in the middle of an animation won't have any effect.

To change that, you have to rearrange the code completely. Remove the outer loop that goes through all the frames of the animation and calls delay() for every frame, arrange the functions like this:

Code: Select all | TOGGLE FULL SIZE
void do_animation_N_frame ( int frame ) {
    for ( int p=0 ; p < pixels_in_strip ; p++ ) {
        set_pixel_for_frame( p, frame );
    }
    strip.show();
}
And move the timing back out to loop(), as demonstrated in the BlinkWithoutDelay sketch:

https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay

That way the code can check the button between strip updates, and can respond to button presses at any time.

adafruit_support_mike
 
Posts: 58799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.