Tag Archive for: raspberry pi

@NUSTEMxmas: our festive, robotic, IoT glockenspiel

Every now and then, we (Jonathan and Joe) get an idea stuck in our heads. It’s usually a ridiculous idea, an idea that should never see the light of day. But then, one of us says it out loud…

We’d like to introduce you to the NUSTEM IoT Festive Glockenspiel™.

Whilst you pick your jaw up off the floor, we’ll explain what’s going on and offer a little background as to how we ended up with this creation in our office.

The Glockenspiel has the brains of a Raspberry Pi, and those brains are listening to Twitter. When anyone tweets to @NUSTEMxmas and requests a festive tune, our Pi picks up the message and quickly searches through our vast bank of early 00s mobile phone ringtones for a match. A command is then sent to another Pi elsewhere in the office, which decodes the ringtone and instructs yet another Pi to rev eight servos into action. Those servos move hammers which strike our home-made, only-slightly-out-of-tune, no-sharps-or-flats, plays-with-enough-enthusiasm-to-occasionally-break-itself glockenspiel. We also added flashing lights – synced to the music, obviously –  to enhance the festive mood, and a readout so we know who’s requested the song. One of the Pis (we forget which, but probably the first) also tweets a reply to the original requester.

If you’re interested in finding out more about how it works, we’ve documented our code on GitHub. You can download it and (in theory…) build one of these things yourself. Or poke around in our code for festive giggles: we cobbled this whole project together using bits of previous projects or longer-term incomplete ideas, so the system architecture is at the hilarious end of software engineering.

How we got here

The Glockenspiel is a spin-off from our Robot Orchestra workshop. We’ve been running this digital making activity with our schools and as a public drop-in for several years. The workshop (and the robots) have gradually developed, becoming a little cleverer each time:

  • First version: Arduino controllers move servos on a fixed beat pattern.
  • Second version: Arduinos ‘easily’ reprogrammable, and operating two servos.
  • Third version: Wemos D1 controllers commanded over wifi from a Raspberry Pi, hence all playing in sync.
  • Fourth version: Command system can parse saved patterns and so ‘play tunes’; controllers can respond to one of eight ‘channels’.
  • Fifth version: You know, things get a little hazy somewhere in here…
  • nth version: System controlled by a lovely light-up button board, or a less glamorous but more practical on-screen interface. This is both a super-modern visual programming environment, and something that looks uncannily similar to the sort of punched cards that were used to drive weaving looms and started all this stuff off in the first place.

We’ve built the various parts of our system in a modular sort of way, so it’s relatively easy to switch bits in, remove parts, or graft in new ideas. We use this approach in lots of our digital making projects, with the result that ideas and bits of code are easily shared across projects. We also have a habit of attempting projects which are right on the edge of what we think we can do, but which feel achievable because we’ve already solved half the problems in other projects.

(an early version of the robotic glockenspiel – from, like, Tuesday or thereabouts – showing the on-screen direct programming interface. This was before we built the parser for mobile phone ringtones.)

The new parts we’ve built for this version of the project include:

  • Using a Raspberry Pi as our servo controller, and driving eight (count ’em, eight!) servos from it. Thanks to Ben Nuttall for pointing us in the right direction for that.
  • Handling requests from Twitter. We’ve done this before, but we’ve done a better job of it this time.
  • We found a library of suitably festive songs … in RTTTL mobile phone ringtone format, which is one of those things that rather died out in 2004. So we dredged up music theory half-remembered from our pre-GCSE days and leaned on bits of code from others (RTTTL parser; frequency-to-note convertor), and ended up with code which plays ringtones on our…
  • …home-made copper pipe glockenspiel. Which was itself inspired by this Instructable. Big thanks to everyone who came to our Raspberry Jam last weekend and mucked in to help build this!
  • We added a Pimoroni Displayotron HAT screen, which was intended for a completely different project but was just too bling not to use. Only later did we realise there’s a whole monitor literally right next to it. Oh, well.
  • Finally, we hacked some of the older Wemos-based players so they drove twinkly lights rather than servos, and used them to increase the total amount of festive.

We’ll use bits of this system in a variety of ways throughout 2018, so it’s not even the case that we’ve been massively goofing off in work hours. Mostly. Sadly, we didn’t manage to get to ‘posting video clips back to Twitter’ – most of the recipes we’ve seen for that sort of thing are video-only, which wouldn’t work so well for a musical project. So if you tweet us, you’ll just have to trust that the system has indeed played a little tune for us in the NUSTEM office.

Hmm… a little belief? At Christmas? It’ll never catch on.

 

Computer training opportunities in Newcastle

Two outstanding computing events are coming to Newcastle in the next few weeks:

Picademy

untitledThe Raspberry Pi Foundation’s flagship teacher training experience, Picademy is a two-day extravaganza of all things “Pi in the classroom”. There doesn’t seem to be a course outline for what’s covered, but the events are very well-regarded by previous attendees.

The course is free, and being held on various dates at Google Digital Garage, Newcastle City Library. For more information and to apply for a place, see the Raspberry Pi website.

Apply very soon – the first dates are almost upon us!

BBC Micro:Bit Drop-in day

Micro:Bit boards are being distributed (free of charge) to every year 7 student in the country, assuming your school signed up to the scheme. The school also receives  a class set of boards, a few for teachers, and a few spare units for breakages.

There’s such a wealth of stuff around Micro:Bit it can be hard to know where to start. Most of the teacher training events have passed, but there’s a teacher / student / family drop-in style workshop event right here at Northumbria University on Saturday 25th June. So if you have a Micro:Bit and want some ideas or help, or if you’re trying to work out what to do when yours arrives, or if you’re plain curious – this could be your chance.

Free, but registration required (through the link above)

Introducing the Technology Wishing Well for Maker Faire UK 2016

At Maker Faire UK last year Think Physics had two stands; a wall of light boxes, and a magnificent harmonic pendulum display which, slightly embarrassingly, I still haven’t written up. Hoping to avoid a similar mistake this time around, I should introduce you to this year’s new installation: the Technology Wishing Well.

WishingWell v1

Er… yeah, that’s a bit of a mess. What you’re looking at is a corner of my desk, on which you can see the black disc of a small turntable. That’s part of the light box installation, repurposed shamelessly (hey, I’m allowed to steal from myself, right?). On the turntable are a couple of LED lights. The green one is pointing upwards, the red one fell over and is pointed off to one side.

Left of frame is a retort stand, holding a Raspberry Pi (Pi 3! Woohoo!) and a PiCamera, which as far as I can tell is a mobile phone camera module on the end of a stubby little cable. The Pi is driving the big monitor upper right, and the window in the top corner is showing… what, exactly?

OK, so I’ve written a little Python code which does the following:

  1. Grabs a picture from the camera.
  2. Takes all the stuff which is ‘dark’ in that image, and turns it transparent.
  3. Adds the result to the previous image.
  4. Repeat.

So, as the turntable turns the green light smears into a ring, and the fallen-over red light smears into a… weird red blobby donut thing. My python code is appallingly slow, but conveniently the result is mesmerising to watch as it gradually builds up. Which is a relief, because we’ve committed to building this thing and there’s no turning back now.

The plan is to build a big one of these, so the current turntables can sit on the big turntable, and then we’ve made a giant light-powered video Spirograph-like-thing. We’re also planning to build little gizmos which move lights around, or change their colour over time, or … well, you’ll have to wait and see. You’ll also be able to make your own lights and toss them onto the turntable disc to add to the artwork as it develops, which is where the whole ‘wishing well’ idea comes in.

There’s lots to do before Maker Faire, but right now I’m just excited (and a little relieved) to see something on a screen rather than in my imagination. This moment’s been a long time coming.

The header image shows the first run of the software – here’s detail of the second, just before the Pi crashed hard. Umm… I should probably look into what caused that.

Tech wishing well second run

Register your school for BBC micro:bit

Confused by Raspberry Pi and Arduino (not to mention Espruino, Beagleboard, Edison, and all the rest)? Don’t despair, things are about to get even more convoluted!

The BBC are introducing a whole new platform to the education mix, with their micro:bit available to every year 7 child in the UK. The board itself is the centrepiece of a whole education initiative, “Make It Digital”, which aims to build on the legacy of the original 1980s BBC Computer Literacy Project, which itself spawned the original BBC Micro. So, surrounding the new board will be a whole ecosystem of learning materials and projects. There’s also a rather interesting web-based programming tool, built on Microsoft’s TouchDevelop, which looks like it might neatly bridge the gap between popular introductory tools like Scratch and follow-on approaches like Python and Arduino’s C environment.

Arguments about whether the BBC should have gone this route are largely moot at this point – as a publicly-funded body it’s hard for them to be seen to back any commercial product, even if it’s wholly open (Arduino) or sort-of commercial but warm and cuddly (Raspberry Pi). Besides, the array of Make It Digital project partners is huge.

So micro:bit is coming, and hopefully bringing with it a vast array of high-quality resource material. And best of all, it’s all free. Or at least, one micro:bit per year 7 student will be – the rest of us will have to buy the things, but that’s still a great start.

Register your school now to receive micro:bits for your 2015 year 7 group, via this web form.

No, really: if you’re responsible for ICT in your school, fill the form in. Micro:bit might turn out to be a distraction, but there’s a decent chance it’ll be a superb platform and ecosystem for investigations and embedded projects. I’ll be trying to get my hands on a few micro:bits when they become more widely available, and I look forward to building things with them via Think Club.

Additional links:

Tag Archive for: raspberry pi

The Computer Programmer

Find out what Year 2 children have been doing in the computer programmer workshop in our partner schools.

Technology Wishing Well

Think Physics’ multi-award-winning new installation for Maker Faire UK 2016. Build your own at home!

Internet of Trees

How we built a Twitter-connected colour-changing Christmas tree.