Robotics wizard and two-time Battlebots champion Christian Carlberg first achieved notoriety shredding competitors’ robots with Minion’s 14-inch saw blade on one of TV’s first reality shows. Now he’s all fired up to begin shipping what may prove to be the “world’s first open source flashlight.”
Carlberg says the pocket-sized “HexBright” flashlight provides super-high light intensity, up to five times that of conventional LED flashlights. It will be offered in two models — the Prime, with maximum output intensity of 350 lumens; and the Flex, a reprogrammable model controlled by an embedded microprocessor and offering 500 lumens of light output. (Carlberg and robot Minion are pictured at right; click the image to enlarge.)
In order to manage the economies of scale required for making the flashlights cost-competitive, Carlberg and hardware/software specialist (and project partner) Terry Cooke created a Kickstarter project to finance the project. If successful, Kickstarter funding would enable them to purchase critical components by the thousands and also would cover the expense of buying an extrusion die, another key step toward minimizing manufacturing costs.
No ordinary flashlight
“Just about anywhere you can buy a cheap flashlight with a zillion unnecessary modes (high, med, low, slow blinky, fast blinky, SOS blinky… laser pointer too??),” Carlberg writes on the project’s Kickstarter page. Unfortunately they’re “all garbage, and the light will usually break on you.”
“I made myself a light the way I wanted it,” Carlberg recalls. “I picked the best available LED (a CREE XM-L; pictured at right, click to enlarge), a good rechargeable battery, built the electronics and programmed it with the only modes I wanted: high, low, and blinky. From necessity (also known as cheapness) I machined the body out of 1-inch aluminum hex bar stock and came up with a unique elegant look with a surprisingly very comfortable grip. Based on the aluminum hex-bar body, I named my light the HexBright Prime, and I was pretty happy with it.”
But Carlberg soon came up with more ideas for enhancing the HexBright design. So he and Cooke set about developing a higher-end version, dubbed the “HexBright Flex.”
The Flex adds a mini-usb plug, enabling the built-in microprocessor’s firmware to be re-flashed from a PC. Additionally, it incorporates circuitry for charging its lithium-ion battery from DC power supplied over the usb cable.
But by the time the Flex design was completed, they realized they were “tapped out of cash to actually make one.” The solution to this was to pre-sell HexBright flashlights on the project’s Kickstarter page, where supporters are offered “reproductions of the original and first-made HexBright Prime for just $35, or you can pre-order the more powerful and versatile HexBright Flex for $60.” For reference, “a good quality $30 brand-name flashlight puts out 100 lumens of light,” Carlberg adds.
The key specs of the two HexBright models are summarized in the table below.
|Amps at max.
|2 x CR123A
|1 x 18650 li-ion
As indicated in the table, the key advantages of the Flex over the Prime are that the Flex offers higher light output than the Prime, and it can be recharged and (re)programmed over its usb port. Thanks to the Flex’s usb-based firmware reflashing capability, “if you want, you can rewrite the default code and tweak the HexBright Flex however you desire,” explains Carlberg. We’ll have more to say about that later on.
In the first video below, Grant Imahara, of the popular MythBusters TV show, checks out the HexBright at the recent Bay Area Maker Faire event. In the second video, Carberg gives some background on the project and briefly discusses the design of the HexBright Plus and Flex models.
Grant Imahara demos the HexBright
Christian Carlberg tells the HexBright story
HexBright’s embedded hardware and software
Carlberg supplied DeviceGuru with the block diagram below, which details the Flex’s embedded architecture:
HexBright Flex block diagram
(click image to enlarge)
As seen in the diagram, the heart of the HexBright Flex’s embedded electronics is an Atmel ATmega88 microcontroller. This highly integrated chip contains a low-power, 8-bit, 20MHz, RISC CPU; 8KB flash, 1KB SRAM, and 512B EEPROM memory; an 8-channel 10-bit A/D converter; three timers supporting pulse-width modulation (used for LED control); and one serial port, which is transformed by a chip on the Flex’s circuit board to a usb port.
Understanding the HexBright Flex’s programmability
Why would a flashlight need an embedded microcontroller (uC) in the firstplace, and what could you, as a user, do to influence its operation by revising its embedded firmware?
Cooke provides the answers to these and other provocative questions below…
- Q1: What does the Atmel microcontroller do for the Flex?
A1: The Flex’s microcontroller (uC) varies the light intensity via PWM (pulse-width modulation). You can change the light intensity and switch between modes with the only limit being creativity and the program memory of the uC. The uC has a battery voltage monitor input, so you can change up your program depending on how much charge is left. The uC recognizes when the Flex is charging and informs the user via some light flashing signal. It also has an onboard temperature monitor, so it can keep the system from overheating and optimize the efficiency of the LED. Additionally, it has a current monitoring input, so you could potentially keep constant brightness even though the battery might be draining.
- Q2: Why would anyone want to reprogram the Flex?
A1: Cooke answers this question five ways…
- Short answer: You can optimize the efficiency of a SMD LED and battery with a microcontroller.
- Flippant answer: It’s an LED run by a microcontroller. Might as well have access to it.
- Zen answer: I don’t know. I want to see what unique applications people come up. We will let people post their findings on HexBright.com
- Tech answer: There’s a lot you can do besides just setting light levels and blink rates. You can run have your light run up and down mathematical equations, come up with unique styles, or even use it to transmit Morse code. I can even imagine a next generation light with a sensor on board so you can start to “talk” to other lights.
- User answer: Special functionally for Law Enforcement just by re-flashing the uC
Basically, the microcontroller (uC) controls the transistor that regulates the voltage and current applied to the LED. It uses PWM (pulse-width modulation control), but you can write whatever algorithms you want to try for programming. Additionally, we are planning a simple user interface for folks who don’t want to write code and we are allowing people to completely re-write the source code. And there is an in-between approach, whereby people can open the source code, change just a few little things, and see what happens. In case they mess up their light, they will be able to restore the Flex’s default firmware by downloading the original source code from our website.
- Q3: What programming language does the embedded microcontroller run?
A3: We will be using the open-source AVR-GCC tools. These tools allow efficient programing in both C and C++. Most of the source code will be written in C++ to take advantage of overloaded functions and classes to make program changes for the end user more intuitive. The choice of an Atmega uC and the AVR-GCC tools will also allow us to make the Flex Ardunio-compatible in the near future.
- Q4: Will the flashlight’s standard firmware be released as open source, or does the “open source” angle only apply to some control parameters and algorithms that can be reflashed, rather than the entire controlling firmware?
A4: There will ultimately be two options for programming the Flex:
- A serial interface, used for changing the default brightness constants as well as the blinking period and modes (high, med, low, blinky)
- An on-chip bootloader, allowing which the microcontroller to be completely programmable (similar to Arduino). Allowing the user to modify the source code to optimise the flashlights functionality to their liking.
Although Carlberg and Cook haven’t decided which open source license to use for releasing the Flex’s firmware, they’re committed to making it open.
“I want to release the HexBright Flex [source code] into the wild and let the community develop original source code,” states Carlberg. “I want to see how brilliant (pun intended) people can be and supply an outlet (hexbright.com) where folks can swap and share lighting code. I’m not fundraising just to make creative lights, I want to build online creativity.”
UPDATE: New video about the HexBright Flex
The video below provides a few additional details on the HexBright Flex.
For further information, visit the HexBright flashlight’s Kickstarter project page or the HexBright website.