Tag Archives: Raspberry Pi Zero/Zero W

Listen to World War II radio recordings with a Raspberry Pi Zero

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/listen-to-world-war-ii-radio-recordings-with-a-raspberry-pi-zero/

With the 50th anniversary of the D-Day landings very much in the news this year, Adam Clark found himself interested in all things relating to that era. So it wasn’t long before he found himself on the Internet Archive listening to some of the amazing recordings of radio broadcasts from that time. In this month’s HackSpace magazine, Adam details how he built his WW2 radio-broadcast time machine using a Raspberry Pi Zero W, and provides you with the code to build your own.

As good as the recordings on the Internet Archive were, it felt as if something was missing by listening to them on a modern laptop, so I wanted something to play them back on that was more evocative of that time, and would perhaps capture the feeling of listening to them on a radio set.

I also wanted to make the collection portable and to make the interface for selecting and playing the tracks as easy as possible – this wasn’t going to be screen-based!

Another important consideration was to house the project in something that would not look out of place in the living room, and not to give away the fact that it was being powered by modern tech.

So I came up with the idea of using an original radio as the project case, and to use as many of the original knobs and dials as possible. I also had the idea to repurpose the frequency dial to select individual years of the war and to play broadcasts from whichever year was selected.

Of course, the Raspberry Pi was immediately the first option to run all this, and ideally, I wanted to use a Raspberry Pi Zero to keep the costs down and perhaps to allow expansion in the future outside of being a standalone playback device.

Right off the bat, I knew that I would have a couple of obstacles to overcome as the Raspberry Pi Zero doesn’t have an easy way to play audio out, and I also wanted to have analogue inputs for the controls. So the first thing was to get some audio playing to see if this was possible.

Audio playback

The first obstacle was to find a satisfactory way to playback audio. In the past, I have had some success using PWM pins, but this needs a low-pass filter as well as an amplifier, and the quality of audio was never as good as I’d hoped for.

The other alternative is to use one of the many HATs available, but these come at a price as they are normally aimed at more serious quality of audio. I wanted to keep the cost down, so these were excluded as an option. The other option was to use a mono I2S 3W amplifier breakout board – MAX98357A from Adafruit – which is extremely simple to use.

As the BBC didn’t start broadcasting stereo commercially until the late 1950s, this was also very apt for the radio (which only has one speaker).
Connecting up this board is very easy – it just requires three GPIO pins, power, and the speaker. For this, I just soldered some female jumper leads to the breakout board and connected them to the header pins of the Raspberry Pi Zero. There are detailed instructions on the Adafruit website for this which basically entails running their install script.

I’d now got a nice playback device that would easily play the MP3 files downloaded from archive.org and so the next task was to find a suitable second-hand radio set.

Preparing the case

After a lot of searching on auction sites, I eventually found a radio that was going to be suitable: wasn’t too large, was constructed from wood, and looked old enough to convince the casual observer. I had to settle for something that actually came from the early 1950s, but it drew on design influences from earlier years and wasn’t too large as a lot of the real period ones tended to be (and it was only £15). This is a fun project, so a bit of leeway was fine by me in this respect.

When the radio arrived, my first thought as a tinkerer was perhaps I should get the valves running, but a quick piece of research turned up that I’d probably have to replace all the resistors and capacitors and all the old wiring and then hope that the valves still worked. Then discovering that the design used a live chassis running at 240 V soon convinced me that I should get back on track and replace everything.

With a few bolts and screws removed, I soon had an empty case.

I then stripped out all the interior components and set about restoring the case and dial glass, seeing what I could use by way of the volume and power controls. Sadly, there didn’t seem to be any way to hook into the old controls, so I needed to design a new chassis to mount all the components, which I did in Tinkercad, an online 3D CAD package. The design was then downloaded and printed on my 3D printer.

It took a couple of iterations, and during this phase, I wondered if I could use the original speaker. It turned out to be absolutely great, and the audio took on a new quality and brought even more authenticity to the project.

The case itself was pretty worn and faded, and the varnish had cracked, so I decided to strip it back. The surface was actually veneer, but you can still sand this. After a few applications of Nitromors to remove the varnish, it was sanded to remove the scratches and finished off with fine sanding.

The wood around the speaker grille was pretty cracked and had started to delaminate. I carefully removed the speaker grille cloth, and fixed these with a few dabs of wood glue, then used some Tamiya brown paint to colour the edges of the wood to blend it back in with the rest of the case. I was going to buy replacement cloth, but it’s fairly pricey – I had discovered a trick of soaking the cloth overnight in neat washing-up liquid and cold water, and it managed to lift the years of grime out and give it a new lease of life.

At this point, I should have just varnished or used Danish oil on the case, but bitten by the restoration bug I thought I would have a go at French polishing. This gave me a huge amount of respect for anyone that can do this properly. It’s messy, time-consuming, and a lot of work. I ended up having to do several coats, and with all the polishing involved, this was probably one of the most time-consuming tasks, plus I ended up with some pretty stained fingers as a result.

The rest of the case was pretty easy to clean, and the brass dial pointer polished up nice and shiny with some Silvo polish. The cloth was glued back in place, and the next step was to sort out the dial and glass.

Frequency, volume, glass, and knobs

Unfortunately, the original glass was cracked, so a replacement part was cut from some Makrolon sheet, also known as Lexan. I prefer this to acrylic as it’s much easier to cut and far less likely to crack when drilling it. It’s used as machine guards as well and can even be bent if necessary.

With the dial, I scanned it into the PC and then in PaintShop I replaced the existing frequency scale with a range of years running from 1939 to 1945, as the aim was for anyone using the radio to just dial the year they wanted to listen to. The program will then read the value of the potentiometer, and randomly select a file to play from that year.

It was also around about now that I had to come up with some means of having the volume control the sound and an interface for the frequency dial. Again there are always several options to consider, and I originally toyed with using a couple of rotary encoders and using one of these with the built-in push button as the power switch, but eventually decided to just use some potentiometers. Now I just had to come up with an easy way to read the analogue value of the pots and get that into the program.

There are quite a few good analogue-to-digital boards and HATs available, but with simplicity in mind, I chose to use an MCP3002 chip as it was only about £2. This is a two-channel analogue-to-digital converter (ADC) and outputs the data as a 10-bit value onto the SPI bus. This sounds easy when you say it, but it proved to be one of the trickier technical tasks as none of the code around for the four-channel MCP3008 seemed to work for the MCP3002, nor did many of the examples that were around for the MCP3002 – I think I went through about a dozen examples. At long last, I did find some code examples that worked, and with a bit of modification, I had a simple way of reading the values from the two potentiometers. You can download the original code by Stéphane Guerreau from GitHub. To use this on your Raspberry Pi, you’ll also need to run up raspi-config and switch on the SPI interface. Then it is simply a case of hooking up the MCP3002 and connecting the pots between the 3v3 line and ground and reading the voltage level from the wiper of the pots. When coding this, I just opted for some simple if-then statements in cap-Python to determine where the dial was pointing, and just tweaked the values in the code until I got each year to be picked out.

Power supply and control

One of the challenges when using a Raspberry Pi in headless mode is that it likes to be shut down in an orderly fashion rather than just having the power cut. There are lots of examples that show how you can hook up a push button to a GPIO pin and initiate a shutdown script, but to get the Raspberry Pi to power back up you need to physically reset the power. To overcome this piece of the puzzle, I use a Pimoroni OnOff SHIM which cleverly lets you press a button to start up, and then press and hold it for a second to start a shutdown. It’s costly in comparison to the price of a Raspberry Pi Zero, but I’ve not found a more convenient option. The power itself is supplied by using an old power bank that I had which is ample enough to power the radio long enough to be shown off, and can be powered by USB connector if longer-term use is required.

To illuminate the dial, I connected a small LED in series with a 270R resistor to the 3v3 rail so that it would come on as soon as the Raspberry Pi received power, and this lets you easily see when it’s on without waiting for the Raspberry Pi to start up.

The code






If you’re interested in the code Adam used to build his time machine, especially if you’re considering making your own, you’ll find it all in this month’s HackSpace magazine. Download the latest issue for free here, subscribe for more issues here, or visit your local newsagent or the Raspberry Pi Store, Cambridge to pick up the magazine in physical, real-life, in-your-hands print.

The post Listen to World War II radio recordings with a Raspberry Pi Zero appeared first on Raspberry Pi.

We love a good pen plotter

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/we-love-a-good-pen-plotter/

BrachioGraph touts itself as the cheapest, simplest possible pen plotter, so, obviously, we were keen to find out more. Because, if there’s one thing we like about our community, it’s your ability to recreate large, expensive pieces of tech with a few cheap components and, of course, a Raspberry Pi.

So, does BrachioGraph have what it takes? Let’s find out.

Raspberry Pi pen plotter

The project ingredients list calls for two sticks or pieces of stiff card and, right off the bat, we’re already impressed with the household item ingenuity that had gone into building BrachioGraph. It’s always fun to see Popsicle sticks used in tech projects, and we reckon that a couple of emery boards would also do the job  although a robot with add-on nail files sounds a little too Simone Giertz, if you ask us. Simone, if you’re reading this…

You’ll also need a pencil or ballpoint pen, a peg, three servomotors, and a $5 Raspberry Pi Zero. That’s it. They weren’t joking when they said this plotter was simple.

The plotter runs on a Python script, and all the code for the project has been supplied for free. You can find it all on the BrachioGraph website, here.

We’ll be trying out the plotter for ourselves here at Pi Towers, and we’d love to see if any of you give it a go, so let us know in the comments.

 

The post We love a good pen plotter appeared first on Raspberry Pi.

Estefannie’s Jurassic Park goggles

Post Syndicated from Helen Lynn original https://www.raspberrypi.org/blog/estefannies-jurassic-park-goggles/

When we invited Estefannie Explains It All to present at Coolest Projects International, she decided to make something cool with a Raspberry Pi to bring along. But being Estefannie, she didn’t just make something a little bit cool. She went ahead and made Raspberry Pi Zero-powered Jurassic Park goggles, or, as she calls them, the world’s first globally triggered, mass broadcasting, photon-emitting and -collecting head unit.

Make your own Jurassic Park goggles using a Raspberry Pi // MAKE SOMETHING

Is it heavy? Yes. But these goggles are not expensive. Follow along as I make the classic Jurassic Park Goggles from scratch!! The 3D Models: https://www.thingiverse.com/thing:3732889 My code: https://github.com/estefanniegg/estefannieExplainsItAll/blob/master/makes/JurassicGoggles/jurassic_park.py Thank you Coolest Projects for bringing me over to speak in Ireland!! https://coolestprojects.org/ Thank you Polymaker for sending me the Polysher and the PolySmooth filament!!!!

3D-printing, sanding, and sanding

Estefannie’s starting point was the set of excellent 3D models of the iconic goggles that Jurassicpaul has kindly made available on Thingiverse. There followed several 3D printing attempts and lots of sanding, sanding, sanding, spray painting, and sanding, then some more printing with special Polymaker filament that can be ethanol polished.

Adding the electronics and assembling the goggles

Estefannie soldered rings of addressable LEDs and created custom models for 3D-printable pieces to fit both them and the goggles. She added a Raspberry Pi Zero, some more LEDs and buttons, an adjustable headgear part from a welding mask, and – importantly – four circles of green acetate. After quite a lot of gluing, soldering, and wiring, she ended up with an entirely magnificent set of goggles.

Here, they’re modelled magnificently by Raspberry Pi videographer Brian. I think you’ll agree he cuts quite a dash.

Coding and LED user interface

Estefannie wrote a Python script to interact with Twitter, take photos, and provide information about the goggles’ current status via the LED rings. When Estefannie powers up the Raspberry Pi, it runs a script on startup and connects to her phone’s wireless hotspot. A red LED on the front of the goggles indicates that the script is up and running.

Once it’s running, pressing a button at the back of the head unit makes the Raspberry Pi search Twitter for mentions of @JurassicPi. The LEDs light up green while it searches, just like you remember from the film. If Estefannie’s script finds a mention, the LEDs flash white and the Raspberry Pi camera module takes a photo. Then they light up blue while the script tweets the photo.




All the code is available on Estefannie’s GitHub. I love this project – I love the super clear, simple user experience provided by the LED rings, and there’s something I really appealing about the asynchronous Twitter interaction, where you mention @JurassicPi and then get an image later, the next time googles are next turned on.

Extra bonus Coolest Projects

If you read the beginning of this post and thought, “wait, what’s Coolest Projects?” then be sure to watch to the end of Estefannie’s video to catch her excellentCoolest Projects mini vlog. And then sign up for updates about Coolest Projects events near you, so you can join in next year, or help a team of young people to join in.

The post Estefannie’s Jurassic Park goggles appeared first on Raspberry Pi.

Tracking the Brecon Beacons ultramarathon with a Raspberry Pi Zero

Post Syndicated from Helen Lynn original https://www.raspberrypi.org/blog/tracking-the-brecon-beacons-ultramarathon-with-a-raspberry-pi-zero/

On my holidays this year I enjoyed a walk in the Brecon Beacons. We set out nice and early, walked 22km through some of the best scenery in Britain, got a cup of tea from the snack van on the A470, and caught our bus home. “I enjoyed that walk,” I thought, “and I’d like to do one like it again.” What I DIDN’T think was, “I’d like to do that walk again, only I’d like it to be nearly three times as long, and it definitely ought to have about three times more ascent, or else why bother?”

Alan Peaty is a bit more hardcore than me, so, a couple of weekends ago, he set out on the Brecon Beacons 10 Peaks Ultramarathon: “10 peaks; 58 kilometres; 3000m of ascent; 24 hours”. He went with his friend Neil and a Raspberry Pi Zero in an eyecatching 3D-printed case.

A green 3D-printed case with a Raspberry Pi sticker on it, on a black backpack leaning against a cairn. In the background are a sunny mountain top, distant peaks, and a blue sky with white clouds.

“The brick”, nestling on a backpack, with sunlit Corn Du and Pen y Fan in the background

The Raspberry Pi Zero ensemble – lovingly known as the brick or, to give it its longer name, the Rosie IoT Brick or RIoT Brick – is equipped with a u-blox Neo-6 GPS module, and it also receives GPS tracking info from some smaller trackers built using ESP32 microcontrollers. The whole lot is powered by a “rather weighty” 20,000mAh battery pack. Both the Raspberry Pi and the ESP32s were equipped with “all manner of additional sensors” to track location, temperature, humidity, pressure, altitude, and light level readings along the route.

Charts showing temperature, humidity & pressure, altitude, and light levels along the route, together with a route map

Where the route crosses over itself is the most fervently appreciated snack van in Wales

Via LoRa and occasional 3G/4G from the many, many peaks along the route, all this data ends up on Amazon Web Services. AWS, among other things, hosts an informative website where family members were able to keep track of Alan’s progress along windswept ridges and up 1:2 gradients, presumably the better to appreciate their cups of tea and central heating. Here’s a big diagram of how the kit that completed the ultramarathon fits together; it’s full of arrows, dotted lines, and acronyms.

Alan, Neil, the brick, and the rest of their gear completed the event in an impressive 18 hours and one minute, for which they got a medal.

The brick, a small plastic box full of coloured jumper leads and other electronics; the lid of the box; and a medal consisting of the number 10 in large plastic characters on a green ribbon

Well earned

You can follow the adventures of this project, its antecedents, and the further evolutions that are doubtless to come, on the Rosie the Red Robot Twitter feed. And you can find everything to do with the project in this GitHub repository, so you can complete ultramarathons while weighed down with hefty power bricks and bristling with homemade tracking devices, too, if you like. Alan is raising money for Alzheimer’s Research UK with this event, and you can find his Brecon Beacons 10 Peaks JustGiving page here.

The post Tracking the Brecon Beacons ultramarathon with a Raspberry Pi Zero appeared first on Raspberry Pi.

Retrofit a vintage camera flash with a Raspberry Pi Camera Module

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/retrofit-vintage-camera-flash-with-camera-module/

Wanting to break from the standard practice of updating old analogue cameras with digital technology, Alan Wang decided to retrofit a broken vintage camera flash with a Raspberry Pi Zero W to produce a video-capturing action cam.

Raspberry Pi Zero Flash Cam Video Test

Full story of this project: https://www.hackster.io/alankrantas/raspberry-pi-zero-flash-cam-359875

By hacking a somewhat gnarly hole into the body of the broken flash unit, Alan fit in the Raspberry Pi Zero W and Camera Module, along with a few other components. He powers the whole unit via a USB power bank.

At every touch of the onboard touchpad, the retrofit camera films 12 seconds of footage and saves it as an MP4 file on the onboard SD card or an optional USB flash drive.

While the project didn’t technically bring the flash unit back to life — as the flash function is still broken — it’s a nice example of upcycling old tech, and it looks pretty sweet. Plus, you can attach it to your existing film camera to produce some cool side-by-side comparison imagery, as seen in the setup above.

For a full breakdown of the build, including the code needed to run the camera, check out the project’s Hackster.io page.

The post Retrofit a vintage camera flash with a Raspberry Pi Camera Module appeared first on Raspberry Pi.

Build your own Raspberry Pi night vision camera

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/build-your-own-raspberry-pi-night-vision-camera/

A Raspberry Pi Zero W, Pimoroni HyperPixel screen, and Raspberry Pi IR Camera Module are all you need to build this homemade night vision camera.

How to build a night vision camera

How to build a night vision camera, video showing the process and problems that I came across when building this camera

Raspberry Pi night vison camera

Built into the body of an old camera flash, Dan’s Raspberry Pi night vision camera is a homage to a childhood spent sneaking around the levels of Splinter Cell. Says Dan:

The iconic image from the game is the night vision goggles that Sam Fisher wears. I have always been fascinated by the idea that you can see in the dark and this formed the foundation of my idea to build a portable hand-held night vision piece of equipment.

The camera, running on Raspbian, boasts several handy functions, including touchscreen controls courtesy of the Pimoroni HyperPixel, realtime video and image capture, and a viewing distance of two to five metres.

It’s okay to FAIL

Embracing the FAIL (First Attempt In Learning) principle, Dan goes into detail about the issues he had to overcome while building the camera, which is another reason why we really enjoyed this project. It’s okay to fail when trying your hand at digital making, because you learn from your mistakes! Dan’s explanations of the struggles he faced and how he overcame them are 👌.

For a full rundown of the project and tips on building your own, check out its Hackster.io page.

The post Build your own Raspberry Pi night vision camera appeared first on Raspberry Pi.

Real-time train station departure board

Post Syndicated from Liz Upton original https://www.raspberrypi.org/blog/real-time-train-station-arrival-board/

All across the UK, you’ll find train departure boards on station platforms that look like this:

They’ve looked this way for as long as I can remember (before they were digital dot-matrix displays, they were made from those flappy bits of plastic with letters of the alphabet and numbers printed on them, which whirled round like a Rolodex; they still look very similar). If you’re a frequent train traveller in the UK, you probably have a weird emotional response to seeing one of these. Mine is largely one of panic about being late.

Some people have a more…benign relationship with trains than I do, like Chris Crocker-White, who has adapted a build tweeted by Chris Hutchinson to make a miniature departure board for his desk. Here’s the tweet that started it all:

Chris Hutchinson on Twitter

Pretty hyped about my most recent @Raspberry_Pi project – a realistic, real-time, train departure board I’ve open sourced the software over at: https://t.co/vGQzagsSpi Next step: find a case and make it a permanent fixture! https://t.co/HEXgzdH8TS

Chris C-W’s build is similar, but has a couple of very neat upgrades, including some back-end software work (his build runs in Docker on balenaCloud, to make configuration easier), and some work on the display, which he’s tweaked to use 1:1 pixel mapping of the fonts and avoid any scaling, so the tiny board looks more like the dot-matrix LED displays you’ll see when you visit the station. You can see the difference in the image below:

 

Chris seems to be using his board as a piece of desktop furniture, where it looks terrific, but model train or narrow-gauge enthusiasts should be all over this project too; it’s a lovely way to inject some realism into a miniature setup. You can find a very complete guide to making your own here.

Now, if you’ll excuse me, I have a train to catch.

 

 

The post Real-time train station departure board appeared first on Raspberry Pi.

Build Demolition Man’s verbal morality ticketing machine

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/build-demolition-mans-verbal-morality-ticketing-machine/

In the 1993 action movie Demolition Man, Sylvester Stallone stars as a 1990s cop transported to the near-future. Technology plays a central role in the film, often bemusing the lead character. In a memorable scene, he is repeatedly punished by a ticketing machine for using bad language (a violation of the verbal morality statute).

In the future of Demolition Man, an always-listening government machine detects every banned word and issues a fine in the form of a receipt from a wall-mounted printer. This tutorial shows you how to build your own version using Raspberry Pi, the Google Voice API, and a thermal printer. Not only can it replicate detecting banned words, but it also doubles as a handy voice-to-paper stenographer (if you want a more serious use).

Prepare the hardware

We built a full ‘boxed’ project, but you can keep it simple if you wish. Your Raspberry Pi needs a method for listening, speaking, and printing. The easiest solution is to use USB for all three.

After prototyping using Raspberry Pi 4 and various USB devices, we settled on Raspberry Pi Zero W with a small USB mic and Pimoroni Speaker pHAT to save space. A Pico HAT Hacker allowed the connection of both the printer and Speaker pHAT, as they don’t share GPIO pins. This bit of space-saving means we could install the full assembly inside the 3D-printed case along with the printer.

Connect the printer

To issue our receipts we used a thermal printer, the kind found in supermarket tills. This particular model is surprisingly versatile, handling text and graphics.

It takes standard 2.25-inch (57mm) receipt paper, available in rolls of 15 metres. When printing, it does draw a lot of current, so we advise using a separate power supply. Do not attempt to power it from your Raspberry Pi. You may need to fit a barrel connector and source a 5V/1.5A power supply. The printer uses a UART/TTL serial connection, which neatly fits on to the GPIO. Although the printer’s connection is listed as being 5V, it is in fact 3.3V, so it can be directly connected to the ground, TX, and RX pins (physical pins 6, 8, 10) on the GPIO.

Install and configure Raspbian

Get yourself a copy of Raspbian Buster Lite and burn it to a microSD card using a tool like Etcher. You can use the full version of Buster if you wish. Perform the usual steps of getting a wireless connection and then updating to the latest version using sudo apt update && sudo apt -y upgrade. From a command prompt, run sudo raspi-config and go to ‘Interfacing options’, then ‘Enable serial’. When asked if you would like the login shell to be accessible, respond ‘No’. To the next question, ‘Would you like the serial port hardware to be enabled?’, reply ‘Yes’. Now reboot your Raspberry Pi.

Test the printer

Make sure the printer is up and running. Double-check you’ve connected the header to the GPIO correctly and power up the printer. The LED on the printer should flash every few seconds. Load in the paper and make sure it’s feeding correctly. We can talk to the printer directly, but the Python ‘thermalprinter‘ library makes coding for it so much easier. To install the library:

sudo apt install python3-pip
pip3 install thermalprinter

Create a file called printer.py and enter in the code in the relevant listing. Run the code using:

python3 printer.py

If you got a nice welcoming message, your printer is all set to go.

Test the microphone

Once your microphone is connected to Raspberry Pi, check the settings by running:

alsamixer

This utility configures your various sound devices. Press F4 to enter ‘capture’ mode (microphones), then press F6 and select your device from the list. Make sure the microphone is not muted (M key) and the levels are high, but not in the red zone.

Back at the command line, run this command:

arecord -l

This shows a list of available recording devices, one of which will be your microphone. Make a note of the card number and subdevice number.

To make a test recording, enter:

arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 test.wav

If your card and subdevice numbers were not ‘0,1’, you’ll need to change the device parameter in the above command.

Say a few words, then use CTRL+C to stop recording. Check the playback with:

aplay test.wav

Choose your STT provider

STT means speech to text and refers to the code that can take an audio recording and return recognised speech as plain text. Many solutions are available and can be used in this project. For the greatest accuracy, we’re going to use Google Voice API. Rather than doing the complex processing locally, a compressed version of the sound file is uploaded to Google Cloud and the text returned. However, this does mean Google gets a copy of everything ‘heard’ by the project. If this isn’t for you, take a look at Jasper, an open-source alternative that supports local processing.

Create your Google project

To use the Google Cloud API, you’ll need a Google account. Log in to the API Console at console.developers.google.com. We need to create a project here. Next to ‘Google APIs’, click the drop-down menu, then ‘New Project’. Give it a name. You’ll be prompted to enable APIs for the project. Click the link, then search for ‘speech’. Click on ‘Cloud Speech-to-Text API’, then ‘Enable’. At this point you may be prompted for billing information. Don’t worry, you can have up to 60 minutes of audio transcribed for free each month.

Get your credentials

Once the Speech API is enabled, the screen will refresh and you’ll be prompted to create credentials. This is the info our code needs to be granted access to the speech-to-text API. Click on ‘Create Credentials’ and on the next screen select ‘Cloud Speech-to-text API’. You’re asked if you’re planning to use the Compute Engine; select ‘no’. Now create a ‘service account’. Give it a different name from the one used earlier, change the role to ‘Project Owner’, leave the type of file as ‘JSON’, and click ‘Continue’. A file will be downloaded to your computer; transfer this to your Raspberry Pi.

Test Google recognition

When you’re happy with the recording levels, record a short piece of speech and save it as test.wav. We’ll send this to Google and check our access to the API is working. Install the Google Speech-To-Text Python library:

sudo apt install python3-pyaudio
pip3 install google-cloud-speech

Now set an environment variable that the libraries will use to locate your credentials JSON:

export GOOGLE_APPLICATION_CREDENTIALS="/home/pi/[FILE_NAME].json"

(Don’t forget to replace [FILE_NAME] with the actual name of the JSON file).

Using a text editor, create a file called speech_to_text.py and enter the code from the relevant listing. Then run it:

python3 speech_to_text.py

If everything is working correctly, you’ll get a text transcript back within a few seconds.

Live transcription

Amazingly, Google’s speech-to-text service can also support streaming recognition, so rather than capture-then-process, the audio can be sent as a stream, and a HTTP stream of the recognised text comes back. When there is a pause in the speech, the results are finalised, so then we can send the results to the printer. If all the code you’ve entered so far is running correctly, all you need to do is download the stenographer.py script and start it using:

python3 stenographer.py

You are limited on how long you can record for, but this could be coupled with a ‘push to talk’ button so you can make notes using only your voice!

Banned word game

Back to Demolition Man. We need to make an alarm sound, so install a speaker (a passive one that connects to the 3.5mm jack is ideal; we used a Pimoroni Speaker pHAT). Download the banned.py code and edit it in your favourite text editor. At the top is a list of words. You can change this to anything you like (but don’t offend anyone!). In our list, the system is listening for a few mild naughty words. In the event anyone mentions one, a buzzer will sound and a fine will be printed.

Make up your list and start the game by running:

python3 banned.py

Now try one of your banned words.

Package it up

Whatever you decide to use this project for, why not finish it up with a 3D-printed case so you package up the printer and Raspberry Pi with the recording and playback devices and create a portable unit? Ideal for pranking friends or taking notes on the move!

See if you can invent any other games using voice recognition, or investigate the graphics capability of the printer. Add a Raspberry Pi Camera Module for retro black and white photos. Combine it with facial recognition to print out an ID badge just using someone’s face. Over to you.

The MagPi magazine issue 84

This project was created by PJ Evans for The MagPi magazine issue 84, available now online, from your local newsagents, or as a free download from The MagPi magazine website.

The post Build Demolition Man’s verbal morality ticketing machine appeared first on Raspberry Pi.

Raspberry Pi internet kill switch

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/internet-kill-switch/

Control the internet in your home with this handy Raspberry Pi Zero W internet kill switch.

Internet Kill Switch!

It’s every teenager’s worst nightmare… no WIFI! I built a standalone wireless Internet Kill Switch that lets me turn the Internet off whenever I want. A Raspberry Pi Zero W monitors the switch and sends an alert via SSH over WIFI to my firewall where another script watches for the alert and turns the external interface off or on.

Internet in my home wasn’t really a thing until I was in my late teens, and even then, there wasn’t that much online fun to be had. Not like there is now, with social media and online gaming and the YouTubes.

If I’d had access to the internet of today in my teens, I’m pretty sure I’d have never been off the thing. And that’s where a button like this would have been a godsend for my mother.

Shared by Nick Donaldson on his YouTube account, the Internet Kill Switch is a Raspberry Pi Zero W–powered emergency button that turns off all internet access in the house — perfect for keeping online activities to a reasonable level. Nick explains:

It’s every teenager’s worst nightmare… no WiFi! I built a standalone wireless Internet Kill Switch that lets me turn the internet off whenever I want. A Raspberry Pi Zero W monitors the switch and sends an alert via SSH over WiFi to my firewall, where another script watches for the alert and turns the external interface off or on. I have challenged the boys to hack it…

The Raspberry Pi Zero W sits snug within the button casing and is powered by a battery. And so that the battery can be continuously recharged, the device sits on a wireless charging pad. Hence, the button is juiced up and ready to go at any time.

I can pick it up, walk around at any time, threaten the teenagers, and shut down the internet whenever I want, hahaha!

While internet service providers are starting to roll out smartphone apps that offer similar functionality, we like the physicality of this button.

Great job, Nick! Please don’t turn off our internet.

The post Raspberry Pi internet kill switch appeared first on Raspberry Pi.

Raspberry Pi Zero white noise night light

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/raspberry-pi-zero-white-noise-night-light/

Many members of the Raspberry Pi team have small children. As such, many members of the Raspberry Pi team are constantly tired and walking around like zombies — loving, productive zombies humming Baby Shark while scrubbing food stains off their clothing.

Whenever a Raspberry Pi project appears on social media that aids parents do the simple things in life — such as getting sleep or finding time to eat, breathe, shower, etc. — it’s an instant hit around the office.

White noise night light for unrelenting children

This is why, while setting up my desk this morning, I heard an “Oooo, white noise nightlight!” cheer from behind me and turned to find Liz checking out this new project from Instructables maker Cary Ciavolella.

This is a project I made for my 1-year-old for Christmas. Honestly, though, it was a sanity present for me and my wife. It’s a white noise machine that can play multiple different sounds selected through a web interface, and also incorporates lights that change color based on the time (red lights mean be in bed, yellow mean you can play in your room, and green means it’s ok to come out). Since my son is too young to tell time, a color-based night light seemed like a really good idea.

As Cary has kindly provided all the code for the project, it’s a fairly easy build to replicate at home and looks like it’ll do the trick.

The device uses a Raspberry Pi Zero W, Blinkt, and Speaker pHAT from Pimoroni, and a handful of wires. Building it requires some basic soldering skills. If you’re unsure about your soldering skills, our handy video guide is all you need to get started.

How to solder your Raspberry Pi header pins

Learn the basics of how to solder components together, and the safety precautions you need to take.

The white noise files are selectable via a flask webserver hosted on the Raspberry Pi that parents can control via their smart device. Cary’s write-up for the project is so wonderfully detailed that any parent looking to build their own device can easily replace the white noise files with any MP3s of their choice.

Here’s the Instructables tutorial to help you get started on your own.

Remix your own

What’s so wonderful about this project is that it’s a great example of a build that is easily hackable to fit your own requirements. If you don’t have a child, it’s still a great notification device for your day-to-day routine, or a nice tool to remind a relative to take medication based on a colour system. There’s so much you can do using Cary’s build as the bare bones, which is why we think it’s awesome, and you should too.

The post Raspberry Pi Zero white noise night light appeared first on Raspberry Pi.

IT’S SO HOT OVER HERE. WE’RE MELTING. SEND HELP.

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/its-so-hot-over-here-were-melting-send-help/

[Today’s temperatures are set to reach a whopping 38ºC/101ºF degrees in the UK, and none of us know what to do with ourselves. This doesn’t happen here and we have nothing prepared: we live in a society devoid of air conditioning, and we’re are unable to comprehend weather conditions more friendly than a slight chill and drizzle.

I can’t handle it. I have desk fan, but it’s in a cupboard somewhere, covered in dust and sadness. My local corner shop is already out of ice pops and ice cube trays. And anyway, I believe the tarmac on the road outside my house has melted and will suck down anything that dares step or drive on it.

I think I’m melting too. I feel sloshy, and, while I’m not 100% sure this is scientifically possible, I believe I may be partly barbequed. If someone presented me at a restaurant, I would probably be described as medium rare.

So yes, it’s hot. Very hot. It only makes sense that we share a Raspberry Pi project that fits with this theme: here’s an article from the latest issue of The MagPi magazine, out today, that shows you how Ishmael Vargas built his own smart fan for his home in hot and humid Chicago.

It’s a very clever idea, and one we wish we’d thought up ourselves before today’s sudden heatwave/opening of the Hell Mouth.

Enjoy — Alex]

When you need to keep your home cool during the summer months, a smart window fan could be just the thing.

Summer days, and nights, can be uncomfortably hot and humid in the Chicago area. As the sun goes down, the outside temperature drops, but homes may remain hot. This is where a window fan comes in useful, blowing cooler air into the house. Last summer, Ishmael Vargas was using a small window fan upstairs and, after turning it on in the afternoon, he found he had to get up in the middle of the night to turn it off. “That is when I thought there must be a better way to control this fan,” he recalls, “and I started putting this project together.”

Viewable via VNC on a smartphone, the program window features temperature data and control buttons.

As he was already using a DHT22 temperature and humidity sensor for another project, he opted to use that, connected to a Raspberry Pi Zero running a Python program, to monitor the room temperature. This is then compared with the external temperature; if the latter is cooler, the window fan is turned on via a smart WiFi power plug (TP-Link HS100) — a much simpler method than wiring the fan up to a relay.

Weather report

To keep things simple, Ishmael opted to source the outdoor temperature from Weather.com (The Weather Channel) using the pywapi Python library, rather than wiring up an external sensor. “The temperature provided by Weather.com as compared to the temperature in my car could differ by one or two degrees. This is close enough for this project,” he explains. “In other parts of the world or rural areas where they do not have as many weather stations, an outdoor sensor might be required.”

A smart WiFi socket is used to turn the window fan on and off.

One issue he discovered was that in the early morning, the fan could end up blowing warm air into the house. “Depending on the size of the fan, the size of the room, and the house materials, the inside temperature might never be as cool as outside,” he says. “For example, if the temperature outside is 65 °F (18°C), the temperature inside might only drop to 67 °F (19.5°C) through the night. As the temperature outside starts to climb, you want to keep the fan off.” This resulted in him adding an ‘inhibit’ mode to turn the fan off at 6am.

Remote control

Rather than having the fan program run automatically on bootup, Ishmael opted to start and control it manually via an Android smartphone. The latter runs the VNC Viewer app, enabling remote access to Raspberry Pi’s desktop, on which there is a shortcut to start the fan application; this then displays a Pygame window with temperature information and control buttons.

The DHT22 sensor is connected to power, ground, and GPIO 4 pins on a Raspberry Pi Zero — a 10kΩ resistor is recommended.

“The fan application has two buttons to change the [desired temperature] set-point up or down,” reveals Ishmael. “Also, the button on the upper right is to close the application and return to the desktop.” His aim is to have more than one project running on his Raspberry Pi, and have a desktop shortcut for each application.

While the original project used a single fan, he has since modified it to add another. “I have been reading that two fans are required for best performance,” he says. “One to blow in and another to blow out.”

This certainly is a cool project, in more than one way. If you’d like to have a go at building a similar system, you can read Ishmael’s Hackster guide and check out his GitHub repo for the code.

You should read The MagPi magazine

The latest edition of The MagPi magazine is out today, packed full of Raspberry Pi goodness. If you’re new to The MagPi magazine, welcome! As with all publications produced by Raspberry Pi Press, today’s new issue is available as a free download on The MagPi website, as well as in physical form from your local newsagent, the Raspberry Pi Store in Cambridge, or the Raspberry Pi Press online store.

Subscribers to The MagPi magazine get discounts and free stuff, and anyone purchasing any of our publications with actual currency will help fund the production of the magazine as well as the charitable work of the Raspberry Pi Foundation.

The post IT’S SO HOT OVER HERE. WE’RE MELTING. SEND HELP. appeared first on Raspberry Pi.

Good Buoy: the Raspberry Pi Smart Buoy

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/good-buoy-the-raspberry-pi-smart-buoy/

As their new YouTube video shows, the team at T3ch Flicks have been hard at work, designing and prototyping a smart buoy for marine conservation research.

Smart-Buoy Series [Summary]

We all love the seaside, right? Whether that’s the English seaside with ice creams and muddy piers or the Caribbean, with white sand beaches fringed by palm trees, people flock to the coast for a bit of rest and relaxation, to enjoy water sports or to make their livelihood.

What does a smart buoy do?

“The sensors onboard the smart buoy enable it to measure wave height, wave period, wave power, water temperature, air temperature, air pressure, voltage, current usage and GPS location,” explain T3ch Flicks on their project tutorial page. “All the data the buoy collects is sent via radio to a base station, which is a Raspberry Pi. We made a dashboard to display them using Vue JS.”

But why build a smart buoy to begin with? “The coast is a dynamic area at the mercy of waves. Rising sea levels nibble at beaches and powerful extreme events like hurricanes completely decimate them,” they go on to explain. “To understand how to save them, we need to understand the forces driving their change.”

The 3D-printed casing of the smaert buoy with tech inside

It’s a pretty big ask of a 3D-printed dome but, with the aid of an on-board Raspberry Pi, Arduino and multiple sensors, their project was a resounding success. So much so that the Grenadian government gave the team approval to set the buoy free along their coast, and even made suggestions of how the project could be improved to aid them in their own research – pretty cool, right?

The smart buoy out at sea along the Grenada coast

The project uses a lot of tech. A lot. So, instead of listing it here, why not head over to the hackster.io project page, where you’ll find all the ingredients you need to build your own smart buoy.

Good luck to the T3ch Flicks team. We look forward to seeing how the project develops.

The post Good Buoy: the Raspberry Pi Smart Buoy appeared first on Raspberry Pi.

The world’s first Raspberry Pi-powered Twitter-activated jelly bean-pooping unicorn

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/raspberry-pi-powered-twitter-activated-jelly-bean-pooping-unicorn/

When eight-year-old Tru challenged the Kids Invent Stuff team to build a sparkly, pooping, rainbow unicorn electric vehicle, they did exactly that. And when Kids Invent Stuff, also known as Ruth and Shawn, got in contact with Estefannie Explains it All, their unicorn ended up getting an IoT upgrade…because obviously.

You tweet and the Unicorn poops candy! | Kids Invent Stuff

We bring kids’ inventions to life and this month we teamed up with fellow youtube Estefannie (from Estefannie Explains It All https://www.youtube.com/user/estefanniegg SHE IS EPIC!) to modify Tru’s incredible sweet pooping unicorn to be activated by the internet! Featuring the AMAZING Allen Pan https://www.youtube.com/channel/UCVS89U86PwqzNkK2qYNbk5A (Thanks Allen for your filming and tweeting!)

Kids Invent Stuff

If you’re looking for an exciting, wholesome, wonderful YouTube channel suitable for the whole family, look no further than Kids Invent Stuff. Challenging kids to imagine wonderful inventions based on monthly themes, channel owners Ruth and Shawn then make these kids’ ideas a reality. Much like the Astro Pi Challenge, Kids Invent Stuff is one of those things we adults wish existed when we were kids. We’re not jealous, we’re just…OK, we’re definitely jealous.

ANYWAY, when eight-year-old Tru’s sparkly, pooping, rainbow unicorn won the channel’s ‘crazy new vehicle’ challenge, the team got to work, and the result is magical.

Riding an ELECTRIC POOPING UNICORN! | Kids Invent Stuff

We built 8-year-old Tru’s sparkly, pooping, rainbow unicorn electric vehicle and here’s what happened when we drove it for the first time and pooped out some jelly beans! A massive THANK YOU to our challenge sponsor The Big Bang Fair: https://www.thebigbangfair.co.uk The Big Bang Fair is the UK’s biggest celebration of STEM for young people!

But could a sparkly, pooping, rainbow unicorn electric vehicle ever be enough? Is anything ever enough if it’s not connected to the internet? Of course not. And that’s where Estefannie came in.

At Maker Central in Birmingham earlier this year, the two YouTube teams got together to realise their shared IoT dream.

They ran out of chairs for their panel, so Allen had to improvise

With the help of a Raspberry Pi Zero W connected to the relay built into the unicorn, the team were able to write code that combs through Twitter, looking for mentions of @mythicalpoops. A positive result triggers the Raspberry Pi to activate the relay, and the unicorn lifts its tail to shoot jelly beans at passers-by.

You can definitely tell this project was invented by an eight-year-old, and we love it!

IoT unicorn

As you can see in the video above, the IoT upgrades to the unicorn allow Twitter users to control when the mythical beast poops its jelly beans. There are rumours that the unicorn may be coming to live with us at Pi Towers, but if these turn out to be true, we’ll ensure that this function is turned off. So no tweeting the unicorn!

You know what to do

Be sure to subscribe to both Kids Invent Stuff and Estefannie Explains It All on YouTube. They’re excellent makers producing wonderful content, and we know you’ll love them.

How to milk a unicorn

The post The world’s first Raspberry Pi-powered Twitter-activated jelly bean-pooping unicorn appeared first on Raspberry Pi.

Penguin Watch — Pi Zeros and Camera Modules in the Antarctic

Post Syndicated from Liz Upton original https://www.raspberrypi.org/blog/penguin-watch/

Long-time readers will remember Penguin Lifelines, one of our very favourite projects from back in the mists of time (which is to say 2014 — we have short memories around here).

Penguins

Click on penguins for fun and conservation

Penguin Lifelines was a programme run by the Zoological Society of London, crowdsourcing the tracking of penguin colonies in Antarctica. It’s since evolved into something called Penguin Watch, now working with the World Wildlife Fund (WWF) and British Antarctic Survey (BAS). It’s citizen science on a big scale: thousands of people from all over the world come together on the internet to…click on penguins. By counting the birds in their colonies, users help penguinologists measure changes in the birds’ behaviour and habitat, and in the larger ecosystem, thus assisting in their conservation.

The penguin people say this about Penguin Watch:

Some of these colonies are so difficult to get to that they haven’t been visited for 50 years! The images contain unprecedented detail, giving us the opportunity to gather new data on the number of penguins in the region. This information will help us understand how they are being affected by climate change, the potential impact of local fisheries, and how we can help conserve these incredible species.

Pis in the coldest, wildest place

And what are those special cameras? The static ones providing time-lapse images are Raspberry Pi Camera Modules, mounted on Raspberry Pi Zeros, and we’re really proud to see just how robust they’ve been in the face of Antarctic winters.

Alasdair Davies on Twitter

Success! The @arribada_i timelapse @Raspberry_Pi Zero cameras built for @penguin_watch survived the Antarctic winter! They captured these fantastic photos of a Gentoo penguin rookery for https://t.co/MEzxbqSyc1 #WorldPenguinDay 🐧@helenlynn @philipcolligan https://t.co/M0TK5NLT6G

These things are incredibly tough. They’re the same cameras that Alasdair and colleagues have been sticking on turtles, at depths of down to 500m; I can’t think of a better set of tests for robustness.

Want to get involved? Head over to Penguin Watch, and get clicking! We warn you, though — it’s a little addictive.

The post Penguin Watch — Pi Zeros and Camera Modules in the Antarctic appeared first on Raspberry Pi.

Portable retro CRT game console: the one-thumb entertainment system

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/portable-retro-ctr-game-console-the-one-thumb-entertainment-system/

OTES is the one-thumb entertainment system that, unsurprisingly, requires only one thumb to play.

One-Thumb Entertainment System

Uploaded by gocivici on 2019-04-29.

Retro handheld gaming

Straight out the bat, I have to admit that had this existed in the 80s, it would have been all I played with. OTES oozes gaming nostalgia, and the constant clicking would have driven my mother mad, as did the tap tap tap of my Game Boy or NES controller.

Designed to play PICO8 games, with its developers eager to see more people create one-button controlled games for the console, OTES replaces the concept of game cartridges with individual SD cards, allowing for players to swap out games as they would have with a Nintendo Game Boy, SEGA Game Gear, Atari Lynx, and other stand-alone cartridge consoles.

Building OTES

As mentioned, OTES uses the PICO-8 environment at its core and runs on a Raspberry Pi Zero W with interchangeable SD cards. And as the games designed for the project only require one button, it makes for a fairly simple setup.

For the body, the project’s maker, govinci, sources an old JVC video camera in order to cannibalise the CRT viewfinder.

The most important thing first. You have to find an old camcorder which has a CRT viewfinder. It’s usually easy to tell if a camcorder has a CRT viewfinder since it’s a bulky part sticking off the side of the camcorder. I found this viewfinder on an old JVC camcorder which I bought from the flea market. To test the viewfinder I used a 9v battery to power up the camcorder. There was no image on the viewfinder but I got a static white noise which is enough to tell if the viewfinder works.

The CRT viewfinder (that’s it to the right of the battery) was then connected to the Raspberry Pi and power source, and nestled snugly into a 3D-printed body.

Close the case up, turn on the Pi, and boom: one working, single-button console game player with a very personal point of view.

Govinci says:

Currently, It has one game called ODEF (Ocean Defender) developed by me and my friends. (You can play it here.) And I hope there will be many others as people develop games that can be played with only one button on this platform.

You heard the man: go get developing. (I can think of plenty of circumstances where only needing one free finger to fit in a spot of gaming would be really, really convenient.) You can make your own console by following the build diary at Instructables. Let us know if you give it a whirl!

The post Portable retro CRT game console: the one-thumb entertainment system appeared first on Raspberry Pi.

Rousseau-inspired Raspberry Pi Zero LED piano visualiser

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/rousseau-raspberry-pi-zero-led-piano-visualiser/

Unlock your inner Rousseau with this gorgeous Raspberry Pi Zero LED piano visualiser.

Piano LED Visualizer

Inspired by Rousseau videos I tried to build my own Piano Visualizer. It is made with Raspberry Pi and WS2812B LED strip. Screen and buttons: Waveshare LCD TFT 1,44” 128x128px.

Pianist Rousseau

Fans of the popular YouTube pianist Rousseau would be forgiven for thinking the thumbnail above is of one of his videos. It’s actually of a Raspberry Pi build by Aleksander Evening, who posted this project on Reddit last week as an homage to Rousseau, who is one of his favourite YouTubers.

Building an LED piano visualiser

After connecting the LED strip to the Raspberry Pi Zero W, and setting up the Pi as a Bluetooth MIDI host, Aleksander was almost good to go. There was just one thing standing in his way…



He wanted to use the Synthesia software for visualisations, and, unmodified, this software doesn’t support the MIDI files Aleksander planned to incorporate. Luckily, he found the workaround:

As of today Synthesia doesn’t support MIDI via Bluetooth, it should be added in next update. There is official workaround: you have to replace dll file. You also have to enable light support in Synthesia. In Visualizer settings you have to change “input” to RPI Bluetooth. After that when learning new song next-to-play keys will be illuminated in corresponding colors, blue for left hand and green for right hand.

Phew!

Homemade Rousseau

The final piece is a gorgeous mix of LEDs, sound, and animation — worthy of the project’s inspiration.

Find more information, including parts, links to the code, and build instructions, on Aleksander’s GitHub repo. And as always, if you build your own, or if you’ve created a Raspberry Pi project in honour of your favourite musician, artist, or YouTuber, we’d love to see it in the comments below.

And now, a little something from Rousseau:

Ludovico Einaudi – Nuvole Bianche

Sheet music: https://mnot.es/2N01Gqt Click the 🔔bell to join the notification squad! ♫ Listen on Spotify: http://spoti.fi/2LdpqK7 ♫ MIDI: https://patreon.com/rousseau ♫ Facebook: http://bit.ly/rousseaufb ♫ Instagram: http://bit.ly/rousseauig ♫ Twitter: http://bit.ly/rousseautw ♫ Buy me a coffee: http://buymeacoff.ee/rousseau Hope you enjoy my performance of Nuvole Bianche by Ludovico Einaudi.

The post Rousseau-inspired Raspberry Pi Zero LED piano visualiser appeared first on Raspberry Pi.

Watch Game of Thrones with a Raspberry Pi-powered Drogon

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/watch-game-of-thrones-with-raspberry-pi-powered-drogon/

Channel your inner Targaryen by building this voice-activated, colour-changing, 3D-printed Drogon before watching the next episode of Game of Thrones.

Winter has come

This is a spoiler-free zone! I’ve already seen the new episode of season 8, but I won’t ruin anything, I promise.

Even if you’ve never watched an episode of Game of Thrones (if so, that’s fine, I don’t judge you), you’re probably aware that the final season has started.

And you might also know that the show has dragons in it — big, hulking, scaley dragons called Rhaegal, Viserion, and Drogon. They look a little something like this:Daenerys-Targaryen-game-of-thrones

Well, not anymore. They look like this now:

04_15_GameOfThrones_S07-920x584

Raspberry Pi voice-responsive dragon!

The creator of this project goes by the moniker Botmation. To begin with, they 3D printed modified a Drogon model they found on Thingiverse. Then, with Dremel in hand, they modified the print, to replace its eyes with RGB LEDs. Before drawing the LEDs through the hollowed-out body of the model, they soldered them to wires connected to a Raspberry Pi Zero W‘s GPIO pins.

Located in the tin beneath Drogon, the Pi Zero W is also equipped with a microphone and runs the Python code for the project. And thanks to Google’s Speech to Text API, Drogon’s eyes change colour whenever a GoT character repeats one of two keywords: white turns the eyes blue, while fire turns them red.

If you’d like more information about building your own interactive Drogon, here’s a handy video. At the end, Botmation asks viewers to help improve their code for a cleaner voice-activation experience.

3D printed Drogon with LED eyes for Game of Thrones

Going into the final season of Game of Thrones with your very own 3D printed Drogron dragon! The eyes are made of LEDs that changes between Red and Blue depending on what happens in the show. When you’re watching the show, Drogon will watch the show with you and listen for cues to change the eye color.

Drogon for the throne!

I’ve managed to bag two of the three dragons in the Pi Towers Game of Thrones fantasy league, so I reckon my chances of winning are pretty good thanks to all the points I’ll rack up by killing White Walker.

Wait — does killing a White Walker count as a kill, since they’re already dead?

Ah, crud.

The post Watch Game of Thrones with a Raspberry Pi-powered Drogon appeared first on Raspberry Pi.

Hacking an Etch-A-Sketch with a Raspberry Pi and camera: Etch-A-Snap!

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/hacking-etch-a-sketch-raspberry-pi-camera-etch-a-snap/

Kids of the 1980s, rejoice: the age of the digital Etch-A-Sketch is now!

What is an Etch-A-Sketch

Introduced in 1960, the Etch-A-Sketch was invented by Frenchman André Cassagnes and manufactured by the Ohio Art Company.

The back of the Etch-A-Sketch screen is covered in very fine aluminium powder. Turning one of the two directional knobs runs a stylus across the back of the screen, displacing the powder and creating a dark grey line visible in the front side.

can it run DOOM?

yes

The Etch-A-Sketch was my favourite childhood toy. So you can imagine how excited I was to see the Etch-A-Snap project when I logged into Reddit this morning!

Digital Etch-A-Sketch

Yesterday, Martin Fitzpatrick shared on Reddit how he designed and built Etch-A-Snap, a Raspberry Pi Zero– and Camera Module–connected Etch-A-Sketch that (slowly) etches photographs using one continuous line.

Etch-A-Snap is (probably) the world’s first Etch-A-Sketch Camera. Powered by a Raspberry Pi Zero (or Zero W), it snaps photos just like any other camera, but outputs them by drawing to an Pocket Etch-A-Sketch screen. Quite slowly.

Unless someone can show us another Etch-A-Sketch camera like this, we’re happy to agree that this is a first!

Raspberry Pi–powered Etch-A-Sketch

Powered by four AA batteries and three 18650 LiPo cells, Etch-A-Snap houses the $5 Raspberry Pi Zero and two 5V stepper motors within a 3D-printed case mounted on the back of a pocket-sized Etch-A-Sketch.

Photos taken using the Raspberry Pi Camera Module are converted into 1-bit, 100px × 60px, black-and-white images using Pillow and OpenCV. Next, these smaller images are turned into plotter commands using networkx. Finally, the Raspberry Pi engages the two 5V stepper motors to move the Etch-A-Sketch control knobs, producing a sketch within 15 minutes to an hour, depending on the level of detail in the image.

Build your own Etch-A-Snap

On his website, Martin goes into some serious detail about Etch-A-Snap, perfect for anyone interested in building their own, or in figuring out how it all works. You’ll find an overview with videos, along with breakdowns of the build, processing, drawing, and plotter.

The post Hacking an Etch-A-Sketch with a Raspberry Pi and camera: Etch-A-Snap! appeared first on Raspberry Pi.

The Junk Drum Machine

Post Syndicated from Liz Upton original https://www.raspberrypi.org/blog/junk-drum-machine/

I do not really have any spare time. (Toddler, job, very demanding cat, lots of LEGO to tidy up.) If I did, I like to imagine that I’d come up with something like this to do with it.

junk drum machine

Want to see this collection of junk animate? Scroll down for video.

From someone calling themselves Banjowise (let me know what your real name is in the comments, please, so I can credit you properly here!), here is a pile of junk turned into a weirdly compelling drum machine.

Mechanically speaking, this isn’t too complicated: just a set of solenoids triggered by a Raspberry Pi. The real clever is in the beauteous, browser-based step sequencer Banjowise has built to program the solenoids to wallop things in beautiful rhythm. And in the beauteous, skip-sourced tchotchkes that Banjowise has found for them to wallop. Generously, they’ve made full instructions on making your own available on Instructables. Use any bits and bobs you can get your hands on if old piano hammers and crocodile castanets are not part of the detritus kicking around your house.

Warning: this video is weirdly compelling.

Automabeat – A Raspberry Pi Mechanical Robotic Junk Drum Machine

My Raspberry Pi based drum / percussion machine. Consisting of 8 12v solenoids, a relay, wooden spoons, a Fullers beer bottle, a crocodile maraca and a few other things. An Instructable on how to build your own is here: https://www.instructables.com/id/A-Raspberry-Pi-Powered-Junk-Drum-Machine/, or take a look at: http://www.banjowise.com/post/automabeat/

The sequencer is lovely: a gorgeously simple user interface that you can run on a tablet, your phone, or anything else with a browser (and it’s very easily adaptable to other projects). The web interface lets Python trigger the GPIO pins over web sockets. There’s a precompiled version available for people who’ve followed Banjowise’s comprehensive wiring instructions, but you can also get the source code from GitHub.

Sequencer UI

I think I’m getting good, but I can handle criticism.

We love it. Now please excuse me. I need a little while to search online for crocodile castanets.

The post The Junk Drum Machine appeared first on Raspberry Pi.

LED Matrix Cylinder — a blinkenlights tube

Post Syndicated from Liz Upton original https://www.raspberrypi.org/blog/led-matrix-cylinder-a-blinkenlights-tube/

We see lots of addressable LED projects, but there was something weirdly charming and very pretty about this cylinder of squares. It’d make for a lovely interactive nightlight in a kids’ room, or for a grown-up lighting feature that you could also use as a news ticker or something that monitors your in-home IoT devices. Once you’ve built something like this, you’re only limited by your imagination — and it’s nice enough to display in your home.

This project is from makeTVee on Instructables. The cleverness is in the layout and the really meticulous execution: vertical strips of LEDs form a cylinder in a laser-cut frame, with a very thin layer of wood veneer glued around the whole thing to act as a diffuser. It’s simple, but really rather beautiful and very effective.

diffuser, diffusing

In the case to the side is the Raspberry Pi Zero that’s driving the whole thing. Here it is doing its thing:

LED matrix cylinder WS2812 Raspberry Pi Zero

LED matrix cylinder based on WS2812 LEDs and some laser cutter parts. https://hackaday.io/project/162035-led-matrix-cylinder https://www.instructables.com/id/LED-Matrix-Cylinder/ #WS2812 #LEDcylinder

makeTVee has built a Pygame-based simulator of the whole matrix so you can program it to do exactly what you want: scroll marquee text, make pretty patterns, twinkle at random, display images: the world’s your (pixellated) oyster. The code’s available at GitHub.

GUI for programming cylinder

Thanks, makeTVee — if you’d like to leave your real name below, we’ll credit you properly here!

The post LED Matrix Cylinder — a blinkenlights tube appeared first on Raspberry Pi.