A recent project required a small water-proof sensor. Low volume production was needed to conduct internal studies. An enclosure consisting of two parts was designed. The top part has a white feature that is used for alignment into a strap and doubles as an LED indicator. The bottom part has a magnetic USB connector. The two parts are held together by screws and there is an o-ring in-between to make a waterproof seal.
The top part was made by first welding white ABS sheet to black ABS block. These are attached to a custom fixture plate so that multiple tops can be milled in a single pass. The white is milled away from the top to leave just the alignment/indicator feature.
On the back side, the black is milled away to reveal the white indicator feature. There are also alignment features for the internal PCBA, a grove for the o-ring, and holes for metal inserts that will securely hold screws. A custom thermal press hot end, clamp, and adapter plates were made to ease insertion of the tiny metal inserts.
A set of completed top parts:
The bottom part is milled from a large black ABS sheet. The same custom fixture plate is used to make multiple parts in a single pass.
To complete the bottom part, a magnetic USB connector is glued in place.
A PCBA and battery are assembled into the top and bottom parts. An o-ring and screws join the two halves to make a waterproof assembly.
The fully assembled device with USB cable attached:
A water tester was used to check each prototype. The prototype is magnetically attached to the mount inside the tester. The tester is pressurized to 3 ATM and the device is submerged into the water. A visual check is done to check for air steams leaking from the device. This device was tested up to 6 ATM and passed all tests.
A production station was created for the PCBA in this device. The production station is based on a custom platform that we designed and have used for multiple clients. The custom platform consists of a complete test station with electronics and software - all designed and built in house. To customize the platform for a client, a unique test head is created using our software. The test head consists of a PCB with test point probes and a mechanical component to hold the PCBA under test in place. The software is customized by creating a test script specific to the PCBA.
The production station attached to a computer via USB showing a successful test and programming pass:
The custom test heads are the black parts in the image below. The top test head contains all the test point probes in this case. The bottom test head holds the PCBA securely in place.
The addition of the mill rounds out our capabilities so that full devices can be made in house including mechanicals, electronics, firmware, and apps.
]]>Checkout the Timing Demo page for details.
]]>
Checkout the Raw Data Capture page for details.
]]>
The workshop will cover the complete process of creating a small low power connected device by leveraging open source hardware and software. This includes electronics, mechanical parts, firmware, software, FCC testing, production, and more.
You must signup in advance to attend SXSW workshops. To reserve a seat, please go here: https://sup.sxsw.com/schedule/IAP20731
Hope to see you at SXSW!
]]>The following image shows the test fixture with and without the PCBA in place:
]]>
3,000 Components
1,500 Complete PCBAs
]]>Here is the Firefly Ice on the clear plastic table in the RF anechoic test chamber (tiny black device in the lower right):
RF Anechoic Chamber
If you are thinking of making a product with a radio there are a couple of things to keep in mind when designing your device to make things easier when the time comes for FCC testing.
1) Make it easy to bypass the antenna and matching circuit to bring out the RF signal via a 50 Ohm SMA connector. This allows the device to be directly connected to a network analyzer as required for a number of tests.
2) Prepare test software to place the Bluetooth 4.0 radio into Direct Test Mode (see the Bluetooth Specification) with various parameters. You will be asked to put your device into a direct test mode and transmitting on various frequencies, so make that easy and quick in your app.
3) Bring a couple of chargers and computers to use with your device for measuring conducted emissions. Since your device is so low power, you will actually be mainly testing the chargers and laptops conducted emissions rather than your devices.
]]>The molds have been through a couple of rounds of tweaks and sample runs. These are the latest plastics samples:
The Firefly Ice Blue core enclosure design files are now available:
GitHub: Firefly Ice Mechanical
The Firefly Ice Blue core enclosure design has 4 elements:
The spacer and top are co-molded into a single piece, so there are only 3 parts for final assembly. The final assembly process is very simple:
The shell will come in green, pink, blue, and black :
The core parts are all generated by a Python script run inside Rhino 3D. That makes it easy to tweak the design.
]]>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.
]]>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.
]]>Some of the more notable changes are:
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.
]]>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:
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.
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.
]]>The Firefly firmware uses freely available libraries and tools. To get setup for building the Firefly Ice firmware you will need the following:
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.
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).
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
]]>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
]]>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.
]]>The renderings below show the Firefly Ice development enclosure along with some of the internal parts. The PCB is represented by the green shape. LEDs and Micro USB port are visible in the top view. The coin cell battery option is visible in the bottom view.
]]>The first 10 Firefly Ice prototype printed circuit board assemblies (PCBA) have been ordered. All the components have arrived and the printed circuit boards are currently being fabricated. The complete PCBAs are scheduled to arrive in early April. The hardware will then be tested for functional correctness and expected power consumption. If revision is required, another prototype build will be started at the end of April.
Development Enclosure
A very simple 3D printed enclosure will be used to protect the PCBA while developing the device and testing it out in real world scenarios. This enclosure will be very easy to take apart for reprogramming the PCBA via the ARM SWD pads. These will be very inexpensive to produce in small quantities via 3D printing services such as Shapeways.
Software
Once the hardware is checked out, the development focus will shift to the firmware, data uploading app, and cloud storage.
]]>The first design produced, the Firefly Ice, is intended to be a general purpose device that can be used to develop the whole flow through the basic system. When all the hardware and software is complete for this first design then more variants will be produced. Two new variants under consideration are a small low cost version and a very thin waterproof version.
The Firefly Ice activity monitor will have the following features:
Electronics
Firmware
App
Cloud
There are many more applications for activity monitors.
For example:
And of course activities that aren't about people:
Can you use the Nike+ FuelBand, Jawbone Up, FitBit, etc, for all of these applications? The answer is a clear no. Those devices record very specific information that won't work for these other applications. None of those devices allow their firmware to be changed for other purposes. All of those eco-systems have their own methods for transferring data to their cloud, storing the data in their system, and accessing it via their APIs.
The Firefly Activity Monitor project is developing an open source activity monitor. The electronics, mechanicals, firmware, uploading, and cloud storage are all open source. Nothing is locked behind any vendor's proprietary eco-system. Pre-built Firefly hardware will be available. You can change the firmware for your application. The hardware can be modified to suit your needs. Add new sensors, change the power system, use a different radio. Create new form factors: wrist band, band-aid, or a pebble for your pocket.
]]>