Tag Archives: Uncategorized

The Wheel of (BASIC) Excuses

via Raspberry Pi

Back in the day, over at IEEE Spectrum magazine, the editorial elves had a sheet of paper stuck on a wall, with a spinning arm which pointed to any number of plausible excuses for not having handed in homework an article in time.

The offices were renovated last year, and Stephen Cass thought that it was time to update the paper version, bringing it kicking and screaming into the 1980s with a Raspberry Pi-based BASIC system. You can’t fit many excuses on wheel drawn on a sheet of paper. With a big enough SD card, you can fit all the excuses onto a Raspberry Pi.

wheelexcuses1.HandsOnWheel-opener

I remember struggling with getting BASIC to do things fast enough to be useful when I was at school back in the dark ages. The RISC OS version on your Pi is much evolved from the BBC BASIC we knew and loved in (squints) 1980-something; it’s also much, much faster by virtue of all that extra RAM. Stephen was pleased and alarmed by this.

Stephen didn’t put the code for the spinner in his original piece, because he had the aberrant view that nobody would be interested. Happily, he’s fixed that and pasted everything into a comment below his article. (Hit “See more” to view the whole block.)

There are, of course, plenty of non-journalist applications for this snippet of code: games for the kids, allocating chores, automating decision-making…we hope some of you will end up adapting it and letting us know what you did below.

Plotter made from scrap computer parts

via Raspberry Pi

Our old friend HomoFaciens (who has the best voice of any Raspberry Pi user we’ve met) has another fantastic piece of work to share. He’s recycled old optical drives for their stepper motors, and made a tiny plotter, controlled over WiFi, from those motors, a servo, four H-bridges and a Raspberry Pi.

HF has made a full writeup, including all the source code you’ll need, available at his website. As always, he’s also made the whole video and writeup available in German. HomoFaciens’ website is one of those bits of the internet you’ll find yourself wandering around for ages if you’re even slightly interested in this sort of thing. He’s got some fascinating stuff on there; I heartily recommend giving one of his camera-equipped robots a spin via the web interface they’re hooked up to. (No prizes for guessing which is my favourite.)

If you decide to make your own plotter, be aware that not all old optical drives have stepper motors – HomoFaciens’ hit rate was about 50% when he started pulling them apart.

Stream PC games to your TV

via Raspberry Pi

Why spend hundreds of quid on a Steam Machine when you can do exactly the same thing with a humble Raspberry Pi? (The B+ is available for $25, which is about £16, at RS Components at the moment, if you’re really on a budget.)

Here are the Possibly Unsafe guys to walk you through setup.

I’ve swiped the instructions below from their YouTube channel:

Setup:
You’ll first need to install the latest Rasbian from here:
http://www.raspberrypi.org/downloads/

Next download Limelight Embedded. Grab the latest limelight.jar and libopus.so from here:
https://github.com/irtimmer/limelight…

Make sure that your gaming PC has an NVIDIA GTX 600+ graphics card and GeForce Experience installed.

Pairing:
To make things easier, enable SSH on the RPi and tunnel in to the machine. Here are some useful commands:

List compatible PCs
java -jar limelight.jar list

Pair with PC
java -jar limelight.jar pair PC-IP

Map a controller
java -jar limelight.jar map -input /dev/input/eventX mapfile.map

Start streaming
java -jar limelight.jar stream -1080/720 -60fps/30fps PC-IP -app Steam -mapping mapfile.map

Make sure to check the Limelight help file in case things have changed since this post!

Possibly Unsafe’s a rather brilliant channel; I’m making their homemade Sriracha chilli sauce just as soon as I can get my hands on enough habaneros. You can support them via their Patreon if you like the things they do.

Benton Park Live Coding Orchestra – The Planets

via Raspberry Pi

The kids from Benton Park have gone on to media superstardom in this short from the BBC. You’ve met the Benton Park Live Coding Orchestra before – they live-code music in Sonic Pi for school performances. This time, they’re making music about the planets, using Holst’s Planets Suite as a jumping-off point.

The Live Coding Orchestra kids are in years 5 and 6 (so they’re all between nine and eleven years old); the dancers in this performance are all from the Reception class and the Nursery group (aged five and under). As well as providing music for the little kids to dance to, the Live Coding Orchestra spent some time teaching them how to create music in Sonic Pi – you can see them doing some training at the start of the video.

The music sets the mood for dancing on three different planets, with a rocket trip between each planet orchestrated by Holst. Best thing we’ve seen in ages – thanks Live Coders, and thanks dancers! (If your adblocker has made the video below invisible, you can check it out at the BBC’s website.)

Droplet photography

via Raspberry Pi

I get asked sometimes what my favourite projects from this blog are. Dave Hunt’s water droplet photography’s right up there: Dave rigged up a Pi to trigger a solenoid valve and a camera shutter at the same time, to take perfectly timed macro photos of water drops. You can see his original, beautiful pictures here in our archives.

Over in Germany, Markus May has based his own rig on Dave’s, with a few alterations; he’s also put a lot of effort into lighting and colour effects, with spectacular results.

Markus’ original blog post is in German, but Google Translate does a pretty bang-up job of making things understandable for idiots like me who promptly forgot all the German they knew moments after taking a GCSE exam in it. (I still remember that Zwiebel means onion, but that won’t get you far on holiday unless you really like onions.)

Tropfen_RPi-201522

We love this stuff: bringing the sort of thing you could only do with an expensive professional rig inside the budget an amateur with a DSLR might have gets us really excited.

Tropfen_RPi-201519

This rig is more involved than Dave’s original, with a couple of Mariotte’s bottles which produce an equal flow rate, however full the bottles are. Guar gum for thickening, milk for opacity and food colouring went into the liquid for extra gorgeousness.

Tropfen_RPi-201526

Markus has made a circuit diagram available, and Dave’s original post still contains everything you’ll need to make your own rig. There are more of these spectacular photographs at Markus’ Flickr, and you’ll find a great writeup of the original session, with behind-the-scenes pictures at his blog post.

Visualising core load on the Pi 2

via Raspberry Pi

Since we released Raspberry Pi 2 back in February, a lot of you have been asking questions about how work gets divided between the four cores. David (what’s your last name, David? Let us know and I’ll update this post) in Cambridge has written a remote CPU-monitoring webserver, which outputs a nice scrolling graph of CPU load on all four cores onto a webpage, so you can view it remotely while your Pi 2 works, along with CPU temperature.

The monitoring software itself is lightweight, so it shouldn’t be a big consumer of resources on your Pi – the Pi’s sending a series of numbers representing load, and all the heavy lifting, turning it into visual data, is being done in Javascript by the browser on whatever machine you’re viewing it on. Here are the results, running on a simulated iPhone 4s.

This is very easy to set up; everything’s embedded in the executable, so all you have to do is to run the program. You’ll find full instructions and code in Dave’s GitHub repo here – if you already have another webserver running on your Pi you may need to change ports, but that aside, this is an absolute doddle to run.

Let us know if you have a play; we’d be interested to learn about what you find!

 

Amazonian rainforest simulation

via Raspberry Pi

Mike “Recantha” Horne mailed me yesterday saying he’d found something that was (and I quote) “ALL KINDS OF COOL”. He also taught me a new word. This project is a paludarium: a created environment that mimics a complete terrestrial and aquatic biome, full of plants and animals that live in water and on land. A bit like a terrarium, but with an aquatic element as well (or a bit like an aquarium with a greenhouse on top).

Paludarium

The paludarium in question, created by a team called Poopi and Piter (it seems Piter built the paludarium and Poopi built the system that creates the weather and time-of-day effects), simulates an Amazonian rainforest, with fog, rainfall, thunderstorms and wind; as well as a complete diurnal cycle. The Raspberry Pi is responsible for running:

  • 6 independent sections of halogen lights
  • 27 independently controlled 1W LEDs for various effects
  • 3 independent 3W RGB LEDs for ambient color effects
  • 3 independent 3W LEDs for lightning and moon simulation
  • 3 independent 10W LEDs for Aquarium lighting
  • 2 independent FANs for wind simulation
  • 3 fog generators
  • 2 independent solenoids for rain control
  • Temperature monitoring

This is one of the most beautiful projects we’ve ever featured here. It’s a compelling watch: enjoy the video.

Raspberry Pi Powered Minion Fart Gun Machine

via Raspberry Pi

The Raspberry Pi Powered Minion Fart Gun Machine. It’s got LEGO. It’s got an ultrasonic proximity sensor. It’s got farts. We loved it.

Paul Weeks‘ kids are the proud owners of a Minion Fart Gun. It’s a toy reproduction of a despicable gadget from the movie Despicable Me 2.

minions

fartgun

(You can buy your own Fart Blaster on Amazon – but this project will work with any toy that has a trigger mechanism.)

Paul had an ultrasonic sensor kicking around from some other Raspberry Pi projects he’d worked on with his kids (the Scratch Ultrasonic Elephant Cheese-Puff Game is a thing of beauty, and we commend it to you). He also had a box full of LEGO Technic. He brought everything together with his kids to make beautiful music fart noises when someone approaches the setup.

Paul has created a thorough writeup, complete with code. It’s a fun project; you’ll learn about controlling motors, how ultrasonic sensors work, and how best to annoy family members going to the loo in the dark in the middle of the night. Thanks Paul; we salute you! (Please don’t come near us with that thing.)

Python in Education – free e-book from O’Reilly

via Raspberry Pi

This week PyCon is going on in Montreal – it’s the big worldwide Python conference – and for the occasion, O’Reilly asked our friend Nicholas Tollervey to write a free short book on Python in Education.

python-in-education

Click to download the book for free

The book tells the story of Python, why Python is a good language for learning, how its community gives great support, and covers Raspberry Pi as a case study.

You’ve probably heard about the computing revolution in schools, and perhaps you’ve even heard of the Raspberry Pi. The Python programming language is at the center of these fundamental changes in computing education. Whether you’re a programmer, teacher, student, or parent, this report arms you with the facts and information you need to understand where Python sits within this context.

Author Nicholas Tollervey takes you through the features that make Python appropriate for education, and explains how an active Python community supports educational outreach. You’ll also learn how Raspberry Pi is inspiring a new generation of programmers – with Python’s help.

Nicholas visited Pi Towers in February to speak to Carrie Anne, Eben and me about why we think Python is suited to education. He asked Eben how the idea for the Raspberry Pi hardware came about and why there was a need for an affordable hackable device. He asked us about the Python libraries those in the community provided (particularly RPi.GPIO and picamera) that we consider part of our infrastructure for education and hobbyist users alike; and about the sorts of projects that engage, empower and inspire young learners – and of course the way they learn and progress. We discussed Minecraft Pi, hardware projects, Astro Pi, PyPy, teacher training and more.

Read more on teaching with Python from Nicholas and download the book for free from O’Reilly.

Launching Picademy@Google Leeds

via Raspberry Pi

We love introducing educators to the Raspberry Pi; that’s why the education team are always on the road, at conferences, shows and events, sharing the Pi’s learning potential. Last year, we started a teacher training programme, and invited educators from all over the world to our headquarters for some fun hands-on learning. We called it Picademy. It’s been hugely popular, and so far we’ve trained around 200 teachers through seven events in our own unique way. The feedback has blown us away. Of those who completed our feedback questionnaire:

  • 97.5% stated that they were now likely or very likely to use Raspberry Pi in their classroom, and 
  • 98.8% stated that they were likely or very likely to share the training received with other teachers.

So we have a problem. We want to train thousands of educators – no – hundreds of thousands of educators, and that’s not possible for our tiny education team, even though it’s made up of a cracking bunch of superstars. Picademy is always oversubscribed.

We have huge ambitions for education. Thanks to the generosity and support of Google, we think we are heading in the right direction. Today we are excited to announce our new Picademy@Google programme for educators, kicking off in Leeds, UK. This is another opportunity for primary, secondary and post-16 teachers to attend Raspberry Pi-flavoured computing and science training, but this time at a Google Digital Garage near where you live. The Digital Garages are a group of pop-up spaces – this first one located in Leeds Docks – which will help 200,000 British businesses learn crucial skills for the digital age, and use the power of the internet to reach more customers and grow faster.

Here is trustee Pete Lomas with Lauren Hyams (Code Club Pro) and Roger Davies (Computing at School) who will also be offering teacher training opportunities at the Digital Garage

Here is Raspberry Pi Foundation trustee Pete Lomas with representatives from Code Club Pro and Computing at School (who will also be offering teacher training opportunities at the Digital Garage) at the launch event in March.

The Picademy@Google courses will be run by hand-picked community members and educators, and will be a a mix of hands-on making, project-based learning and general hacking (think Picademy meets Raspberry Jam!) They will run alongside our definitive Picademy course and are, as always, completely free to attend for teachers.

We will be launching Picademy@Google in other UK cities as Google Digital Garages open over the next few months – to be informed about when one opens up near you, please sign up to our education newsletter.

The Leeds Digital Garage will be open between now and November, and we’ll be running a number of Picademy@Google courses there, so start spreading the news: sign-ups for teachers are open!

 

TyFone – a DIY Smartphone

via Raspberry Pi

One of the most popular projects we’ve featured here was Dave Hunt’s PiPhone. It’s a working mobile phone built around a Raspberry Pi; it does all the telephony you’d expect, but it’s a smart-ish phone, not a complete smart phone, which made some of you sad.

In the year since the PiPhone was first built, Tyler Spadgenske has been beavering away at his own version, which improves on the original. We think it’s rather splendid.

What’s new here? The TyPhone can take photos (and send them to Dropbox or another device), send texts and manage its own battery level, as well as placing and taking calls. Tyler wrote own OS in Python, 3d-printed a rather smart enclosure, and now has a phone he’s built from the bottom up – hardware and software both.

Tyler has made full, diagrammed instructions, a parts lists and a Thingiverse file for the 3d-printed case available over at Instructables.

LEGO spectrometers

via Raspberry Pi

First-year Computer Science projects from Imperial College in London have been providing us with some really, really cool stuff for this blog over the last couple of years. Not to be outdone, the Chemistry faculty have hopped on board the Raspberry Pi bus as well – only they’re using LEGO too, which we calculate to be worth at least an extra eleven cool points.

imperiallego

I do not recall my own bright college days being anything LIKE this.

Students studying Chemistry are being set a challenge: they have to design and build and optimise a UV-Vis spectrometer using LEGO. They then have to refine the design and make it as sensitive as they can, using a number of samples, learning about instrumental limitations in the process. A Raspberry Pi collects the data – which means that the students have to learn how to use Linux and write some Python as part of the project.

pointy

Dr Joshua Edel, who ran the project, says:

“This is the first time we’ve done this type of project. It’s the students’ first introduction into measurement sciences and we wanted to create a fun problem solving element to what they’re doing and at the same time ensure they refine their analytical skills.”

Some spectrometers, like this one, sprouted trees (one had flags representing the nationalities of everybody who'd worked on them). At least one was built in the shape of a Greek temple.

Some spectrometers sprouted tiny LEGO trees; one had flags representing the nationalities of everybody who’d worked on them attached. At least one was built in the shape of a Greek temple.


The plan is to roll a simplified version of this project out to schools, teaching much younger kids that light is much more involved than the visible spectrum might have them believe. And that LEGO and Raspberry Pi make, as always, a beautiful partnership.

DIY home alert system

via Raspberry Pi

Last year Andre Pawlowski started work on a home security project. A friend of his had been burgled, and he thought an open-source client/server DIY home alarm system would be a good idea.

The only solutions I found were limited to just one device. For example one solution for the Raspberry Pi only works locally with components that are directly connected to the Raspberry Pi itself. I wanted a client/server based structure which can be easily extended by just adding a new client to it. I did not found anything like it, so I had to write it myself.

Andre ended up with a system called alertR that he calls a “unified alerting system” which works with the client/server model he wanted. But why stop there? AlertR has gone a long way since its beginnings as a home alarm system; he’s integrated it with other systems in the house to the point where it’s become a complete home automation and notification system. So it can act as a watchdog to check your online services are running, tell you the doorbell is ringing when you’re playing music that’s so loud you can’t hear it, turn your devices on and off to order, alert you when a water leak sensor is triggered, monitor your smoke alarm, tell you if your server is pingable, watch to see whether the door and windows are open – there’s no limit to what you can add to the system. Andre says:

I looked into some commercial home alarm systems. All of them (at least the ones I looked into) had the same problem: they are limited to a count of x sensors to handle. alertR is logically not limited to a maximum count of sensors it can handle. Of course, it will be eventually reach a limit of resources at some point or the maximum value the database can store as an ID ;-). At the moment my instance handles 6 clients with 16 sensors and is not even close at being at its full capacity.

Keypad client, so someone with the right pin can turn the system on or off on leaving the house.

Keypad client, so someone with the right pin can turn the system on or off on leaving the house.

Here’s Andre’s video intro to the system. Please turn on captions; Andre has used them to explain what’s going on.

Best of all, the system also incorporates an events-driven rules engine. The engine means you can chain rules together so you can have a sequence of rules which have to be fulfilled in a specific order and in a specific time frame. One rule can consist of different rule elements that are bound together by a boolean operator.

Doesn’t make sense? Let’s imagine that every morning, you like to listen to a particular radio station throughout the house while you’re getting ready for work; but your start time varies, and on some days you might not be at home at all. This means that triggering your media centre to start playing at the same time every morning won’t work (although it can do that too, if you want it to). Instead, the system can watch for things that you do every time you get ready – opening a specific drawer in your bedroom within a certain number of seconds of turning the kettle on in the kitchen, say – and turn on the media centre, tuned to the right channel, when those rules are satisfied. Speakers in every room? The system can use a PIR sensor to tell which one you’re in, and move the music around the house to follow you.

The system comes with a nice notification client, so you can see what’s going on in your house using your mobile device.

alertr_mobile

It’s also configured so you can have alerts pop up on other devices you might be using. There’s integration with Kodi (which was still XBMC when this was being developed) for notifications; here’s a video to demonstrate. (Please turn the captions on again.)

The project is open source, so you can replicate it in your own house. Check out the GitHub repository, the Wiki, and Andre’s own blog posts about alertR.

You’ll be unsurprised to learn that we absolutely love this project. This is definitely one I’ll be using at home; let us know if you’ve got similar plans in the comments!

Growing things in the (mushroom) cloud*

via Raspberry Pi

We’re getting quite excited about horticulture here at Pi Towers this year; Rachel’s got a desktop greenhouse growing interesting edible leaves with a high degree of Raspberry Pi involvement (we’ll have much more on that, and on how she’s scaling it into a bigger installation you’ll be able to visit, in a month or so). I’m waiting for a warm weekend to set up a new owl box, with Pi camera, in my garden; and there’s another Pi camera deployed in the direction of the plants on my desk so I can check that Clive doesn’t forget to water them again next time I have to go overseas.

(The best) part of Rachel's Pi garden setup.

(The best) part of Rachel’s Pi garden setup.

Green plants benefit from a spot of automated attention from a Raspberry Pi to their water levels, UV light levels and the length of their “day”, and temperature. Kyle Gabriel has been applying a similar process to mycology, automating the cultivation of mushrooms with a Raspberry Pi.

Mushrooms’ needs are not the same as those of Rachel’s salad vegetables; the Pi overseeing a mushroom farm needs to be paying attention to CO2 levels, temperature and humidity, among other things. (Fun mushroom-raising fact: if you’ve got a log prepped with shiitake spores, you’ll need to shock it to get it to start to fruit, either by hitting it hard with a hammer, or submerging it in really, really cold water for a couple of days.)

Kyle’s setup, which heats, humidifies and introduces filtered, sterile air into the mushrooms’ environment, outputs data on temperature, humidity, dew point and how long the setup has been running to a browser, creating handsome graphs to reassure the user that everything is tickety-boo inside the mushroom box.

mycodo-6h-browser-1024x600-1024x600

The results don’t speak for themselves, because they’re mushrooms, and mushrooms are vocally challenged. But they look pretty darn tasty.

oystermushrooms

Kyle has made a full build diary and detailed explanation of what’s going on in the chamber available at his website. Thanks Kyle!

*A long argument has been going on this afternoon over whether we should have gone with this title, or changed it to “A Fun Guy to be with”. Please let us know your preference in the comments.

We represent the Lollipop League

via Raspberry Pi

Thanks for bearing with us while we took the Easter break off – we return to you refreshed and full of chocolate.

The marvellous Spencer Organ, one of our Certified Educators, is a teacher at King Edward VI Sheldon Heath Academy (KESH Academy to its friends) in Birmingham. The school recently put on a student performance of The Wizard of Oz.

woz

Spencer was in charge of performance technology, and wanted to see if he could fit a Raspberry Pi in as special effects equipment. The Tin Man’s heart presented a perfect opportunity. Spencer used the Pimoroni Unicorn HAT with a Model A+ to make the Tin Man’s heart (which was made out of red foil back when I did the same play as a kid) a glowing, animated thing of wonder. For more on HATs, see James’ post from last year.

(Spencer sensibly tweaked the brightness settings; a Unicorn HAT at full blast is positively retina-searing.)

wizard-of-oz-heart

The heart was programmed to pulse, giving the audience the impression it was beating.

Spencer says:

The code was relatively simple and I used a simple list to assign the x,y and colour data for each pixel to be used.

myList1=[3,2,3,4,1,2,3,4,5,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,5,6,7,1,2,6]
myList2=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7]
myList3=[1,1,2,1,1,2,2,2,1,1,2,2,2,2,2,1,1,3,3,2,2,2,2,1,1,3,3,2,1,2,2,1,1,2,2,1,1,2,1,1,1,1]

To give the effect of the heart beating and pulsating I gradually changed the brightness of the pixels from about 30 – 80%. It was important not to go too bright as I could have blinded the audience or other cast members!

while True:
for bright in range (30,80):
UH.brightness(bright*0.01)
heart()

This gave a very passable beating effect which looked stunning on the stage. The Pi was powered with a portable battery pack and to make backstage life easier the code was activated from boot using crontab with:

@reboot sudo python /home/pi/Pimoroni/heart.py &

Spencer has made the Python script you’ll need to make your own available on his website; check out the Raspberry Pi section of his blog for more teaching and learning ideas with the Pi. Thanks Spencer!