Raspberry Pi Blog

This is the official Raspberry Pi blog for news and updates from the Raspberry Pi Foundation, education initiatives, community projects and more!

Raspberry Pi Chiptune Player

I have been staring at a blank screen for whole minutes. There are no words for just how much I love this project. I’ve already been on eBay to find a General Instrument AY-3-8910 series sound chip so I can play with one myself. Before we get into details, feast your ears.

vmw ay-3-8910 ym player

Raspeberry Pi Driving an AY-3-8910 sound chip It’s playing “intro2.ym” by Surgeon (Aleksy Lutsenko) More details on the setup can be found here: http://www.deater.net/weave/vmwprod/hardware/ay-3-8910/

What’s going on here? The Raspberry Pi is playing chiptunes by serving the files directly on to a AY-3-8910 (brought direct to you from the 1980s), while doing some rather jolly LED visualisation too.

The AY-3-8910 is no longer made: it was a piece of kit you’d find in most arcade machines, games consoles and home computers in the 1980s (if you had a ZX Spectrum, an Amstrad CPC or an Apple II, you’ll be familiar with its gorgeously grungy bleeps and bloops). Nowadays there’s dwindling stock that goes to service old machines, or to make entirely new things that’ll play chiptunes – like this beast.

chiptune player

Vince Weaver, the maker, says:

The AY-3-8910 is fairly straightforward. Three channels of square waves plus various noise and envelope effects. Provide a clock (1MHz in our case) and there are 16 (well, 14) on-chip registers you write to. Just put the address then the 8 bit value on the bus, toggle the 3 bus control pins, and you are set. You’ll want to do this fairly fast. A typical YM music file wants you to write all 14 registers every 50Hz.

I use the Pi’s GPIOs to shift an 8 bit value into a shift register. Then I use a few more to drive the control bus.

Visualization is done with some i2c LED displays.

The amplifier is an LM386 design from the AY-3-8910 datasheet.

Vince has plans to make some improvements (adding stereo, printing a PCB, swapping out for a better amplifier, using SPI to drive the shift register instead of GPIO and refining the software), but even in this prototype version, this is a piece of kit I’d love to have on my desk. Fortunately, we can replicate the project: everything you need is on Vince’s website and on GitHub. Thanks Vince!

39 Comments

Monk Makes Puppet Kit

A few weeks back, we were fortunate enough to be sent the Puppet Kit for Raspberry Pi, from our friend Simon Monk of Monk Makes. The kit shows you how to use your Raspberry Pi to take control of a traditional marionette, including controlling the puppet from your keyboard, recording stop-frame puppet movements, and setting the puppet up so that it waves when it detects movement. 

Given my limited experience of physical computing with a Raspberry Pi, I decided to take on the challenge of completing the kit, and documented my journey through Snapchat.

Monk Makes Puppet Kit

To boldly go…

Right out of the box, the kit feels as if it has been put together with care and thought. All wooden pieces have been laser cut, all components (apart from the Raspberry Pi itself) are provided, and the kit includes a step-by-step guide so foolproof that I felt confident I could complete the project. 

The only issue?

My intense fear of clowns, which was instantly triggered when I opened the box and saw the puppet itself:

Monk Makes Puppet

All the nope.

Despite my coulrophobia, I carried on with the build, because that’s how much you all mean to me, dear readers. I do these things for you.

The guide walked me through the project, with clear instructions supported by photographs and diagrams. It was only when I reached Step 16, “Run the Test Code”, that I realised I couldn’t find a mouse. Fortunately I was able to enlist the aid of Ben Nuttall, who has become my Raspberry Pi hero in cases such as this.

Ben Nuttall is my hero

Ben helped me to set the Pi up on the Pi Towers local network, allowing me to feed Simon’s code to the Pi via my MacBook. If you don’t have access to Ben and his heroic abilities, you could use the recently mentioned PiBakery from the legendary David Ferguson to preset the network details into Raspbian before setting up your Raspberry Pi.

After this, setting up the walking functionality of the puppet, plus the additional sensor, was a breeze. With very little previous experience of using GPIO pins, servos, and nightmare-inducing clown puppets, I was somewhat taken aback by how easy I found the process. In fact, by the end, I had the clown dancing a merry jig and waving to anyone who passed. Cute, right?

Making a Waving Puppet – Snapchat Story

We recently got our hands on the Monk Makes Puppet Kit and decided to have Alex build it.. despite her complete lack of coding knowledge. Seriously… she knows nothing. She’s the Jon Snow of Digital Making.

All in all, the kit was a wonderful experience and an interesting learning curve. Not only did it teach me the value of a well-executed and detailed maker kit, it also taught me the value of a Ben Nuttall, and helped me not to fear all clowns after having watched IT at a teenage slumber party like a fool!

*cries in a corner*

6 Comments

Desktop Sense HAT emulator

If this post gives you a sense of déjà-vu it’s because, last month, we announced a web-based Sense HAT emulator in partnership with US-based startup Trinket.

Today, we’re announcing another Sense HAT emulator designed to run natively on your Raspberry Pi desktop, instead of inside a browser. Developed by Dave Jones, it’s intended for people who own a Raspberry Pi but not a Sense HAT. In the picture below, the sliders are used to change the values reported by the sensors while your code is running.

sense-emu

So, why do we need two versions?

  • For offline use, possibly the most common way Raspberry Pis are used in the classroom.
  • To accommodate the oldest 256 MB models of Raspberry Pi which cannot run the web version.
  • To allow you to integrate your Sense HAT program with any available Python modules, or other Raspberry Pi features such as the Camera Module.

The emulator will come pre-installed in the next Raspbian release but, for now, you can just install it by typing the commands below into a terminal window:

sudo apt-get update
sudo apt-get install python-sense-emu python3-sense-emu python-sense-emu-doc sense-emu-tools -y

You can then access it from the Desktop menu, under Programming.

The emulator closely simulates the Sense HAT hardware being attached to your Pi. You can read from the sensors or write to the LED matrix using multiple Python processes, for example.

sense-idle

Write your code in IDLE as before; there are also a number of examples that can be opened from the emulator’s built-in menu. If you then want to port your code to a physical Sense HAT, you just need to change

sense_emu

to

sense_hat

at the top of your program. Reverse this if you’re porting a physical Sense HAT program to the emulator, perhaps from one of our educational resources; this step isn’t required in the web version of the emulator.

sense-emu-prefs

There are a number of preferences that you can adjust to change the behaviour of the emulator, most notably sensor simulation, otherwise known as jitter. This costs some CPU time, and is disabled by default on the low-end Raspberry Pis, but it provides a realistic experience of how the hardware sensors would behave. You’ll see that the values being returned in your code drift according to the known error tolerances of the physical sensors used on the Sense HAT.

This emulator will allow more Raspberry Pi users to participate in future Astro Pi competitions without having to buy a Sense HAT: ideal for the classroom where 15 Sense HATs may be beyond the budget.

So, where do you start? If you’re new to the Sense HAT, you can just copy and paste many of the code examples from our educational resources, like this one. You can also check out our e-book Sense HAT Essentials. For a complete list of all the functions you can use, have a look at the Sense HAT API reference here.

You can even install this emulator on other types of Linux desktop, such as Ubuntu! For more information on how to do this, please visit the emulator documentation pages here.

27 Comments

Ten millionth Raspberry Pi, and a new kit

When we started Raspberry Pi, we had a simple goal: to increase the number of people applying to study Computer Science at Cambridge. By putting cheap, programmable computers in the hands of the right young people, we hoped that we might revive some of the sense of excitement about computing that we had back in the 1980s with our Sinclair Spectrums, BBC Micros and Commodore 64s.

At the time, we thought our lifetime volumes might amount to ten thousand units – if we were lucky. There was was no expectation that adults would use Raspberry Pi, no expectation of commercial success, and certainly no expectation that four years later we would be manufacturing tens of thousands of units a day in the UK, and exporting Raspberry Pi all over the world.

Less than ten million Raspberry Pis

The first two thousand Raspberry Pis. Each Pi in this pallet now has 5000 siblings.

With this in mind, you can imagine how strange it feels to be able to announce that over the last four and a half years we’ve sold a grand total of ten million Raspberry Pis. Thanks to you, we’ve beaten our wildest dreams by three orders of magnitude, and we’re only just getting started. Every time you buy a Raspberry Pi, you help fund both our ongoing engineering work, and our educational outreach programs, including Code Club and Picademy.

Very early on, we decided that we would offer the bare-bones Raspberry Pi board without accessories: that way, cost-conscious customers get the lowest possible price, provided they can beg or borrow USB peripherals, a power supply and an SD card. Over the years, Raspberry Pi distributors have built on this, producing some fantastic bundles for people who would rather get everything they need from a single source.

To celebrate the ten millionth Raspberry Pi, for the first time we’ve put together our own idea of what the perfect bundle would look like, creating the official Raspberry Pi Starter Kit.

The starter kit, unboxed and ready to go

The starter kit, unboxed and ready to go

Inside the minimalist white box (like the official case, another beautiful Kinneir Dufort design), you’ll find:

  • A Raspberry Pi 3 Model B
  • An 8GB NOOBS SD card
  • An official case
  • An official 2.5A multi-region power supply
  • An official 1m HDMI cable
  • An optical mouse and a keyboard with high-quality scissor-switch action
  • A copy of Adventures in Raspberry Pi Foundation Edition

This is an unashamedly premium product: the latest Raspberry Pi, official accessories, the best USB peripherals we could find, and a copy of the highest-rated Raspberry Pi book. The kit is available to order online in the UK from our partners element14 and RS Components, priced at £99+VAT, and will be coming to the rest of the world, and to your favourite reseller, over the next few weeks.

159 Comments

Hallo Deutschland! The MagPi magazine has arrived in Germany

It gives me great pleasure to announce that The MagPi, the official Raspberry Pi magazine, is now available – fully translated and localised – in Germany, thanks to a collaboration with our friends at CHIP.

The cover of the first issue of the German version of the MagPi magazine, "das offizielle Raspberry Pi Magazin"

Germany was one of the first places outside the UK to take an interest in Raspberry Pi, so it’s quite fitting that it’s our first license. Eben Upton tells us more:

Germany is our third largest market so it seems natural that, after only 18 months, Germany should be the first country to get a localised version of The MagPi.

On a personal note, it’s particularly satisfying for me to see the MagPi launch in Germany, because as a child I used to import German Commodore Amiga magazines, which had so much more technical detail than their UK equivalents. The style of the MagPi is very reminiscent of these magazines: I hope that we’re in some sense “returning the favour,” and that German children of all ages (from 8-80) will be inspired to create exciting projects with Raspberry Pi and share them with the world.

The first issue is out right now everywhere you’d expect a cutting-edge technology magazine to be, not to mention available direct from CHIP’s online store.

Like the UK magazine, das offizielle Raspberry Pi Magazin features 100 pages of glossy Raspberry Pi goodness, but unlike its UK language counterpart it’s currently scheduled to run bi-monthly, so the next issue will be arriving on 2 November.

The magazine is available now for €9.95 in print or €6.50 on digital devices, and you can pick up a subscription for €54.80. Subscribers will also receive the same amazing free gift – a Raspberry Pi Zero and full cable bundle (including the camera ribbon cable). The free PDF edition will follow in 90 days.

A two-page spread from the magazine featuring photographs and text: "LEBENDIGE LEGOSTADT"

A two-page spread from the magazine, featuring text and code snippets: "PROGRAMMIEREN IN C: ERSTE SCHRITTE"

A two-page spread from the magazine, featuring photos and text: "WILDLIFE-KAMERA"

29 Comments

PiBakery – foolproof custom Raspbian setup

Everybody loves cake, right? Cakes have layers. Mmm…. cake! We’re sure you’ll also love PiBakery, a brand new way to bake Raspberry Pi images, which makes creating a custom image a… piece of cake.

blocks-on-workspace

PiBakery was created by David Ferguson. He’s a talented 17-year-old whom we first met at the Big Birthday event we held to celebrate four years of Pi back in February. He showed Liz and Eben a work-in-progress version of PiBakery, and they’ve been raving about it ever since.

This crafty program enables users to mix together a customised version of Raspbian with additional ingredients, and you need absolutely no experience with computers to set up your custom image.

In PiBakery, you drag and drop blocks (just like Scratch) to add extra components. PiBakery then mixes the latest version of Raspbian with its additional sprinkles, and flashes the result directly to an SD card.

PiBakery_script

“The idea for PiBakery came about when I went to a Raspberry Pi event,” says David. “I needed to connect my Pi to the network there, but didn’t have a monitor, keyboard, and mouse. I needed a way of adding a network to my Raspberry Pi that didn’t require booting it up and manually connecting.”

“PiBakery solves this issue,” he explains. “You can simply drag across the blocks that you want to use with your Raspberry Pi, and the SD card will be created for you.”

“If you’ve already made an SD card using PiBakery, you can insert that card back into your computer, and keep editing the blocks to add additional software, configure new wireless networks, and alter different settings,” says David. “All without having to find a monitor, keyboard, and mouse.”

PiBakery is available for Mac and Windows, with a Linux version on the way. It can be downloaded directly from its website. As well as the scripts and block interface, it contains the whole Raspbian installation, so the initial download takes quite a while. However, it makes the process of building and flashing SD cards remarkably simple.

PiBakery_success

David has written a guide to creating customised SD cards with PiBakery. It’s a very easy program to use, and we followed his guide to quickly build a custom version of Raspbian that connected straight to our local wireless network. Guess what: it worked first time.

Behind the scenes, PiBakery creates a set of scripts that run when the Raspberry Pi is powered on (either just the first time, or every time it is powered). These scripts can be used to set up and connect to a WiFi network, and activate SSH.

Other options include installing Apache, changing the user password, and running Python or command line scripts.

The user controls which scripts are used with the block-based interface. You drag and drop the tasks you want the Raspberry Pi to perform when it’s powered up. Piece of cake.

We love PiBakery, and cake. Did we mention cake?

 

71 Comments

Now with added cucumbers

Working here at Pi Towers, I’m always a little frustrated by not being able to share the huge number of commercial businesses’ embedded projects that use Raspberry Pis. (About a third of the Pis we sell go to businesses.) We don’t get to feature many of them on the blog; many organisations don’t want their work replicated by competitors, or aren’t prepared for customers and competitors to see how inexpensively they’re able to automate tasks. Every now and then, though, a company is happy to share what they’re using Pis for.

cucumber-farmer-3

Makoto Koike, centre, with his parents on the family cucumber farm

Here’s a great example: a cucumber farm in Japan, which is using a Raspberry Pi to sort thorny cucumbers, saving the farmer eight to nine hours’ manual work a day.

Makoto Koike is the son of farmers, who works as an embedded systems designer for the Japanese car industry. He started helping out at his parents’ cucumber farm (which he will be taking over when they retire), and spotted a process that was ripe for automation.

cucumber-farmer-7

Cucumbers from the Makotos’ farm

At the Makotos’ farm, cucumbers are graded into nine categories: the straightest, thickest, freshest, most vivid cucumbers (which must have plenty of characteristic spurs) are the best, and can be sold at the highest price. Makoto-san’s mother was in charge of sorting the cucumbers every day, which took eight hours at the peak of the harvest. Makoto-san had an epiphany after reading about Google’s AlphaGo beating the world number one professional Go player. He realised that machine learning and deep learning meant the sorting process could be automated, so he built a process using Google’s open-source machine learning library, TensorFlow, and some machinery to process the cucumbers into graded batches.

cucumber-farmer-10

Sorting in action

cucumber-farmer-6

Camera interface

Google have put together a diagram showing how the system works:

cucumber-farmer-14

There are difficulties in building this sort of system, not least the 7000 cucumbers, pre-graded by his mother, that Makoto-san had to photograph and label over a period of three months to give the model material to train with. He says:

“When I did a validation with the test images, the recognition accuracy exceeded 95%. But if you apply the system with real use cases, the accuracy drops down to about 70%. I suspect the neural network model has the issue of “overfitting” (the phenomenon in neural networks where the model is trained to fit only the small training dataset) because of the insufficient number of training images.”

Still, it’s an impressive feat, and a real-world >95% accuracy rate is not unfeasible with a big enough data set. We’d be interested to see how the setup progresses, especially as more automation is added; right now, cucumbers are added to the processing hopper by hand, and a human has to interact with the touchscreen grading panel. Here’s the system at work:

TensorFlow powered cucumber sorter by Makoto Koike

Uploaded by Kazunori Sato on 2016-08-05.

We’re hoping to see some updates from the Makoto family as the system evolves. And in the meantime, if you have an embedded project you’d like to share with us, let us know in the comments!

 

3 Comments

Identifying The Hallway Whistler

Becky Stern suffers from that same condition that many of us apartment dwellers are affected by: a curiosity about who is making noise outside the door.

Living within a large New York City apartment, Becky wanted to be able to see out of her peep hole without having to leave her desk. After all, the constant comings and goings of any shared property, though expected, can often be distracting.

(And seriously, whoever keeps slamming their door in my apartment block at 4am WILL suffer my wrath!)

So she decided to use a motion detector to trigger a Pi camera at her door. The camera would then stream live video back to a monitor within her apartment: a wireless peep hole, allowing her the freedom to be productive without having her eye to the door.

Peep Hole Cam

Becky used a Pi Zero for the project and took to the internet to educate herself on how to code a live streaming camera with motion detection. Tony D’s Cloud Cam tutorial gave her everything she needed to get the project working… and a handful of magnets, plus an old makeup bag, finished off the job.

Pi Zero Peep Hole Camera

Tutorial: http://www.instructables.com/id/Pi-Zero-Peep-Hole-Camera/ Subscribe for new videos Mondays and Thursdays! http://www.youtube.com/user/bekathwia previous video: https://youtu.be/p7uUcNFfP3Q tech playlist: https://www.youtube.com/playlist?list=PLxW5bBHPfdBzmynozxfEPv2DJgyoFiqgn this time last year: https://youtu.be/kZmyXzzXqfc Connect with Becky: http://www.instructables.com/member/bekathwia https://twitter.com/bekathwia http://instagram.com/bekathwia http://bekathwia.tumblr.com/ http://www.pinterest.com/bekathwia/ https://www.snapchat.com/add/bekathwia tip jar: https://www.patreon.com/beckystern Music is “Marxist Arrow” from the YouTube Music Library

Along with live streaming, the camera could be set up to take and upload photos and video to a cloud server; a handy tool to aid in home security. Taking the project further afield, she could allow remote access to the camera, allowing her to view the hallway while away from home. Did the delivery man leave your expected package? Which of the neighbours’ kids is the one trailing mud across the carpet?

And seriously… who keeps whistling every time they come home?!

12 Comments

Gran Check

New Zealander James Zingel recognised his mother’s concern over his grandmother’s well-being, and decided to do something about it.

Gran Check

For the Bay of Plenty Science Fair, the 14-year-old Bethlehem College student designed and built ‘Gran Check’, a Raspberry Pi-powered monitor that uses a PIR sensor to recognise his gran’s movement as she feeds her dogs, taking a photograph every morning to email back to his mother.

Gran Check

14-year-old James was concerned by the news of the elderly passing away unnoticed

James had researched similar builds on the market, noting their price was unrealistic for those with a lower budget. With the increase in average lifespans, plus upsetting reports of the elderly passing away unnoticed, he was determined to create something affordable and readily available to all, with little to no maintenance requirements.

 

Gran Check

A knob on the lid allows for the PIR sensitivity to be adjusted

The Gran Check lives within a wooden box, installed beside his grandmother’s dogs’ food. He knew it was the best location, since the dogs would never allow her to go a day without feeding them. For added peace of mind, James built the device to be self-sufficient, ensuring she’d never have to operate it herself.

James noted his grandmother’s independent nature, understanding that constant ‘check in’ calls from the family would be unrealistic. The Gran Check removes all concern for her welfare, without constantly bugging her for updates.

Gran Check

James credits the internet for much of his digital maker education

James was given a Raspberry Pi by his father, though he soon overtook the level of expertise on offer, and turned to YouTube and websites for help. 

James built the Gran Check over four weekends, and has ambitions to improve the build for others:

“I want to make it easy [to build], but also useful in loads of situations; it could also send a text message and attach a photo to it, for example. This would make sure that, for people in different situations, it’s not just one size fits all.”

It’s no surprise that James’s hard work was acknowledged. Not only did he win the award for best junior technology and best exhibit, but the 14-year-old also took home the NIWA Best in Fair Overall Winner.

To see James talking about Gran Check, and his plans for the build, visit the Bay of Plenty Times.

We look forward to seeing what’s next for James and Gran Check.

11 Comments

Building Computer Labs in Western Africa

Back in 2014, Helen covered the story of Dominique Laloux and the first Raspberry Pi computer room in Togo, West Africa.

Having previously worked alongside friends to set up the Kuma Computer Center, Dominique and the team moved on to build another computer room in Kuma Adamé.

Both builds were successful, proving the need for such resources within an area where, prior to 2012, 75% of teachers had never used a computer.

Dominique has since been back in contact via our forum; he informed us of another successful build, again in Togo, converting an old toilet block into a Raspberry Pi computer lab.

Togo RPi Lab

The blank canvas…

The team had their work cut out, stripping the building of its inner walls, laying down a new concrete floor, and installing windows. 

Togo RPi

Some serious climbing was needed…

Electricity and LAN were installed next, followed by welded tables and, eventually, the equipment.

Togo RPi

Local teachers and students helped to set up the room

The room was finally kitted out with 21 Raspberry Pis. This would allow for one computer per student, up to a maximum of 20, as well as one for the teacher’s desk, which would power an LED projector.

The room also houses a laptop with a scanner, and a networked printer.

The project took four weeks to complete, and ended with a two-week training session for 25 teachers. 

Togo RPi

Forget the summer holidays: each teacher showed up every day

Dominique believes very strongly in the project, and in the positive influence it has had on the area. He writes:

I am now convinced that the model of Raspberry Pi computer labs is an ideal solution to bring ICT to small schools in developing countries, where resources are scarce.

Not only is he continuing to raise funds to build more labs, he’s also advising other towns who want to build their own. Speaking of the growth of awareness over the past year, he explained, “I was so happy to advise another community 500 km away on how to install their own microcomputer room, based on the same model.”

And his future plans?

My goal is now to raise enough funds to set up one computer room in a school each year for the foreseeable future, hoping that other communities will want to copy the model and build their own at the same time.

We love seeing the progress Dominique and his team have made as they continue to build these important labs for communities in developing countries. Dominique’s hard work and determination is inspiring, and we look forward to seeing the students he and his team have helped to nurture continue to learn.

Togo RPi

5 Comments