External notification LED(s) via Bluetooth

Would you be interested in a device like this?

  • Absolutely!

    Votes: 2 10.5%
  • If it's easy to build at home

    Votes: 11 57.9%
  • If it's cheap

    Votes: 1 5.3%
  • If it's pre-built

    Votes: 5 26.3%
  • No, but I like the idea

    Votes: 1 5.3%
  • No.

    Votes: 0 0.0%

  • Total voters
    19

Djhg2000

Very Active Member
Joined
Jul 22, 2014
Messages
213
Location
Sweden
This project came out of a few requests in an official news thread for a small device that could tell them when something happened on their Pyra. The general idea was something attached to your arm or a necklace with an LED and a Bluetooth interface. Basically I saw a chance to help through tools I was familiar with and set out to create such a device.

I gathered up some components I had lying around; one SparkFun FioV3 (with a LiPo battery), one Bluefruit EZ-Link and one NeoPixel stick.

It's currently quite physically big, since it's built on a small breadboard with loose components, but the potential for shrinking it down is pretty big. There are many other ATMega32U4 based boards to build this from and LiPo charge/booster circuits are available from various sources. In addition NeoPixels are basically just nicely packaged WS2812 LEDs and while they do get you out of the trouble of soldering SMD components, someone seeking to commercialize this could just put this on the same board as the ATMega32U4. Bluetooth modules can be a handful to deal with but it would not be impossible to adapt the project to suit such modules.

The software is capable of handling output piped from Zenity directly since the latest version (two earlier releases in the news thread), before it used '$' as a prefix for 48 bit color (as in $012345ABCDEF) and '#' for 24 bit (#012345). Now that this is reversed it means you could simply connect to it and issue "zenity --color-selection > /dev/rfcomm0" to make it flash in the color you selected.

I don't have any images or videos of it yet, I'd like to polish the animation a bit more first but if you're interested you could try it on your own Arduino with NeoPixels (for wired usage simply replace all instances of "Serial1" with "Serial"). The source is available for download below.



Even if you can't try it, I'd like to know if this is something you'd be interested in by voting in the poll.

Have a nice day!

Latest version and changelog:



Code:
--- Changelog ---
+ Added
* Changed
- Removed

Version 0:
+ Initial release

Version 1:
+ Pulsing notifications support
   initiate by replacing '#' with an uppercase 'P', end by sending "#000000000000"
 

Attachments

  • FioV3_Bluetooth_LED.ino.txt
    3.5 KB · Views: 223
  • FioV3_Bluetooth_LED_v1.ino.txt
    4.3 KB · Views: 447
Last edited by a moderator:
Here comes some photos...

This is how huge the thing is:

overview.jpg

Acceptable for a proof of concept, then again not for much else.

Here I am trying to capture the LEDs:

fading.jpg

Doesn't really say much more than how bright these things are even though I caught it near the end of the fade. When I used the circular (currently misplaced) one as a tachometer, about 5% brightness was what you could actually use for viewing. They're not the brightest LEDs out there, but they will still give you a headache at full brightness.
 
Looks promising. Now this needs to be done qith tiny arduinos that are about the size of a quarter and a ble shield.


The sofrware could also just read the numeric data from poc and pass it to the serial interface.
 
Last edited by a moderator:
How about adding a cheapo piezo sounder of the flat type used in wristwatches?

https://www.sparkfun.com/products/10293

Could this run off a coin cell, CR2032 or similar? Or do we want a rechargeable lipo with a USB port for charging?

What size are we aiming for here? I'm imagining a box around 40mm by 20mm by 8mm

Also, cost? Working roughly, and ignoring economies of scale:

£10 for BT module

£4 for ATM32U4

£3 for lipo cell

£1 for a bleeper

£0.50 for RGB LED

Maybe £20 - £25 for the electronics, but what about the case?

Are there general-purpose cases available that would be suitable?

The case could be laser-cut, which would certainly avoid the tooling costs, but would result in sharp edges.

Presumably the whole case should be made of transparent plastic to avoid the additional costs of multiple materials.

Anyhow, I love the idea of a community-designed, open-source, arduino-compatible Pyra accessory.

I'd be happy to have a go at any of (design, electronics, arduino programming) if wanted.
 
Well, the current parts list:

Price: Part:
$ 34.95 SparkFun FioV3
$ 3.95 SparkFun Breadboard Mini
$ 8.95 SparkFun LiPo Battery 1000mAh
$ 5.95 Adafruit NeoPixel Stick
$ 22.50 Adadruit Bluefruit EZ-Link
$ 7.95 Adadruit Premium Jumper Wires 150mm

$ 84.25 Total
This could instantly be reduced significantly, for instance Adafruit sells cheaper variants of the NeoPixel (although only in single quantities which wouldn't give you much of an animation). Chinese suppliers claim to deliver the bare WS2812 LEDs for less than $0.5 per piece. If this ends up being a custom board, this would be the way to go (although from european suppliers).

Furthermore the EZ-Link is fairly cheap as far as breakout boards go, using another one would definitely contribute to a smaller device but the price might actually go up. BTLE would be an option as well, however I don't have any testing equippment for BTLE and it would probably break compatability with the Pandora. Does anyone have experience in BTLE transmission from a shell script? BTLE chips are way smaller than regular bluetooth chips from what I can gather, probably because of the simpler architecture. Adafruit has a product named "Bluefruit LE" which is simply a Nordic Semiconductor nRF8001 breakout board for $19.95 .


The battery is an open question; both the ATMega32U4 and the NeoPixels can run off 3.3V so a coin cell or two should be a feasable solution. However the advantage of LiPo batteries are that they're rechargeable and come in different capacities. If you prioritize size over capacity, you could use a tiny 110mAh battery. If you want it to go for weeks, use a 6000mAh battery. The case (once we get that far) could have a small battery holder and a hole for external batteries.


We could also opt for a split board with long wires to the LED(s) and a box somewhere else, though while it would keep the costs down it would kind of defeat the purpose of having a bluetooth link.


For the mainboard I only have one major goal; keep it programmable from the Arduino IDE without extra parts. This is critical for future development and hackability. This comes with a few implications however, for one the entire source tree has to be tested with the IDE and also the hardware must have a programming port. Since the ATMega32U4 has native USB support the programming port only needs to be a connector attached to the appropriate pins and the Arduino bootloader will handle the rest.


I have previously used this board http://www.lawicel-shop.se/prod/A-Star-32U4-Micro_1056013/Pololu_55653/ENG/EUR and A-Star seem to have problems with their own library for Arduino IDE. Luckily the datasheet says you can program it as a Leonardo, so that's what I ended up doing and the only downside seems to be it identifying itself as a Leonardo instead of A-Star ATMega32U4. This is the smallest board I've ever worked with on the Arduino side of things.


If anyone contributes with a custom PCB design then this could become a very small device indeed.
 
Last edited by a moderator:
Poll needs an option for people who think it's a good idea, but don't need it themselves.

I love this idea, but I would never buy it as it would encourage me to have the bluetooth on all the time.
 
Poll needs an option for people who think it's a good idea, but don't need it themselves.

I love this idea, but I would never buy it as it would encourage me to have the bluetooth on all the time.
I picked "If it's cheap" "Sure, why not."  If it is cheap I might make it and use it.  I would not use it most of the time, though, because I don't often use bluetooth.
 
Poll needs an option for people who think it's a good idea, but don't need it themselves.

I love this idea, but I would never buy it as it would encourage me to have the bluetooth on all the time.
I added this option to the poll. I assume your vote is better reflected now?
 
Instead of one RGB led, I'd rather have a pebble-like watch with a small e-ink display, something like this:

http://www.eink.com/press_releases/e_ink_introduces_small_mobius_display_060313.html

Or maybe ED should just sell one of those smartwatches in his shop, maybe with some bundle discount if you get a Pyra+smartwatch combo, and then we can consider it to be a somewhat "official" companion device and give it some community dev love so it is properly supported. We might even get some useful attention in those communities, where they could be interested in the Pyra as a portable dev platform for their smartwatch.
 
Sorry, I didn't mean to be rude.
Don't worry, neither did I. English isn't my native language so I guess mistakes like this are bound to happen sometimes.

I updated the first post with a new version. There's a new feature for pulsing colors, useful for things that require immediate action (phone calls etc). You can initiate the pulse by replacing the '#' character with a 'P' which will set a variable that causes the brightness to be reset to maximum when it hits 0.

I thought about the pulse pattern and concluded a steep rising edge in brightness will catch your attention better than a smooth pulse. I also considered a steep falling edge, but in that case you risk misinterpreting the color.

Edit:

I made a couple of small mock-up pictures of how I imagine the board in it's smallest possible form. Probably not really possible, but for anyone with CAD skills, this is what to aim for.

Bluetooth LED.png

Bluetooth LED Double.png

The general idea is one or two WS2812 LEDs and the ATMega32U4 on top and on the bottom side the nRF8001 and a combined coin cell holder and micro USB port. The way the battery holder would work is to use a holder for two batteries, insulate the sides and use the shield of the USB connector as the negative side and the edge as a locking mechanism. The battery would insert upside down, but it would make for a very compact device.
 
Last edited by a moderator:
Can the LEDs be driven directly off a microcontroller output?

Edit: Dumb question, its got a built-in control chip! (assuming we're talking about a WS2812)
 
Last edited by a moderator:
Can the LEDs be driven directly off a microcontroller output?
Not with NeoPixels, the combined consumption of all three LEDs exceeds the maximum pin load on an ATMega32U4. However the beauty of WS2812 LED modules is that we don't need to do so since they have 4 pins; VCC, GND, DIN and DOUT.

DIN and DOUT are the actual control and VCC + GND only powers the module. This separation means we can (theoretically) drive as many LEDs as we want with a single serial data output pin from the Arduino.

VCC on the WS2812 doesn't actually even have to be the same VCC as on the Arduino which is used in some projects where you want to drive the LEDs from a separate battery. To us it doesn't really matter, but I thought I'd explain it in more detail anyway.  :)

Edit:

I see you figured it out, but I'll leave the explanation for more details. "There are no dumb questions, only dumb answers".
 
Last edited by a moderator:
2 pins for power

2 pins for USB connection

2 pins for serial line to BT module

1 pin for LED (output)

1 pin for bleeper (PWM)

1 pin for button (Input)

Do we really need a 44-pin micro?

Also, what about programming over bluetooth?

Then we only need one serial interface and needn't bother with USB
 
There's so much more which could be done! I'm an electrical engineer and getting a graphic touch-screen to work with a bluetooth peripheral is quite easy:

You build a Menu with important notifications (Battery Status, USB Port status, Wifi network, bluetooth status, and many more)

We only need access to the bluetooth stack of the ARM mcu, and send them the info's to a bluetooth chip (many on the market are cheap and easy to use).

Quick picture with my cellphone battery percentage status, using a PIC and a HC-05 bluetooth module (the setup is quite BIG, but can certainly be reduced to the screen size only).

WP_001012.jpg
 
2 pins for power

2 pins for USB connection

2 pins for serial line to BT module

1 pin for LED (output)

1 pin for bleeper (PWM)

1 pin for button (Input)

Do we really need a 44-pin micro?

Also, what about programming over bluetooth?

Then we only need one serial interface and needn't bother with USB
No, not really. I just wanted to use the Arduino bootloader for easy hacking which unfortunately limits our options quite a bit. Bluetooth programming might be an option, but then there's a risk of bricking the device unless we implement a failsafe in the bootloader. It could be done, but I think the task might be a bit over my head.

There's so much more which could be done! I'm an electrical engineer and getting a graphic touch-screen to work with a bluetooth peripheral is quite easy:


You build a Menu with important notifications (Battery Status, USB Port status, Wifi network, bluetooth status, and many more)

We only need access to the bluetooth stack of the ARM mcu, and send them the info's to a bluetooth chip (many on the market are cheap and easy to use).


Quick picture with my cellphone battery percentage status, using a PIC and a HC-05 bluetooth module (the setup is quite BIG, but can certainly be reduced to the screen size only).

attachicon.gif
WP_001012.jpg
I've gone through a class in PIC processors and I agree that they're very neat, however there's quite the learning curve for people looking to hack the thing. Not to mention the need for an external programmer. Maybe with one of the bootloader and hardware USB capable chips? I remember wanting to write a bootloader and finding out there was a rather small selection of models that lacked some critical instruction, including (of course) my PIC16F690. So there went my chance of finally not depending on my PicKit2.

While it seems to me that while a PIC could do this job, and I like the simplicity of your design, I'm worried it would discourage other people from hacking it. The ARM idea might work if it could use the Arduino bootloader. I want people to do all kinds of crazy stuff with it, not because it's necessarily a good idea but because it would be their idea. Say someone figures out adding a toaster to it would make it better. I don't think it's a good idea, but this person does. All he would have to do is to search for some Arduino tutorials and he's all set. It encouraged him to learn by his own initiative.

That's the core of this project in my opinion; encouraging people to try their own ideas with it. It's the right to disagree with the original hardware developers. Find out what works and what doesn't on a small wireless device. It's what sets it apart from the (admittedly few) alternatives out there. I know I sound like a broken record going on and on about Arduino but it has a really nice ecosystem with libraries for exotic hardware.

Sorry of this comes off as offensive, I really don't want it to sound that way.
 
Last edited by a moderator:
Does the pyra support bluetooth low energy from bluetooth 4.0 or only classic? Bluetooth LE would be much better suited for this device if it's supported on the pyra. The low data rate and advert requirements mean this could easily run from something as small as a coin cell and could do away with the charging hardware completely.
 
Back
Top