Files

286 lines
16 KiB
Plaintext
Raw Permalink Normal View History

Episode: 1971
Title: HPR1971: BlinkStick
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1971/hpr1971.mp3
Transcribed: 2025-10-18 12:41:35
---
This is HPR Episode 1971 entitled Blink Stick.
It is hosted by Dave Morris and is about 18 minutes long.
The summary is the Blink Stick in a small USB device with an RGB LED, which you can build yourself.
This episode of HPR is brought to you by an honesthost.com.
Get 15% discount on all shared hosting with the offer code HPR15.
That's HPR15.
Better web hosting that's honest and fair at An Honesthost.com.
Hi everyone, Dave Morris with the show about a bit of electronics I've been messing around with.
Now I got into the habit of coming up with ideas for shows and making a start
on them and then sort of never getting around to finishing them and this is one.
I started planning this back in 2013 and it's only just got to the point where I'm finishing it off.
So apologies if some of it looks a bit out of date, probably is.
But anyway, the bit of electronics that I'm talking about today is called a Blink Stick.
And the reason I started messing around with this was because here when I live in Edinburgh in Scotland,
there's a hack lab and they were offering soldering courses at one point,
where on the course you've got to buy and build a Blink Stick.
And I saw these and thought, oh that looks quite cool.
My son Tim was quite keen to learn how to solder at that stage.
And so I offered to sign him up for a course, but he couldn't make it too busy with his college work.
So we decided that the compromise would be that we would buy two of these things
and build them at home and I'd try and teach him how to do soldering at home.
So the episode describes partly the process of building it with some pictures and so forth
and partly a bit about what you can use them for and the whole range now of Blink Stick products.
So the version we bought was round in 2013, 2014 and it's the 1.0 release of the Blink Stick.
And that was all that was available at the time in as well as another model called the Blink Stick Pro,
which I'll talk about a little bit later.
I noticed the Blink Stick still available and it's version 1.1 there,
but they've a whole bunch of other things available from there as well.
So they're well worth checking out, I would suggest.
The company that makes them is called Agile Innovative and it's based in the UK.
I'm assuming you can buy these outside the UK, don't really see why you couldn't.
They're not very expensive and I imagine shipping wouldn't be very much.
Anyway, let's talk about the building of the version 1 Blink Stick kit.
So you'll see there is a picture showing all the components.
And it comes with quite a nice PCB, very nicely printed,
so you can see what all the bits go and relatively small number of components.
It's a USB connected device, so you get a USB type A connector.
I'm confused by USB connector names.
It's got a bunch of resistors, diodes, capacitors and the interesting bit is an RGB LED,
which you control with it, and it's controlled through a little microcontroller,
which is an AT tiny 85.
So we sat down to build this and looked at the build instructions.
There's some excellent, excellent build instructions with lots and lots of pictures
and easy instructions to follow, which is presumably why the hack lab were using them
as a good thing for to teach people how to solder.
We had the kit, I've been doing small amount of electronics and soldering for many, many years,
and so I had various things they recommended.
They suggested using helping hands, which you can see, these things are two crocodile clips on them,
holding the board and see it in my second picture.
And they also suggested that we have some side cutters.
I had end cutters as well, which I started to use, but really side cutters are best,
because you can manipulate in, you can see what you're doing a bit easier.
So we started off adding the six resistors, as was recommended.
And this is a great learning point for a first-time solderer.
Basically put the legs of the devices through the requisite holes.
You bend them slightly so they don't fall out when you turn it upside down,
and then you get in there with your fine soldering iron and put a good blob of solder.
The pictures are, some of them are mine, some are Tim's.
I don't actually remember now, which is which.
So I'd like to be able to say that the good soldering was all mine and Tim's soldering attempts were,
and not so good, but he's become a much better solderer than I am,
so I'm not going to start playing that game.
So you can see the PCB gradually building up with resistors,
and then we put the Zener diodes in, and you have to get them round the right way,
and it's pretty clear which way they go based on the markings on the board.
Then we added the capacitors.
Again, you have to be careful about the polarity there, which is nicely indicated.
The instructions explain it really well.
I didn't take pictures at this stage.
We were trying to be very, very detailed of our pictures, both Tim and I were taking them.
He's actually a very good photographer, better than I am.
He did some really ultra-close-up ones, but anyway, whatever.
I'm sure you get the gist of it, and if you really want to find this,
and you want to do it yourself, the instructions on the blinkstick sight are great,
and obviously I've linked you to them.
Then having done this, you then put the USB plug onto the board,
and that's a teeny bit fiddly in that you have to get the two anchoring lugs into their positions
and solder them on, and getting it just nice and straight takes a little bit of work.
It's slightly challenging, but not too bad.
Then we needed to put the integrated circuit IC socket onto the board.
You don't solder the chip directly.
It goes into a nice little socket, so you can take it out again if you ever wanted to.
Not sure why you'd want to.
Maybe to reprogram it, perhaps.
Having done that, you can see in there's a picture of the board, the right way up,
with the chip in its socket, and the RGB LED fitted into its place.
So the signal is a little bit funny with these pictures,
but you basically put the chip in when everything else is in,
and you have to get the orientation right.
But again, it's pretty hard to mess that up, and we didn't.
So there's a picture of the final result from the top down.
You can see all the components in there nicely,
and along the way you learn things like how to bend the legs of the components
so that they sit neatly and close to the board.
The little RGB LED is more fiddly in that it stands off very slightly from there,
from the board.
Presumably it warms up.
I don't know, I've never checked.
These things do get warm, so on heart if they're very powerful.
So there's a bunch of software available for driving this thing,
and there are Python versions, A Python version.
There's a Ruby version, and a Node.js version.
And they're all on GitHub.
I decided to go for the Python version myself,
and you need to install Python pip, the Python installer,
and then you can use pip to install Blinkstick,
the actual software package.
Just before preparing these notes, I decided to make sure that my software was up to date,
so I ran a pip install minus minus update Blinkstick,
the pseudo on the front of it, to make sure it was completely up to date,
and I got version 1.1.8 of the software.
So this software offers a command line interface,
and the command is Blinkstick.
There's no manual page that you get with it,
but then since it's a Python script, it's not usual to get that, I guess.
But you can type minus minus help,
Python help if that's better.
To Blink the word Blinkstick, the command Blinkstick,
and you get a big watch of information.
Now, when you first install it, the device,
and you plug the Blinkstick in, the device comes up as a dev slash dev slash device name,
which then needs root access to accesses.
So you'd have to do pseudo in front of the Blinkstick command.
But they thought of this, and they have provided as part of the Blinkstick command,
the ability to create a UDev rule,
which allows you to use it without using pseudo.
So you can achieve this by simply typing the command
in pseudo space, Blinkstick space,
hyphen, hyphen, ad hyphen, UDev hyphen rule,
and it will go and make the correct rules, and off you go.
Then you don't need to put pseudo on the command and use it in future.
Out of interest, the rule is installed in slash ETC slash UDev slash rules.d,
slash 85 hyphen, Blinkstick dot rules.
It's a fairly simple UDev rule,
the subject's been covered in other HDR shows in the past.
So having got to this stage, you then got the device,
which you can just plug into a USB socket,
wherever it's appropriate to you,
and you've got the command with which you can control it.
And I've listed out some of the more interesting options to the Blinkstick command,
so there's things like brightness.
You can set the brightness of the color,
and it's actually quite a bright device when it's on its full brightness,
but you can have that at a lower brightness if you want.
There's a limit option which is an alias to brightness.
There's a set color option.
I'm not going to read these all out in detail,
I'm just skimming through them.
You can see them yourself in the notes.
It sets the color for the device.
So it sets the light to that particular color,
and you can do it either with the color name,
and there's a reference to where you can find out all these various names,
things like red and green and blue you can have.
But you can also use hexadecimal color values if you want to.
There's also a random and off that you can use that you can choose a random color for you,
or switches it off if it's on.
There's an inverse option.
Not quite sure of that.
It does. I've not tried it.
Is it the inverse of the color?
There's a blink which lets you blink that color.
So it comes on slowly and then off slowly.
There's a pulse.
No, blink is on and off fast.
Pulse is on and off slowly.
There's a morph which takes the current color and then morphs to another color.
There's a duration of the morph and the pulse that you can define,
and then there's a delay option which defines the milliseconds to light the LED when you're using blink.
And there's also a repeat option so you can get the number of blinks or the number of pulses.
There's a lot of information on the Python wiki that's associated with the blink stick side.
So a simple use would be on the command line,
blink stick space blue will switch on the light and turn it to turn it blue.
It will be at maximum 100 by default.
Well, you could do blink stick space,
hyphen hyphen brightness equals 30 space green,
and then you get a green color at brightness 30, which is much dimmer.
I've written a little bit of bash script,
which you could put into a script.
You wouldn't really want to type the command line probably,
which is a for loop that switches blink stick into a red pulse,
then it sleeps for 5.5 seconds.
I think it is.
Then it does a green pulse and then it sleeps again.
It goes around and a loop doing that 20 times.
So you can have the thing flashing on and off by using that type of thing.
You can have more than one blink stick plugged in.
You want to have more than buy more than one.
And there's a hyphen hyphen info option,
which will come back and say what blink sticks the software has detected,
and they each have a serial number.
So you can then use the serial number in the command.
So if you have more than one,
you can be controlling them independently,
given that you know what the serial numbers are.
Of course, there's a whole Python programming interface to this,
which if you're a Python programmer, you can make use of.
Now personally, I haven't done anything other than try a few tutorial examples.
And there's loads of them in the Python wiki on the website of the for the blink stick.
But you can do some, you can do some clever things.
You can do some quite easy things because the library to do it is nice and easy to use.
I decided not to go into a lot of depth here,
partly because I haven't done much myself,
so I wouldn't be telling you stuff that I've actually done.
So what do I do with it?
Well, for the moment, I've got a project where I am using it,
simply to indicate a state on my main desktop machine.
So as you know, I'm an HPR volunteer, meaning I do a bit of administration,
so while I was writing and recording shows.
And what I did was I wrote a web scraper script
to tell me when a new show gets added to the HPR system.
It spots it on the calendar page.
So this script logs the fact that a new show has popped up.
It simply returns a message saying there's a new show and it is number, whatever it is.
So what I did was I wrote a cron job
and it runs this scraper script every 30 minutes.
And if there's something for me to check out,
then I get it to generate a sound, which I can switch off if I've got visitors or whatever.
It's not off now.
Somebody sends in a show now, you'll hear it on the recording.
It also produces a pop-up message on the screen,
but it only lasts for a relatively short space of time.
So those two alerts are short.
And if I happen to be out of the room, I won't spot them.
And I also turn on the blink stick.
Again, that's controllable by an external flag.
So it switches the blink stick to red, solid red.
I keep my blink stick connected to my simple power hub, which is on my desk.
And so if the red light comes on, it's pretty obvious that there's some work for me to do.
And what I then do is I've been helping to process the show notes.
So my cat is trying to, she is trying to be internet famous
because she keeps trying to intrude on my recordings all the time.
Like HPR, can you actually use any now?
I'm just going to ignore her and hope she stops.
So yeah, I'm processing the show notes as a consequence of getting these alerts.
The script, the cronjob script anyway, I'm not going to, I haven't posted the scraper.
The script that calls it and does these fancy things with the blink stick.
I've called cronjob underscore scrape.
And I've linked to it because it's on GitHub, if you want to go and have a look at it.
So the final thing is that a bit after buying the original blink sticks,
I also bought a blink stick pro from Agile Innovative.
And this device doesn't have LEDs itself, but it's for controlling a wide variety of other LEDs.
I haven't built this, it's still in its kit form.
And I don't currently have a specific project for it.
But at the same time, I bought a Neopixel 24 LED ring from Adafruit,
which I've also linked in the notes.
And I'm thinking that maybe I would use that as some sort of alert system
that I can mount on my desk somewhere.
But I'd also quite like to get one of these reels of RGB LEDs on a self adhesive strip.
And this is controlled with the pro as well.
The blink stick pro does have the advantages to just able to control these things directly
without any other circuitry, whereas you can't easily plug them straight into a raspberry pie
or an Arduino when that other stuff on a breadboard or something.
I'm thinking of doing the setting up the pro quite soon,
just to see how I get on with it.
And when I do, I will probably do another HPI episode on it
so that you can follow along and see how it works.
I can tell you a few hints and tips about it.
I strongly recommend, if you're interested in this, that you check out the blink stick site.
Because they do have some quite nice kit there, including a very, very tiny version of the blink stick.
So because as you see, the one I'm using is a moderate sized thing.
It looks like a USB stick size.
So that's it for now.
And hopefully there will be more to tell you on this tale a bit later on.
Now I can go and let the cat out of whatever is she wants.
Okay, bye.
You've been listening to Heka Public Radio at HekaPublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday,
through Friday. Today's show, like all our shows,
was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast, then click on our contributing
to find out how easy it really is.
Heka Public Radio was founded by the Digital Dove Pound and the Infonomicon Computer Club,
and is part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly,
leave a comment on the website or record a follow-up episode yourself.
Unless otherwise status, today's show is released on the creative comments,
attribution, share a light, 3.0 license.