Visualising core load on the Pi 2

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!

 

8 Comments

Amazonian rainforest simulation

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.

18 Comments

Raspberry Pi Powered Minion Fart Gun Machine

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.)

2 Comments

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

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.

7 Comments

Launching Picademy@Google Leeds

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.

“Google.org has supported the Raspberry Pi Foundation for the past two years in its mission to equip primary schoolchildren with affordable computers and has been impressed with their outcomes,” said Jacquelline Fuller, director of Google.org. “Raspberry Pi is leading the charge on what it takes to teach children computational skills but perhaps more importantly how to equip teachers with much-needed subject matter expertise. We’re thrilled to support them again.”

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 for six months, and we’ll be running a number of Picademy@Google courses there, so start spreading the news: sign-ups for teachers are open!

18 Comments

TyFone – a DIY Smartphone

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 his 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.

typhone

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

20 Comments

LEGO spectrometers

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.

12 Comments

DIY home alert system

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!

11 Comments

Growing things in the (mushroom) cloud*

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.

20 Comments

We represent the Lollipop League

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!

10 Comments