Firefly Design LLC

Firefly Ice: An Open Source Wearable / Internet of Things Platform

PCBA 3D Model: Eagle CAD to Rhino 3D

Posted by denisbohm on September 14, 2013. 0 Comments

Firefly Ice Blue PCBA 3D Model

Having a 3D model of a PCBA can be very useful when designing a small enclosure with small clearances.  To help with this I've written a small Objective-C program to read the Eagle CAD PCB board file and generate a Rhino 3D Python script to create a 3D model of the board.  This makes it easy to check an enclosure design.

Place the 3D board model into your 3D enclosure and visually check for alignment, clearances, etc.  You can also do boolean operations to check for any interferences and see their exact shape.

The code is available in the Pcb-To-3D directory of the firefly-production-tools repository on GitHub.

Firefly Production: BOM Tool

Posted by denisbohm on July 22, 2013. 0 Comments

I've developed a Bill Of Materials (BOM) tool that helps with pricing and availability of parts:

bom

When doing low volume builds, it is important to be able to track availability of parts and pricing.  It is often difficult to find all of the required parts from the same distributor. Parts go in and out of stock leaving the need to check other sources.  A design may have a number of assembly variants (different ways to populate the PCB with parts) depending on what features are needed for a particular build.  Determining the price and availability can be a time consuming process.

The BOM tool reads an Eagle schematic and creates a part list.  Attributes in the schematic are used to specify the manufacturers part number.  Optional attributes can be specified on parts in the schematic to describe different assembly variants.  The BOM tool uses the Octopart API to find distributor pricing and availability for all of the parts.  The assembly variants and distributors that carry the parts are shown and can be individually selected.  A pricing and availability information summary is shown and a detailed report for each quantity is saved.

With this tool, it is now possible to easily estimate prices and lead times at various volumes for Firefly Ice Blue.

Firefly Ice Blue: Clip Mechanics

Posted by denisbohm on July 21, 2013. 0 Comments

Shown below are the first mechanical prototype parts for the firefly ice blue enclosure with an integrated spring clip.  These were made from a clear material in order to easily see the fit of various parts, and designed for initial testing of the following mechanical features:

  • joining the clip to the main body using the threaded rod
  • spring action of the clip provided by the bent metal spring
  • mounting features inside the main body for the PCBA
  • fit of the battery in the main body
  • fit of the USB connector in the main body

firefly-ice-clip-parts

Firefly Ice Blue: Getting Ready for Production

Posted by denisbohm on June 10, 2013. 0 Comments

The next revision of the Firefly Ice hardware, called Firefly Ice Blue, is now on github in the repository firefly-ice-electronics.

firefly-ice-blue-size

Some of the more notable changes are:

  • Completely round PCB with a smaller diameter of 34 mm.
  • New RGB LED controller provides full color control.
  • External flash storage has been increased to 2 MB.
  • I2C connector to support external circuitry.
  • Design tweaks in support of very low sleep currents.
  • Mounting holes on either side of the USB connector and on the opposite end of the board.

A small prototype PCBA run has been started and should be ready in early July.  This design that will go into production this year.  I've switched gears to focus on the mechanical design of the enclosure.  More information on that will be coming soon.  If you are interested in purchasing Firefly Ice Blue PCBAs and/or complete Firefly Ice Blue devices please get in touch.

Firefly Ice: Power Measurements

Posted by denisbohm on May 15, 2013. 0 Comments

The first power measurements for the Firefly Ice prototype PCBA look really good.  Very low power means small batteries can be used while still getting great battery life.

Sleep Mode

Average power consumption for the PCBA with the real time clock and watchdog timer running (everything else in sleep mode) was measured at 2.7uA.

Plus Accelerometer

Average power consumption for the PCBA with the real time clock, watchdog timer, and accelerometer running (everything else in sleep mode) was measured at 6.0uA.  The accelerometer was running at 25Hz in low power mode.

Battery Life

To relate the 6.0uA to battery life:

  1. A CR2032 240mAh coin cell battery would last 4.5 years.
  2. A  40mAh rechargeable lithium polymer battery would last 9 months.

Of course a typical application will need to use other devices on the PCBA, such as the Bluetooth 4.0 low energy radio, LEDs, CPU, etc.

Activity Monitoring Scenario

Consider a simple activity monitoring scenario.  The radio sleeps 90% of the time, is in discovery mode 5% of the time, and connected 5% of the time, adding 2.4uA.  The CPU usage averages 10,000 instructions per second adding 2.8uA.  Two LEDs are illuminated for 30 seconds a day adding 3.5uA.  This along with the CPU and accelerometer usage of 6.0uA, brings the total average current to 14.7uA.  The CR2032 battery would last about 1.8 years and the 40mAh battery would last about 3.5 months.

activity-monitoring-current

Balance

Two of the primary design challenges for body worn sensors are size and battery life.  Those are opposing forces - smaller size means smaller batteries and lower battery life.  One of the keys to a good design is to find the right balance for your application.  For certain applications where the duty cycles are low it is certainly possible, with a good design, to have a very low overall average current which enables long life when using small batteries.

Firefly Ice: Getting Started with Firmware Development

Posted by denisbohm on May 02, 2013. 0 Comments

Compiling the Firmware

The Firefly firmware uses freely available libraries and tools.  To get setup for building the Firefly Ice firmware you will need the following:

  • GNU Tools for ARM Embedded Processors
  • EnergyMicro CMSIS Software
  • Firefly version of the EnergyMicro CMSIS USB Software
  • Firefly Ice Firmware

The following commands can be used in the Mac OS X terminal to download and extract all of the above:

curl -O https://launchpadlibrarian.net/135590305/gcc-arm-none-eabi-4_7-2013q1-20130313-mac.tar.bz2
tar jxf gcc-arm-none-eabi-4_7-2013q1-20130313-mac.tar.bz2
export PATH=`pwd`/gcc-arm-none-eabi-4_7-2013q1/bin:$PATH

curl -O http://cdn.energymicro.com/dl/packages/EM_CMSIS_3.0.2.zip
unzip -d energymicro EM_CMSIS_3.0.2.zipgit clone https://github.com/denisbohm/energymicro-usb.git
git clone https://github.com/denisbohm/firefly-ice-firmware.git
cd firefly-ice-firmware
mkdir obj bin

Finally, from within the firefly-ice-firmware directory you can build the firmware using make:

make

The resulting FireflyIce.elf binary file can be found in the bin directory.

Loading the Firmware

It's time to get the hardware setup.  In addition to a Firefly Ice PCBA, you will need the following:

Connect everything together, plug the USB cable from the ARM-USB-TINY-H into your Mac, and plug the USB cable from the Firefly Ice into any USB port for power.

connections

The Firefly Flash production software will be used to load the compiled FireflyIce.elf binary into the Firefly Ice PCBA.  Download and run FireflyFlash.zip (it should automatically unzip when downloaded by Safari).

FireflyFlash

Click on "Select firmware ELF file..." and select the FireflyIce.elf file that you compiled in the steps above.  Click "Program" and in a few seconds the indicators on the Firefly Ice should indicate that the firmware is running.

Debugging the Firmware

The Firefly Flash software acts as a gdb remote target for debugging.  To start debugging with gdb:

arm-none-eabi-gdb

then enter the following gdb commands:

target extended-remote tcp:127.0.0.1:9000
set architecture armv3m
file bin/FireflyIce.elf

Now you can use gdb commands for debugging.

Alternatives

The process above is one way to build, run, and debug Firefly Ice.  But it isn't the only option.  For example, a project file for the Rowley Associates CrossWorks for ARM development system is included in the Firefly Ice firmware repository as well.  CrossWorks runs on Windows, Linux, and the Mac.

Any ARM Cortex-M3 gcc distribution could be used for compiling.

Any JTAG with SWD capability and the associated tool chain could be used for running and debugging.  For example, the Olimex ARM-JTAG-SWD in combination with the Olimex ARM-JTAG-20-10 can be used instead of the Rowley ARM SWD Adapter with the same tool chain as above.

References

Firefly Ice: Source Code Repositories

Posted by denisbohm on April 17, 2013. 0 Comments

Lots of things coming together this week:

firefly-ice-assembled

  • The firmware to read the sensors and communicate via Bluetooth Low Energy & USB is working.
  • Development of cloud data storage and syncing has started.
  • 3D printed enclosure prototypes have arrived.
  • I'm presenting this project at the Austin Hardware Startup Meetup.

Source Code Repositories: Below are links to all of the current source code repositories for the software, firmware, hardware, and enclosure.

Data Storage Service

GitHub: Firefly Data Storage Service

Cloud data storage service in Ruby / Sinatra hosted on Heroku and Mongohq.

API/SDK & Example Applications

GitHub: Firefly Ice API

Device API/SDK for iOS and Mac OS X with example applications.

Firmware

GitHub: Firefly Ice Firmware

Device firmware written in 'C' using gcc.

Schematics & Printed Circuit Board Layout

GitHub: Firefly Ice Electronics

Eagle schematics & printed circuit board layout files.  The schematics have annotations that can be used to generate BOMs for ordering parts and for assembly.  The printed circuit board layout has layers for documentation of assembly locations of all BOM parts.

Note that the current schematics are for the first build of 10 prototype PCBAs.  There will be some changes based on testing and tuning done with those prototype PCBAs.

Component Parts Library

GitHub: Firefly Eagle Library

The Eagle component parts library has all of the parts used by the Firefly Ice electronics.

Rhino 3D Enclosure

Thingiverse: Firefly Ice Enclosure

The Rhino 3D file has all the development enclosure parts as well as some other parts used as reference such as the cover pate, battery, screws, etc.

Orderable Custom Enclosure Parts

Shapeways: Firefly Ice

The Shapeways files are printable STLs of the main body of the enclosure as well as the battery cover.  The cover plate, screws, etc, are standard parts that need to be ordered separately.

Energy Micro USB Firmware

GitHub: Energy Micro USB Firmware

Energy Micro USB firmware with a few fixes (gcc compatibility and not using port F pin 5 for VBUSEN).

Production Tools

GitHub: Firefly Production Tools for Mac OS X

Includes Firefly Flash application for Mac OS X that can be used to program firefly devices and also provides a GDB server so that any GDB based debugger can be used for development.

ARM SWD Framework

GitHub: ARM Serial Wire Debug Framework

The ARM Serial Wire Debug Mac OS X framework will be used by the production tools for testing and programming boards during production.

Project Tracking

Pivotal Tracker: Firefly Ice

Firefly Ice: PCBA Checkout

Posted by denisbohm on April 03, 2013. 0 Comments

The first Firefly Ice PCBA arrived May 29th.  So far the communication between all the chips on the board have checked out fine.  Still more testing to do, but things look really good.  The remaining PCBAs from this first build of 10 should be here this week.  Effort is now shifting to focus on the firmware development.

firefly-ice-pcba-top firefly-ice-pcba-bottom

Fireflies are Amazing

Posted by denisbohm on April 01, 2013. 1 Comment

fireflies

Here are some fun firefly facts that I collected a while ago...

Fireflies aren't really flies and glowworms aren't really worms. Fireflies (or lightning bugs) are soft-bodied beetles in the family Lampyridae.

Glowworms are actually young fireflies, the luminous larvae that squirm forth from firefly eggs. These grublike wonders live in the ground eating slugs and snails for almost two years until they metamorphose into pupa, and then fireflies.

Fireflies are mostly active at night when they zoom around flashing their taillights and eating nothing.

Fireflies use the light on their lower abdomen segments to attract mates. (Since glowworms don't mate, no one knows exactly why they glow.) Fireflies of the same species recognize each other by the number of flashes used, the frequency of flashes and the color of the light.

Different species emit different colors of light such as green, amber, or yellow.

The light fireflies produce (or that any living organism produces) is called bioluminescence. It's a chemical process in which luciferin reacts with oxygen in the presence of an enzyme called luciferase. Chemical energy from the reaction is transformed into light.

Close to 100% of the energy from the chemical reaction is given off as light. For comparison, a typical light bulb give off only 10% of its energy as light, while the rest is wasted as heat.

Fireflies control the rate of their light flashes by admitting air into the luminescent organs.

All known firefly species are bioluminescent as eggs and larvae, but some are adults are not.

Some Asian species are fully aquatic and live underwater.

Fireflies larvae are predators and feed mostly on earthworms, snails, and slugs. They can detect snail or slug slime trails and follow them to the prey. An anesthetic type substance is injected into the prey to immobilize it.

Firefly larvae live one to two years, spend about 10 days as a pupa, then live as adults for only a few days to a week.

Adult fireflies don't bite, have no pincers, don't attack, don't carry disease, and are not poisonous.

Firefly larvae use their luminescence as a warning signal that communicates to predators that they taste bad because they have defensive chemicals in their bodies.

Adult fireflies use a species specific flash pattern to attract a member of the opposite sex.

In some species the female is wingless.

When fireflies are distressed they flash to warn others.

In some species, the female firefly mimics the flash of another species. When the male responds and comes to her to mate, she eats him instead.

There are about 2,000 known species of fireflies.

Fireflies are also known as Lighting Bugs.