Tag Archives: The MagPi

Gamified boxing with Pi Fighter

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/gamified-boxing-with-pi-fighter/

Gamifying boxing with a special punchbag that allows you to fight Luke Skywalker? Rob Zwetsloot starts a training montage to check it out.

Not Rob

Street Fighter

Did you know that the original version of Street Fighter had a variant where you could punch the buttons to get Ryu to attack? The harder you smacked the kick button, the more damage it would do. These apparently wore out very quickly, which is why watching Street Fighter tournaments these days is akin to watching someone playing the piano. Albeit with six buttons and a joystick.

What if you could bring this back? And combine it with other arcade classics and staples? Meet Richard Kirby’s Pi Fighter.

A new challenger!

“Pi Fighter is essentially a real-world old-school fighting video game,” Richard tells us. “The player chooses an opponent and challenges them to a sparring match. Each player has a certain number of health points that decrement each time the other player lands an attack. Instead of clicking a joystick or mouse button, the player hits a heavy bag. The strength of the hit is measured by an accelerometer. [A Raspberry] Pi translates the acceleration of the heavy bag (measured in G) into the number of health points to decrement from the opponent. [Raspberry] Pi runs your opponent, which attacks you — you don’t actually get hit, but your health points decrement each time they attack.”

Use a heavy bag to get a good workout and a good idea of your punch strength, Rocky IV style

It’s a remarkably simple idea, and it started off as just an app that used a smartphone’s accelerometer. Translating that to a Raspberry Pi is just a case of adding an accelerometer of its own.

3… 2… 1… Fight!

“I realised it could be used to measure the overall strength of a punch, but it was hard to know how that would translate into an actual punch, hence the idea to use a heavy bag,” Richard explains. “This appealed to me as I studied karate and always enjoyed hitting a heavy bag. It is always difficult to gauge your own strength, so I thought it would be useful to actually measure the force. The project ended up consuming a good amount of time, as you would expect when you are learning.”



Finish them?

While Pi Fighter is already used at events, Richard says “[i]t needs a bit of tuning and coding to get everything right […]. It could be a never-ending project for me. You can always fix things and make the software more robust, the user interface more usable, etc. It isn’t mass-rollout ready, but I have never had it fail at a key moment such as presenting at a Raspberry Jam or Raspberry Pint. It (mostly) gets better every time I put some effort into it.”

If you find yourself at Raspberry Pint in London, make sure to do a bit of a warm-up first — you might find yourself head-to-head in a boxing match with a Jedi. Here’s hoping they don’t know Teräs Käsi.

The post Gamified boxing with Pi Fighter appeared first on Raspberry Pi.

Raspberry Pi 4: a full desktop replacement?

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/raspberry-pi-4-a-full-desktop-replacement/

The MagPi magazine puts Raspberry Pi 4 to the ultimate test as writer and all-round tech tinkerer PJ Evans uses it for a week as his desktop computer.

When Raspberry Pi 4 was launched earlier in 2019, the significant improvements in processor speed, data throughput, and graphics handling lead to an interesting change of direction for this once humble small computer. Although it’s impressive that you can run a full Linux operating system on a $35 device, a lot of people were just using their Raspberry Pi to get Scratch or Python IDLE up and running. Many people were skipping the graphical side altogether and using smaller models, such as Raspberry Pi Zero, for projects previously covered by Arduino and other microcontrollers.

Raspberry Pi desktop experience

Raspberry Pi 4 was different. Tellingly, the Raspberry Pi Foundation released a new all-in-one kit and named it the Desktop Kit. For the first time truly in Raspberry Pi history, the new model was considered powerful enough to be used as a daily computer without any significant compromise. Challenge accepted. We asked PJ Evans to spend a week using a Raspberry Pi 4 as his only machine. Here’s what happened.

Day 1 | Monday

Decisions, decisions

Our new favourite single-board computer comes in a selection of RAM sizes: 1GB, 2GB, or 4GB. Given a price difference of £20 between the 1GB and 4GB versions, it made sense to go right for the top specification. That’s the version included in the official Desktop Kit that I went out and bought for £105 (inc. VAT) at the official Raspberry Pi store; it normally retails for $120 plus local taxes. My last laptop was £1900. I’m not suggesting that the two can be reasonably compared in terms of performance, but £1795 minus the cost of a monitor is a difference worth remarking upon.

Back at the office, I inspected the contents. For your money you get: a 4GB version of Raspberry Pi 4, thoughtfully already installed in the new official case; the official keyboard and mouse; the new USB-C power supply; a 16GB microSD card preloaded with the Raspbian Buster operating system; and a copy of The Official Raspberry Pi Beginner’s Guide 252-page book. It’s very well packaged and presented, with little plastic waste. The book is the icing on the cake if you are looking at this set for a young person’s first computer, short-circuiting the ‘now what do I do?’ stage. What pleased me, in particular, was the inclusion of two micro-HDMI cables in the kit, allowing me to set up a dual-screen system without delay.

First tests

I set up my new workstation next to my existing laptop, with two 1080p monitors that only had DVI connectors, so I had to get a couple of £2 adapters and an additional cable to get sound out of the audio jack of my Raspberry Pi. Time for an initial test-drive. Booting up into Raspbian Buster was quick, about ten seconds, and connection to WiFi easy. There’s no doubting the feel of the speed improvements. Yes, I’ve read all the benchmark tests, but I wanted to know how that translates to user experience. This new kit does not disappoint.

Raspbian has matured impressively as an OS. For my daily desktop scenario, the jewel in the crown is Chromium: having such a capable web browser is what makes this whole experiment feasible. Others have upped their game, too: Firefox has come a long way, and many other browsers are now available, such as Vivaldi. A check of some of my most visited sites showed Chromium to be just as capable as Chrome on my regular machine. Unsurprisingly, it wasn’t as snappy and I hit a few bumps, but we’ll get to that.

A day of impressions

I’m no expert when it comes to GPUs, but I was impressed with the dual-monitor support. The setup worked first time and didn’t seem to have any detrimental effect on the machine’s performance. I was expecting slow window drawing or things getting ‘stuck’, but this wasn’t the case.

By the end of the first day, I was getting used to the keyboard and mouse too. They are a nice mixture of being both functional and aesthetically pleasing. The keyboard comes with a three-port hub, so you can connect the mouse if you wish. It does not have the build quality and precision of my daily wireless keyboard and trackpad, but for a fraction of the price, I was surprised how much I got for my money. By the end of the week, I’d grown quite fond of it.

Day 2 | Tuesday

Back to basics…


If you’d like to see what PJ got up to for the rest of his week spent using Raspberry Pi as a desktop replacement, head over to The MagPi magazine’s website, where you can either buy the magazine with international home delivery or download the PDF for FREE!

The MagPi magazine is also available from most high street newsagents in the UK, or from the Raspberry Pi store in Cambridge.

What we’re trying to say, dear reader, is that there is absolutely no reason for you not to read the rest of this article. And when you have, let us know what you thought of it in the comments below.

And while we have your attention, here’s the latest video from The MagPi — a teaser of their review for the rather nifty RockyBorg, available now from PiBorg.

RockyBorg: the £99 Raspberry Pi robot!

Power. Performance. Pint-sized. The new RockyBorg has it all. Read our review in The MagPi 85: https://magpi.cc/get85 Would you like a FREE #RaspberryPi? Subscribe today to twelve months print subscription! You can see all our subscription offers on The MagPi magazine website: https://magpi.cc/subscribe

The post Raspberry Pi 4: a full desktop replacement? appeared first on Raspberry Pi.

Raspberry Pi summer projects with The MagPi magazine

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/raspberry-pi-summer-projects-with-the-magpi-magazine/

Take your Raspberry Pi outside for some fun outdoor making with The MagPi magazine’s summer projects feature, available to read now. Right now. Right this second. Go read it…but read the rest of this blog post first. Thanks. #analytics

Digital making outdoors

Sure, there may be a few obstacles in your way whenever you try to complete a digital making project outside. Poor WiFi connections are always a problem, the sun will most certainly glare off your screen, and don’t even get me started on the lack of power supplies. But that’s where The MagPi magazine comes in, providing you with every tip and trick you need to move your making into the fresh air of the great outdoors.

Visit The MagPi magazine’s website, where you’ll be able to download the PDF for free, saving money, time, and trees! Woohoo!

The post Raspberry Pi summer projects with The MagPi magazine 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.

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.

NASA, Raspberry Pi and a mini rover

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/nasa-raspberry-pi-and-a-mini-rover/

NASA scientist Dr Jamie Molaro plans to conduct potentially ground-breaking research using a Raspberry Pi seismometer and a mini rover.

Jamie has been working on a payload-loaded version of NASA’s Open Source Rover

In the summer of 2018, engineers at NASA’s Jet Propulsion Laboratory built a mini planetary rover with the aim of letting students, hobbyists, and enthusiasts create one for themselves. It uses commercial off-the-shelf parts and has a Raspberry Pi as its brain. But despite costing about $5333 in total, the Open Source Rover Project has proven rather popular, including among people who actually work for the USA’s space agency.

One of those is Dr Jamie Molaro, a research scientist at the Planetary Science Institute. Her main focus is studying the surfaces of rocky and icy airless bodies such as comets, asteroids, and the moons orbiting Earth, Jupiter, and Saturn. So when she decided to create her mini-rover – which she dubbed PARSLEE, or Planetary Analog Remote Sensor and ‘Lil Electronic Explorer – she also sought to shake things up a little.

Brought to life

Constructing the robot itself was, she says, rather straightforward: the instructions were detailed and she was able to draw upon the help of others in a forum. Jamie also built the robot with her husband, a software engineer at Adobe. “My interest in the Open Source Rover Project was driven by my scientific background, but not my ability to build it”, she tells us, of what is essentially a miniature version of the Curiosity rover trundling over the surface of Mars.

After building the rover wheel assembly, Jamie worked on the head assembly and then the main body itself

Jamie’s interest in science led to her considering the rover’s potential payload before the couple had even finished building it. She added a GoPro camera and a Kestrel 833, which measures temperature, pressure, elevation, wind speed, and humidity. In addition, she opted to use a Raspberry Shake seismometer – a device costing a few hundred dollars which comprises a device sensor, circuit board, and digitiser – with a Raspberry Pi board and a preprogrammed microSD card.

With the electronics assembly complete, Jamie and her husband could get on with integrating PARSLEE’s parts

The sensor records activity, converts the analogue signals to digital, and allows the recorded data to be read on Raspberry Shake servers. Jamie hopes to use PARSLEE to study the kinds of processes active at the surface of other planets. A seismometer helps us understand our physical environment in a very different way than images from a camera, she says.

Seismic solutions

To that end, with funding, Jamie would like to heat and cool boulders and soils in the lab and in the field and analyse their seismic signature. Thermally driven shallow moonquakes were recorded by instruments used by the Apollo astronauts, she says. “We believe these quakes may reflect signals from a thermal fracturing process that breaks down lunar boulders, or from the boulders and surrounding soil shifting and settling as it changes temperature throughout the day. We can do experiments on Earth that mimic this process and use what we learn to help us understand the lunar seismic data.”

A Raspberry Pi processes the data recorded from the sensor and powers the whole device, with the whole unit forming a payload on PARSLEE

Jamie is also toying with optimum locations for the Shake-fitted rover. The best planetary analogue environments are usually deserts, due to the lack of moisture and low vegetation, she reveals. Places like dry lake beds, lava flows, and sand dunes all provide good challenges in terms of testing the rover’s ability to manoeuvre and collect data, as well as to try out technology being developed with and for it. One thing’s for sure, it is set to travel and potentially make a scientific breakthrough: anyone can use the rover for DIY science experiments.

Read more about PARSLEE on Jamie’s website.

The MagPi magazine #83

This article is from the brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.


The post NASA, Raspberry Pi and a mini rover appeared first on Raspberry Pi.

IoT community sprinkler system using Raspberry Pi | The MagPi issue 83

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/iot-community-sprinkler-system-using-raspberry-pi-the-magpi-issue-83/

Saving water, several thousand lawns at a time: The MagPi magazine takes a look at the award-winning IoT sprinkler system of Coolest Projects USA participant Adarsh Ambati.

At any Coolest Projects event, you’re bound to see incredible things built by young makers. At Coolest Projects USA, we had the chance to talk to Adarsh Ambati about his community sprinkler and we were, frankly, amazed.

“The extreme, record-breaking drought in California inspired me to think of innovative ways to save water,” Adarsh tells us. “While going to school in the rain one day, I saw one of my neighbours with their sprinklers on, creating run-offs. Through research, I found that 25% of the water used in an average American household is wasted each day due to overwatering and inefficient watering methods. Thus, I developed a sprinkler system that is compliant with water regulations, to cost-effectively save water for entire neighbourhoods using a Raspberry Pi, moisture sensors, PyOWM (weather database), and by utilising free social media networks like Twitter.”

Efficient watering

In California, it’s very hot year round, so if you want a lush, green lawn you need to keep the grass watered. The record-breaking drought Adarsh was referring to resulted in extreme limitations on how much you could water your grass. The problem is, unless you have a very expensive sprinkler system, it’s easy to water the grass when it doesn’t need to be.

“The goal of my project is to save water wasted during general-purpose landscape irrigation of an entire neighbourhood by building a moisture sensor-based smart sprinkler system that integrates real-time weather forecast data to provide only optimum levels of water required,” Adarsh explains. “It will also have Twitter capabilities that will be able to publish information about when and how long to turn on the sprinklers, through the social networks. The residents in the community will subscribe to this information by following an account on Twitter, and utilise it to prevent water wasted during general-purpose landscaping and stay compliant with water regulations imposed in each area.”

Using the Raspberry Pi, Adarsh was able to build a prototype for about $50 — a lot cheaper than smart sprinklers you can currently buy on the market.

“I piloted it with ten homes, so the cost per home is around $5,” he reveals. “But since it has the potential to serve an entire community, the cost per home can be a few cents. For example, there are about 37000 residents in Almaden Valley, San Jose (where I live). If there is an average of two to four residents per home, there should be 9250 to 18500 homes. If I strategically place ten such prototypes, the cost per house would be five cents or less.”

Massive saving

Adarsh continues, “Based on two months of data, 83% of the water used for outdoor landscape watering can be saved. The average household in northern California uses 100 gallons of water for outdoor landscaping on a daily basis. The ten homes in my pilot had the potential to save roughly 50000 gallons over a two-month period, or 2500 gallons per month per home. At $0.007 per gallon, the savings equate to $209 per year, per home. For Almaden Valley alone, we have the potential to save around $2m to $4m per year!”

The results from Adarsh’s test were presented to the San Jose City Council, and they were so impressed they’re now considering putting similar systems in their public grass areas. Oh, and he also won the Hardware project category at Coolest Projects USA.

The MagPi magazine #83

This article is from today’s brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.

The post IoT community sprinkler system using Raspberry Pi | The MagPi issue 83 appeared first on Raspberry Pi.

Yuri 3 rover | The MagPi #82

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/yuri-3-rover-the-magpi-82/

In honour of the 50th anniversary of the Apollo moon landing, this year’s Pi Wars was space-themed. Visitors to the two-day event — held at the University of Cambridge in March — were lucky enough to witness a number of competitors and demonstration space-themed robots in action.

Yuri 3 rover

Among the most impressive was the Yuri 3 mini Mars rover, which was designed, lovingly crafted, and operated by Airbus engineer John Chinner. Fascinated by Yuri 3’s accuracy, we got John to give us the inside scoop.

Airbus ambassador

John is on the STEM Ambassador team at Airbus and has previously demonstrated its prototype ExoMars rover, Bridget (you can drool over images of this here: magpi.cc/btQnEw), including at the BBC Stargazing Live event in Leicester. Realising the impressive robot’s practical limitations in terms of taking it out and about to schools, John embarked on a smaller but highly faithful, easily transportable Mars rover. His robot-building experience began in his teens with a six-legged robot he took along to his technical engineering apprenticeship interview and had walk along the desk. Job deftly bagged, he’s been building robots ever since.

Inside the Yuri 3 Mars rover

Yuri is a combination of an Actobotics chassis based on one created by Beatty Robotics plus 3D-printed wheels and six 12 V DC brushed gears. Six Hitec servo motors operate the steering, while the entire rover has an original Raspberry Pi B+ at its heart.

Yuri 3 usually runs in ‘tank steer’ mode. Cannily, the positioning of four of its six wheels at the corners means Yuri 3’s wheels can each be turned so that it spins on the spot. It can also ‘crab’ to the side due to its individually steerable wheels.

Servo motors

The part more challenging for home users is the ‘gold thermal blanket’. The blanket ensures that the rover can maintain working temperature in the extreme conditions found on Mars. “I was very fortunate to have a bespoke blanket made by the team who make them for satellites,” says John. “They used it as a training exercise for the apprentices.”

John has made some bookmarks from the leftover thermal material which he gives away to schools to use as prizes.

Yuri 3 rover thermal blanket samples

Rover design

While designing Yuri 3, it probably helped that John was able to sneak peeks of Airbus’s ExoMars prototypes being tested at the firm’s Mars Yard. (He once snuck Yuri 3 onto the yard and gave it a test run, but that’s supposed to be a secret!) Also, says John, “I get to see the actual flight rover in its interplanetary bio clean room”.

A young girl inspects the Yuri 3 Mars rover

His involvement with all things Raspberry Pi came about when he was part of the Astro Pi programme, in which students send code to two Raspberry Pi devices aboard the International Space Station every year. “I did the shock, vibration, and EMC testing on the actual Astro Pi units in Airbus, Portsmouth,” John proudly tells us.

A very British rover

As part of the European Space Agency mission ExoMars, Airbus is building and integrating the rover in Stevenage. “What a fantastic opportunity for exciting outreach,” says John. “After all the fun with Tim Peake’s Principia mission, why not make the next British astronaut a Mars rover? … It is exciting to be able to go and visit Stevenage and see the prototype rovers testing on the Mars Yard.”

The Yuri 3 Mars rover

John also mentions that he’d love to see Yuri 3 put in an appearance at the Raspberry Pi Store; in the meantime, drooling punters will have to build their own Mars rover from similar kit. Or, we’ll just enjoy John’s footage of Yuri 3 in action and perhaps ask very nicely if he’ll bring Yuri along for a demonstration at an event or school near us.

John wrote about the first year of his experience building Yuri 3 on his blog. And you can follow the adventures of Yuri 3 over on Twitter: @Yuri_3_Rover.

Read the new issue of The MagPi

This article is from today’s brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.

Cover of The MagPi issue 82

The post Yuri 3 rover | The MagPi #82 appeared first on Raspberry Pi.

Make a retro console with RetroPie and a Raspberry Pi — part 2

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/retro-console-with-retropie-raspberry-pi-2/

Here’s part two of Lucy Hattersley’s wonderful retro games console tutorial. Part 1 of the tutorial lives here, for those of you who missed it.

Choose the network locale

RetroPie boots into EmulationStation, which is your starter interface. It’s currently displaying just the one option, RetroPie, which is used to set up the emulation options. As you add games to RetroPie, other systems will appear in EmulationStation.

With RetroPie selected, press the A button on the gamepad to open the configuration window. Use the D-pad to move down the options and select WiFi. You will see a warning message: ‘You don’t currently have your WiFi country set…’. Press the D-pad left to choose Yes, and press A. The interface will open raspi-config. At this point, it’s handy to switch to the keyboard and use that instead.

Choose 4 Localisation Options, and press the right arrow key on the keyboard to highlight Select, then press Enter.

Now choose 4 Change Wi-fi Country and pick your country from the list. We used GB Britain (UK). Highlight OK and press Enter to select it.

Now move right twice to choose Finish and press Enter. This will reboot the system.

Connect to wireless LAN

If you have a Raspberry Pi with an Ethernet connection, you can use an Ethernet cable to connect directly to your router/modem or network.

More likely, you’ll connect the Raspberry Pi to a wireless LAN network so you can access it when it’s beneath your television.

Head back into RetroPie from EmulationStation and down to the WiFi setting; choose Connect to WiFi network.

The window will display a list of nearby wireless LAN networks. Choose your network and use the keyboard to enter the wireless LAN password. Press Enter when you’re done. Choose the Exit option to return to the RetroPie interface.

Configuration tools

Now choose RetroPie Setup and then Configuration Tools. Here, in the Choose an option window, you’ll find a range of useful tools. As we’re using a USB gamepad, we don’t need the Bluetooth settings, but it’s worth noting they’re here.

We want to turn on Samba so we can share files from our computer directly to RetroPie. Choose Samba and Install RetroPie Samba shares, then select OK.

Now choose Cancel to back up to the Choose an option window, and then Back to return to the RetroPie-Setup script.

Run the setup script

Choose Update RetroPie-Setup script and press Enter. After the script has updated, press Enter again and you’ll be back at the Notice: window. Press Enter and choose Basic install; press Enter, choose Yes, and press Enter again to begin the setup and run the configuration script.

When the script has finished, choose Perform a reboot and Yes.

Turn on Samba in Windows

We’re going to use Samba to copy a ROM file (a video game image) from our computer to RetroPie.

Samba used to be installed by default in Windows, but it has recently become an optional installation. In Windows 10, click on the Search bar and type ‘Control Panel’. Click on Control Panel in the search results.

Now click Programs and Turn Windows features on or off. Scroll down to find SMB 1.0/CIFS File Sharing Support and click the + expand icon to reveal its options. Place a check in the box marked SMB 1.0/CIFS Client. Click OK. This will enable Samba client support on your Windows 10 PC so it can access the Raspberry Pi.

We’ve got more information on how Samba works on The MagPi’s website.

Get the game

On your Windows PC or Mac, open a web browser, and visit the Blade Buster website. This is a homebrew video game designed by High Level Challenge for old NES systems. The developer’s website is in Japanese — just click BLADE BUSTER Download to save the ROM file to your Downloads folder.

Open a File Explorer (or Finder) window and locate the BB_20120301.zip file in your Downloads folder. Don’t unzip the file.

Click on Network and you’ll see a RETROPIE share. Open it and locate the roms folder. Double-click roms and you’ll see folders for many classic systems. Drag and drop the BB_20120301.zip file and place it inside the nes folder.

Play the game

Press the Start button on your gamepad to bring up the Main Menu. Choose Quit and Restart EmulationStation. You’ll now see a Nintendo Entertainment System option with 1 Games Available below it. Click it and you’ll see BB_20120301 — this is Blade Buster. Press A to start the game. Have fun shooting aliens. Press Start and Analog (or whatever you’ve set as your hotkey) together when you’re finished; this will take you back to the game selection in EmulationStation.

If you’ve been setting up RetroPie on your monitor, now is the time to move it across to your main television. The RetroPie console will boot automatically and connect to the network, and then you can move ROM files over to it from your PC or Mac. At this point, you may notice black borders around the screen; if so, see the Fix the borders tip.

Enjoy your gaming system!

More top tips from Lucy

Change the resolution

Some games were designed for a much lower resolution, and scaling them up can look blocky on modern televisions. If you’d prefer to alter the resolution, choose ‘RetroPie setup’. Open raspi-config, Advanced Options, and Resolution. Here you’ll find a range of other resolution options to choose from.

Fix the borders

These are caused by overscan. Choose RetroPie from EmulationStation and raspi-config. Now select Advanced Options > Overscan and select No on the ‘Would you like to enable compensation for displays with overscan?’ window. Choose OK and then Finish. Choose Yes on the Reboot Now window. When the system has rebooted, you will see the borders are gone.

The MagPi magazine issue 81

This article is from the latest issue of The MagPi magazine, which is out today and can be purchased online, at the Raspberry Pi Store, or from many newsagents and bookshops, such as WHSmith and Barnes & Noble.

The MagPi magazine issue 81

You can also download issue 81 for free from The MagPi website, where you’ll also find information on subscription options, and the complete MagPi catalogue, including Essentials guides and books, all available to download for free.

the MagPi subscription

The post Make a retro console with RetroPie and a Raspberry Pi — part 2 appeared first on Raspberry Pi.

Make a retro console with RetroPie and a Raspberry Pi — part 1

Post Syndicated from Lucy Hattersley original https://www.raspberrypi.org/blog/retro-console-with-retropie-raspberry-pi-1/

Discover classic gaming on the Raspberry Pi and play homebrew ROMs, with this two-part tutorial from The MagPi Editor Lucy Hattersley.

Raspberry Pi retro games console

Turning a Raspberry Pi device into a retro games console is a fun project, and it’s one of the first things many a new Pi owner turns their hand to.

The appeal is obvious. Retro games are fun, and from a programming perspective, they’re a lot easier to understand than modern 3D powerhouses. The Raspberry Pi board’s small form factor, low power usage, HDMI connection, and wireless networking make it a perfect micro-console that can sit under your television.

RetroPie

There are a bunch of different emulators around for Raspberry Pi. In this tutorial, we’re going to look at RetroPie.

RetroPie combines Raspbian, EmulationStation, and RetroArch into one handy image. With RetroPie you can emulate arcade games, as well as titles originally released on a host of 8-bit, 16-bit, and even 32- and 64-bit systems. You can hook up a joypad; we’re going to use the Wireless USB Game Controller, but most other USB game controllers will work.

You can also use Bluetooth to connect a controller from most video games consoles. RetroPie has an interface that will be very familiar to anyone who has used a modern games console, and because it is open-source, it is constantly being improved.

You can look online for classic games, but we prefer homebrew and modern releases coded for classic systems. In this tutorial, we will walk you through the process of setting up RetroPie, configuring a gamepad, and running a homebrew game called Blade Buster.

Get your microSD card ready

RetroPie is built on top of Raspbian (the operating system for Raspberry Pi). While it is possible to install RetroPie from the desktop interface, it’s far easier to format a microSD card† and copy a new RetroPie image to the blank card. This ensures all the settings are correct and makes setup much easier. Our favourite method of wiping microSD cards on a PC or Apple Mac is to use SD Memory Card Formatter.

Attach the microSD card to your Windows or Mac computer and open SD Card Formatter. Ensure the card is highlighted in the Select card section, then click Format.

Download RetroPie

Download the RetroPie image. It’ll be downloaded as a gzip file; the best way to expand this on Windows is using 7-Zip (7-zip.org).

With 7-Zip installed, right-click the retropie-4.4-rpi2_rpi3.img.gz file and choose 7-Zip > Extract here. Extract GZ files on a Mac or Linux PC using gunzip -k <filename.gz> (the -k option keeps the original GZ file).

gunzip -k retropie-4.4-rpi2_rpi3.img.gz

Flash the image

We’re going to use Etcher to copy the retropie-4.4-rpi2_rpi3.img file to our freshly formatted microSD card. Download Etcher. Open Etcher and click Select Image, then choose the retropie-4.4-rpi2_rpi3.img image file and click Open.

Etcher should have already located the microSD card; remove and replace it if you see a Select Drive button. Click Flash! to copy the RetroPie image to the microSD card.

See our guide for more information on how to use Etcher to flash SD cards.

Set up the Raspberry Pi

Insert the flashed microSD card to your Raspberry Pi. Now attach the Raspberry Pi to a TV or monitor using the HDMI cable. Connect the USB dongle from the Wireless USB Game Controller to the Raspberry Pi. Also attach a keyboard (you’ll need this for the setup process).

Insert the batteries in the Wireless USB Game Controller and set the power switch (on the back of the device) to On. Once everything is connected, attach a power supply to the Raspberry Pi.

See our quickstart guide for more detailed information on setting up a Raspberry Pi.

Configure the gamepad

When RetroPie starts, you should see Welcome screen displaying the message ‘1 gamepad detected’. Press and hold one of the buttons on the pad, and you will see the Configuring screen with a list of gamepad buttons and directions.

Tap the D-pad (the four-way directional control pad on the far left) up on the controller and ‘HAT 0 UP’ will appear. Now tap the D-pad down.
Map the A, B, X, Y buttons to:

A: red circle
B: blue cross
X: green triangle
Y: purple square

The Left and Right Shoulder buttons refer to the topmost buttons on the rear of the controller, while the Triggers are the larger lower buttons.

Push the left and right analogue sticks in for the Left and Right Thumbs. Click OK when you’re done.

Top tips from Lucy

Install Raspbian desktop

RetroPie is built on top of the Raspbian operating system. You might be tempted to install RetroPie on top of the Raspbian with Desktop interface, but it’s actually much easier to do it the other way around. Open RetroPie from EmulationStation and choose RetroPie setup. Select Configuration tools and Raspbian tools. Then choose Install Pixel desktop environment and Yes.

When it’s finished, choose Quit and Restart EmulationStation. When restarted, EmulationStation will display a Ports option. Select it and choose Desktop to boot into the Raspbian desktop interface.

Username and password

If RetroPie asks you for the username and password during boot, the defaults are pi and raspberry.

The MagPi magazine issue 81

The rest of this article can be found in the latest issue of The MagPi magazine, which is out now and can be purchased online, at the Raspberry Pi Store, or from many independent bookshops, such as WHSmith and Barnes & Noble. We’ll also post the second half on the blog tomorrow!

The MagPi magazine issue 81

You can also download issue 81 for free from The MagPi website, where you’ll find information on subscription options, and the complete MagPi catalogue, including Essentials guides and books, all available to download for free.

the MagPi subscription

The post Make a retro console with RetroPie and a Raspberry Pi — part 1 appeared first on Raspberry Pi.

Intelli-T Raspberry Pi sensor alarm | The MagPi issue 81

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/intelli-t-raspberry-pi-sensor-alarm-the-magpi-issue-81/

Never knowingly run out of tea-bags again with this ingenious system, using a Raspberry Pi and Arduino to create a weight sensor and alarm.

The Intelli-T Raspberry Pi sensor alarm

Faced with the, almost unthinkable, problem of no tea-bags in the house, Robin Mitchell was inspired to contrive an invention that would eliminate the possibility of that scenario ever happening again, and the Intelli-T Raspberry Pi Sensor Alarm was born. As he explains, “One of the biggest problems that faces many British homes, as well as my own, is having a stable supply of tea… an issue with knowing how many tea-bags are available in the house. Hence, an intelligent tea-bag container was needed!”

Simplici-tea

Simple in its design, the project consists of only a few elements, as Robin tells us: “The first element is the weight sensor itself, which weighs the tea-bag container. This weight sensor is connected to a standard HX711 ADC, which is then read by an Arduino. The Arduino then sends the weight data to the Raspberry Pi, which can keep track of how many bags there are, and play interesting facts about tea when a tea-bag is removed.”

The Intelli-T Raspberry Pi sensor alarm

Clever, but as with many inventions, not entirely straightforward to construct, with the weight sensor providing the main issue, as Robin elaborates: “The problem with weight sensors is that they require plenty of fine-tuning and can be very noisy. While this is not a problem for heavier items, trying to accurately weigh tea-bags is a nightmare. On reflection, it would have been better to use a much smaller weight sensor, so that the weight of the individual tea-bags is larger with respect to the minimum weight that the sensor can register (this would improve the accuracy).”

Brewing ideas

Undeterred, Robin successfully completed his tea-bag detection system, and feels that this kind of weight-sensing system could easily be used in other projects. “One area that could benefit from a similar system would be industrial systems that need to count parts such as resistors, transistors, capacitors, and even potentiometers. Of course, part counting can also be useful for the everyday hobbyist who wants to keep check of their component stock, and someone like myself who stocks many thousands of parts needs to keep an accurate check on inventory regularly (as I own a small electronics business).”

There certainly appears to be some scope here for future projects but, as for tea-bag detection, Robin thinks he has taken that particular piece of work as far as he can. “The project was great fun, but since I no longer drink bagged tea (lemon tea rules!), I don’t have a use for it any more.”

Not that Robin is short of ideas for other projects. “Each day of my life is all about creating projects around many platforms, with the Raspberry Pi included. Only recently, I designed a simple IoT monitoring station for an IoT sensor that can be affixed to a drill, and the vibration data streamed to the Raspberry Pi via a local network. All I can say is that the Raspberry Pi is a fantastic platform for prototyping and project building!”

The MagPi magazine issue 81

This article is from the latest issue of The MagPi magazine, which is out today and can be purchased online, at the Raspberry Pi Store, or from many independent bookshops, such as WHSmith and Barnes & Noble.

The MagPi magazine issue 81

You can also download issue 81 for free from The MagPi website, where you’ll also find information on subscription options, and the complete MagPi catalogue, including Essentials guides and books, all available to download for free.

the MagPi subscription

The post Intelli-T Raspberry Pi sensor alarm | The MagPi issue 81 appeared first on Raspberry Pi.

Raspberry Pi underwater camera drone | The MagPi 80

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/raspberry-pi-underwater-camera-drone-magpi-80/

Never let it be said that some makers won’t jump in at the deep end for their ambitious experiments with the Raspberry Pi. When Ievgenii Tkachenko fancied a challenge, he sought to go where few had gone before by creating an underwater drone, successfully producing a working prototype that he’s now hard at work refining.

Inspired by watching inventors on the Discovery Channel, Ievgenii has learned much from his endeavour. “For me it was a significant engineering challenge,” he says, and while he has ended up submerging himself within a process of trial-and-error, the results so far have been impressive.

Pi dive

The project began with a loose plan in Ievgenii’s head. “I knew what I should have in the project as a minimum: motions, lights, camera, and a gyroscope inside the device and smartphone control outside,” he explains. “Pretty simple, but I didn’t have a clue what equipment I would be able to use for the drone, and I was limited by finances.”

Bearing that in mind, one of his first moves was to choose a Raspberry Pi 3B, which he says was perfect for controlling the motors, diodes, and gyroscope while sending video streams from a camera and receiving commands from a control device.

The Raspberry Pi 3 sits in the housing and connects to a LiPo battery that also powers the LEDs and motors

“I was really surprised that this small board has a fully functional UNIX-based OS and that software like the Node.js server can be easily installed,” he tells us. “It has control input and output pins and there are a lot of libraries. With an Ethernet port and wireless LAN and a camera, it just felt plug-and-play. I couldn’t find a better solution.”

The LEDs are attached to radiators to prevent overheating, and a pulse driver is used for flashlight control

Working with a friend, Ievgenii sought to create suitable housing for the components, which included a twin twisted-pair wire suitable for transferring data underwater, an electric motor, an electronic speed control, an LED together with a pulse driver, and a battery. Four motors were attached to the outside of the housing, and efforts were made to ensure it was waterproof. Tests in a bath and out on a lake were conducted.

Streaming video

With a WiFi router on the shore connected to the Raspberry Pi via RJ45 connectors and an Ethernet cable, Ievgenii developed an Android application to connect to the Raspberry Pi by address and port (“as an Android developer, I’m used to working with the platform”). This also allowed movement to be controlled via the touchscreen, although he says a gamepad for Android can also be used. When it’s up and running, the Pi streams a video from the camera to the app — “live video streaming is not simple, and I spent a lot of time on the solution” — but the wired connection means the drone can only currently travel as far as the cable length allows.

The camera was placed in this transparent waterproof case attached to the front of the waterproof housing

In that sense, it’s not perfect. “It’s also hard to handle the drone, and it needs to be enhanced with an additional controls board and a few more electromotors for smooth movement,” Ievgenii admits. But as well as wanting to base the project on fast and reliable C++ code and make use of a USB 4K camera, he can see the future potential and he feels it will swim rather than sink.

“Similar drones are used for boat inspections, and they can also be used by rescue squads or for scientific purposes,” he points out. “They can be used to discover a vast marine world without training and risks too. In fact, now that I understand the Raspberry Pi, I know I can create almost anything, from a radio electronic toy car to a smart home.”

The MagPi magazine

This article was lovingly borrowed from the latest issue of The MagPi magazine. Pick up your copy of issue 80 from your local stockist, online, or by downloading the free PDF.

Subscribers to The MagPi also get a rather delightful subscription gift!

The post Raspberry Pi underwater camera drone | The MagPi 80 appeared first on Raspberry Pi.

Yoga training with YogAI and a Raspberry Pi smart mirror | The MagPi issue 80

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/yoga-training-with-yogai-and-a-raspberry-pi-smart-mirror-the-magpi-issue-80/

Running on a smart mirror, YogAI uses a database of postures, image recognition software, and the magic of mirrors to not only show users their current posture but to also teach them how to correct their posture to reach peak yogi-ness. Here’s Rob Zwetsloot from The MagPi magazine with more.

yogai

We’ve seen many ‘magic mirror’ projects over the past few years, featuring a TV screen behind the glass to show useful information, but YogAI takes the concept to a whole new level by providing an AI personal trainer to guide and correct your yoga positions.

Self-confessed fitness nuts Salma Mayorquin and Terry Rodriguez thought that having a personal trainer could be a way to keep track of their fitness progress, so why not try to make a virtual one? “With [deep learning] models like pose estimation, we figured there was a way we could make a program that could track how we were exercising and started experimenting from there,” says Terry.

“YogAI guides users through a flow of yoga poses, offering generally helpful advice when the camera senses a user not in the correct pose,” explains Salma. “At the heart, YogAI uses pose estimation to find reference key points on the body. This is used to understand and classify common yoga poses.”

Users interact with YogAI through both visual feedback via the mirror display, and a voice interface — using the Snips AIR voice assistant — which enables the user to give spoken commands to start, stop, pause, and restart a yoga session. YogAI also talks back through the Flite voice synthesiser to guide the yogi to achieve the correct poses.

While a prototype magic mirror only took the experienced makers a week to build, training the AI to recognise yoga poses in real time was a trickier task. “We need our computer vision models to run quickly so that we have enough resolution in time to identify the move,” reveals Terry.

Strike a pose

A Raspberry Pi 3 interprets the camera images in real time, detecting key body points to display the pose on the mirror and classify it using a deep-learning model trained with a dataset of around 35000 samples.

However, the pair found that the Pi could only run image inference at one frame every 4–5 seconds, resulting in lag. A workaround was soon found: “Shrinking our pose estimation models down using TensorFlow Lite, we were able to bring our frame rate from 0.2 fps to 2.5 fps,” says Salma. “For faster inference, we will look for ways to reduce the model further. We also believe upgrading to the Raspberry Pi Compute Module 3 will increase the performance significantly.”


“Overall, the accuracy across a dozen common poses is roughly 80%,” divulges Terry. “Not surprisingly, we find similar pose variants, e.g. warrior poses, can be a source of confusion. When the head/face is blocked, the pose estimates degrade, which impacts our classification of poses like downward dog.”

More intense exercise

As well as using the system for yoga, Salma and Terry are planning to adapt YogAI to monitor more energetic workouts. “We’re interested in strength training, and others have suggested dance and karate katas,” says Terry. “We think YogAI is well-positioned to perform more general health and personal wellness tasks.”

“We want to integrate with popular health wearables,” adds Salma. “A smart watch with an accelerometer and heart rate monitor can introduce a lot of important context to bring YogAI closer to our vision for a smart mirror yoga instructor and toward a personal wellness platform.”

More from The MagPi magazine

The MagPi magazine issue 80 is out today. Buy your copy now from the Raspberry Pi Press store, major newsagents in the UK, or Barnes & Noble, Fry’s, or Micro Center in the US. Or, download your free PDF copy from The MagPi magazine website.

Subscribe now

Subscribe to The MagPi magazine on a monthly, quarterly, or twelve-month basis to save money against newsstand prices!

Twelve-month print subscribers get a free Raspberry Pi 3A+, the perfect Raspberry Pi to try your hand at some of the latest projects covered in The MagPi magazine.

The post Yoga training with YogAI and a Raspberry Pi smart mirror | The MagPi issue 80 appeared first on Raspberry Pi.

MagPi 79: get making in March with #MonthOfMaking

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/magpi-79-monthofmaking/

Hi folks! Rob from The MagPi here. This month in issue 79 of The MagPi, we’re doing something a little different: we invite all of you (yes, you!) to join us in the #MonthOfMaking.

Learn more about the #MonthOfMaking inside issue 79!

#MonthOfMaking

What does this mean? Well, throughout March, we want you to post pictures of your works-in-progress and completed projects on Twitter with the hashtag #MonthOfMaking.

#MonthOfMaking

As well as showing off the cool stuff you’re creating, we also want you to feel comfortable to ask for help with projects, and to share top tips for those that might be struggling.

If you’re not sure where to start, we’ve put together a massive feature in issue 79 of The MagPi, out now, to help you decide. On top of various project ideas for different skill levels, our feature includes some essential resources to look at, as well as inspirational YouTubers to follow, and some competitions you might want to take part in!

So, go forth and make! I’m really looking forward to seeing what you all get up to during this inaugural #MonthOfMaking!

Get The MagPi 79

You can get The MagPi 79 from WHSmith, Tesco, Sainsbury’s, and Asda. If you live in the US, head over to your local Barnes & Noble or Micro Center in the next few days for a print copy. You can also get the issue online: check it out on our store, or digitally via our Android or iOS apps. And don’t forget, there’s always the free PDF.

Free Raspberry Pi 3A+ offer!

We’re still running our super special Raspberry Pi 3A+ subscription offer! If you subscribe to twelve months of The MagPi, you’ll get a Raspberry Pi 3A+ completely free while stocks last. Make sure to check out our other subs offers while you’re there, like three issues for £5, and our rolling monthly subscription.

Get a 3A+ completely free while stocks last!

The post MagPi 79: get making in March with #MonthOfMaking appeared first on Raspberry Pi.

Upcycle a vintage TV with the Raspberry Pi TV HAT | The MagPi #78

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/magpi-78-upcycled-vintage-tv-hat/

When Martin Mander’s portable Hitachi television was manufactured in 1975, there were just three UK channels and you’d need to leave the comfort of your sofa in order to switch between them.

A page layout of the upcycled vintage television project using the Raspberry Pi TV HAT from The MagPi issue 78

Today, we have multiple viewing options and even a cool Raspberry Pi TV HAT that lets us enjoy DVB-T2 broadcasts via a suitable antenna. So what did nostalgia-nut Martin decide to do when he connected his newly purchased TV HAT to the Pi’s 40-pin GPIO header? Why, he stuck it in his old-fashioned TV set with a butt-busting rotary switch and limited the number of channels to those he could count on one hand – dubbing it “the 1982 experience” because he wanted to enjoy Channel 4 which was launched that year.

Going live

Martin is a dab hand at CRT television conversions (he’s created six since 2012, using monitors, photo frames, and neon signs to replace the displays). “For my latest project, I wanted to have some fun with the new HAT and see if I’d be able to easily display and control its TV streams on some of my converted televisions,” he says. It’s now being promoted to his office, for some background viewing as he works. “I had great fun getting the TV HAT streams working with the rotary dial,” he adds.

Raspberry Pi TV HAT

The project was made possible thanks to the new Raspberry Pi TV HAT

Although Martin jumped straight into the HAT without reading the instructions or connecting an aerial, he eventually followed the guide and found getting it up-and-running to be rather straightforward. He then decided to repurpose his Hitachi Pi project, which he’d already fitted with an 8-inch 4:3 screen.

Upcycled television using the Raspberry Pi TV HAT

The boards, screen, and switches installed inside the repurposed Hitachi television

“It’s powered by a Pi 3 and it already had the rotary dial set up and connected to the GPIO,” he explains. “This meant I could mess about with the TV HAT, but still fall back on the original project’s script if needed, with no hardware changes required.”

Change the channel

Indeed, Martin’s main task was to ensure he could switch channels using the rotary dial and this, he says, was easier to achieve than he expected. “When you go to watch a show from the Tvheadend web interface, it downloads an M3U playlist file for you which you can then open in VLC or another media player,” he says.

Upcycled television using the Raspberry Pi TV HAT

– The Hitachi television is fitted with a Pimoroni 8-inch 4:3 screen and a Raspberry Pi 3
– Programmes stream from a Pi 2 server and the channels are changed by turning the dial
– The name of the channel briefly appears at the bottom of the screen – the playlist files are edited in Notepad

“At first, I thought the playlist file was specific to the individual TV programme, as the show’s name is embedded in the file, but actually each playlist file is specific to the channel itself, so it meant I could download a set of playlists, one per channel, and store them in a folder to give me a full range of watching options.”

Sticking to his theme, he stored playlists for the four main channels of 1982 (BBC1, BBC2, ITV, and Channel 4) in a folder and renamed them channel1, channel2, channel3, and channel4.

Upcycled television using the Raspberry Pi TV HAT

A young Martin Mander decides the blank screen of his black and white Philips TX with six manual preset buttons is preferable to the shows (but he’d like to convert one of these in the future)

“Next, I created a script with an infinite loop that would look out for any action on the GPIO pin that was wired to the rotary dial,” he continues. “If the script detects that the switch has been moved, then it opens the first playlist file in VLC, full-screen. The next time the switch moves, the script loops around and adds ‘1’ to the playlist name, so that it will open the next one in the folder.”

Martin is now planning the next stage of the project, considering expanding the channel-changing script to include streams from his IP cameras, replacing a rechargeable speaker with a speaker HAT, and looking to make the original volume controls work with the Pi’s audio. “It been really satisfying to get this project working, and there are many possibilities ahead,” he says.

More from The MagPi magazine

The MagPi magazine issue 78 is out today. Buy your copy now from the Raspberry Pi Press store, major newsagents in the UK, or Barnes & Noble, Fry’s, or Micro Center in the US. Or, download your free PDF copy from The MagPi magazine website.

The MagPi magazine issue 78

Subscribe now

Subscribe to The MagPi magazine on a monthly, quarterly, or twelve-month basis to save money against newsstand prices!

Twelve-month print subscribers get a free Raspberry Pi 3A+, the perfect Raspberry Pi to try your hand at some of the latest projects covered in The MagPi magazine.

The post Upcycle a vintage TV with the Raspberry Pi TV HAT | The MagPi #78 appeared first on Raspberry Pi.

MagPi 77: Make with code

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/magpi-77/

Hey folks, Rob from The MagPi here! Before I head off on my Christmas holidays, I want to introduce you to The MagPi 77, where we teach you how to make with code.

Making made fun! See what we did there?

What do we mean by that? Well, using code to make things – whether that’s scripts, programs, or games on your Pi, or whether you’re controlling LEDs with code, or robots, or massive Rube Goldberg machines. In this feature, we show new Pi users how to get started making practical applications with Python, and hopefully you’ll be inspired to go on and do something special.

Can you make… with code?

Accessories make the Pi

Want to power up your Raspberry Pi with a few extras? We’ve put together a guide to the 20 best Raspberry Pi accessories, covering IoT, robots, media, power solutions, and even industrial add-ons. There’s a lot of stuff you can do with your Pi, and even more if you’ve got the right tool to help.

We have the best accessories for you

More, you say?

Still need more reasons to grab a copy? Well, we have a tutorial on how to make a smart door, we continue developing Pac-Man while checking out the Picade Console, and we have plenty of amazing project showcases like the SelfieBot!


Get The MagPi 77

You can get The MagPi 77 from WHSmith, Tesco, Sainsbury’s, and Asda. If you live in the US, head over to your local Barnes & Noble or Micro Center in the next few days for a print copy. You can also get the issue online: check it out on our store, or digitally via our Android or iOS apps. And don’t forget, there’s always the free PDF.

Free Raspberry Pi 3A+ offer!

We’re still running our super special Raspberry Pi 3A+ subscription offer! If you subscribe to twelve months of The MagPi, you’ll get a Raspberry Pi 3A+ completely free while stocks last. Make sure to check out our other subs offers while you’re there, like three issues for £5, and our rolling monthly sub.

Get a 3A+ completely free while stocks last!

Right, happy holidays, folks! See you all in the New Year!

The post MagPi 77: Make with code appeared first on Raspberry Pi.

MagPi 76: our updated Raspberry Pi Superguide!

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/magpi-76/

Hi folks, Rob from The MagPi here! The holiday season will soon be upon us, and that means a lot of Raspberry Pis will be given as gifts. For all these new Pi users, we thought it was time to update our beginners’ guide for 2019 in issue 76 of The MagPi, out now!

And yes, this includes the brand-new 3A+.

Look, up on the magazine rack!

Is it a bird? A plane? No, it’s Superguide!

In this Superguide, we’ll take you through the initial setup of the Pi, we’ll help you familiarise yourself with it, and we’ll even show you a couple of fun Pi projects to get started with! Whether you’re a complete newbie to Raspberry Pi or you want need a little refresher, our guide has got you covered.

Superb

3A+ subscription offer!

Speaking of the Raspberry Pi 3A+, we have a full feature on the fresh addition to the Raspberry Pi family, including all the juicy benchmarks, stats, and info you’d ever want to know. There’s even an interview with Eben Upton and Roger Thornton about its development!

In fact, we love the 3A+ so much that we’re offering a brand-new, limited-time subscription offer: sign up for a twelve-month print subscription of The MagPi now, and you’ll get a Raspberry Pi 3A+ completely free!

Hurry though, this offer only runs as long as stocks last.

Be quick, this offer won’t be around forever!

Heads, Pac-Man, and Christmas lights

Of course, there also are amazing projects, guides, and reviews in this issue. This includes As We Are, a mesmerising art project that displays people’s faces on a 14-foot tall screen shaped like a head. We also show you how to start making Pac-Man in our monthly Pygame tutorial, and our smart lights guide has a bit of a festive flair to it.


Get The MagPi 76

You can get The MagPi 76 from WHSmith, Tesco, Sainsbury’s, and Asda. If you live in the US, head over to your local Barnes & Noble or Micro Center in the next few days for a print copy. You can also get the issue online: check it out on our store, or digitally via our Android or iOS apps. And don’t forget, there’s always the free PDF.

Rolling subscription offer!

Want to support the Raspberry Pi Foundation and the magazine? As well as the subscription mentioned above, you can now take out a monthly £5 subscription to the magazine, effectively creating a rolling pre‑order system that saves you money on each issue.

The MagPi subscription offer — The MagPi 75

That’s it for now! I’ll see you next time around Christmas.

 

The post MagPi 76: our updated Raspberry Pi Superguide! appeared first on Raspberry Pi.

Can’t Drive This, the 4D arcade machine

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/4d-arcade-machine/

A Raspberry Pi–powered arcade display with hidden interactive controls won over the crowds at Gamescom. Rosie Hattersley and Rob Zwetsloot got the inside scoop.

Pixel Maniacs is a Nuremberg-based games maker that started out making mobile apps. These days it specialises in games for PC, Xbox One, PlayStation, and Nintendo Switch. You Can’t Drive is its first foray into gaming with a Raspberry Pi.

If you’re going to add a little something extra to wow the crowd at the Gamescom video games trade fair, a Raspberry Pi is a surefire way of getting you noticed. And that’s the way Pixel Maniacs went about it.

The Nuremberg-based games developer retrofitted an arcade machine with a Raspberry Pi to showcase its intentionally silly Can’t Drive This precarious driving game at Gamescom.

This two-player co-operative game involves one player building the track while the other drives along it.

Complete with wrecking balls, explosions, an inconvenient number of walls, and the jeopardy of having to construct your road as you negotiate your way, at speed, across an ocean to the relative safety of the next lump of land, Can’t Drive This is a fast‑paced racing game.

Splash action

Pixel Maniacs then took things up a notch by providing interactive elements, building a mock 4D arcade game (so-named because they feature interactive elements such as motion cabinets). The fourth dimension, in this case, saw the inclusion of a water spray, fan, and console lights. For its Gamescom debut, Pixel Maniacs presented Can’t Drive This in a retro arcade cabinet, where hordes of gaming fans gathered round its four-way split screen to enjoy the action.

Getting to the heart of the matter and replacing the original 1980s kit with modern-day processors and Pi-powered additions

Adding Raspberry Pi gaming to the mix was about aiding the game development process as much as anything. Andy Holtz, Pixel Maniacs’ software engineer, told The MagPi that the team wanted an LED matrix with 256 RGB LEDs to render sprite-sheet animations. “We knew we needed a powerful machine with enough RAM, and a huge community, to get the scripts running.”

Pixel Maniacs’ offices have several Raspberry Pi–controlled monitors and a soundboard, so the team knew the Pi’s potential.

The schematic for the 4D arcade machine, showing the importance of the Raspberry Pi as a controller.

The arcade version of the game runs off a gaming laptop cunningly hidden within the walls of the cabinet, while the Raspberry Pi delivers the game’s surprise elements such as an unexpected blast from a water spray. A fan can be triggered to simulate stormy weather, and lights start flashing crazily when the cars crash. Holtz explains that the laptop “constantly sends information about the game’s state to the Raspberry Pi, via a USB UART controller. The Pi reads these state messages, converts them, and sends according commands to the fans, water nozzle, camera, and the LED light matrix. So when players drive through water, the PC sends the info to the Pi, and [the latter] turns on the nozzle, spraying them.”

Having played your heart out, you get a photo-booth-style shot of you in full-on gaming action.

The arcade idea came about when Pixel Maniacs visited the offices of German gaming magazine M! Games and spied an abandoned, out-of-order 1980s arcade machine lurking unloved in a corner. Pixel Maniacs set about rejuvenating it, Da Doo Ron Ron soundtrack and all.

Sustained action

Ideas are one thing; standing up to the rigours of a full weekend’s uninterrupted gameplay at the world’s biggest games meet is something else. Holtz tells us, “The Raspberry Pi performed like a beast throughout the entire time. Gamescom was open from 9am till 8pm, so it had to run for eleven hours straight, without overheating or crashing. Fortunately, it did. None of the peripherals connected to the Pi had any problems, and we did not have a single crash.”

A Raspberry Pi 3B+ was used to trigger the water spray, lights, and fans, bringing an extra element to the gameplay, as well as rendering the arcade machine’s graphics.

Fans were enthusiastic too, with uniformly positive feedback, and one Gamescom attendee attempting to buy the arcade version there and then. As Andy Holtz says, though, you don’t sell your baby. Instead, Pixel Maniacs is demoing it at games conventions in Germany this autumn, before launching Can’t Drive This across gaming platforms at the end of the year.

This article was printed in The MagPi issue 75. Get your copy of The MagPi in stores now, or download it as a free PDF here.

The post Can’t Drive This, the 4D arcade machine appeared first on Raspberry Pi.

Brand-new books from The MagPi and HackSpace magazine

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/book-of-making-1-magpi-projects-book-4/

Hey folks, Rob from The MagPi here! Halloween is over and November has just begun, which means CHRISTMAS IS ALMOST HERE! It’s never too early to think about Christmas — I start in September, the moment mince pies hit shelves.

Elf GIF

What most people seem to dread about Christmas is finding the right gifts, so I’m here to help you out. We’ve just released two new books: our Official Raspberry Pi Projects Book volume 4, and the brand-new Book of Making volume 1 from the team at HackSpace magazine!

Book of Making volume 1

HackSpace magazine book 1 - Raspberry Pi

Spoiler alert: it’s a book full of making

The Book of Making volume 1 contains 50 of the very best projects from HackSpace magazine, including awesome project showcases and amazing guides for building your own incredible creations. Expect to encounter trebuchets, custom drones, a homemade tandoori oven, and much more! And yes, there are some choice Raspberry Pi projects as well.

The Official Raspberry Pi Projects Book volume 4

The MagPi Raspberry pi Projects book 4

More projects, more guides, and more reviews!

Volume 4 of the Official Raspberry Pi Projects Book is once again jam-packed with Raspberry Pi goodness in its 200 pages, with projects, build guides, reviews, and a little refresher for beginners to the world of Raspberry Pi. Whether you’re new to Pi or have every single model, there’s something in there for you, no matter your skill level.

Free shipping? Worldwide??

You can buy the Book of Making and the Official Raspberry Pi Projects Book volume 4 right now from the Raspberry Pi Press Store, and here’s the best part: they both have free worldwide shipping! They also roll up pretty neatly, in case you want to slot them into someone’s Christmas stocking. And you can also find them at our usual newsagents.

Both books are available as free PDF downloads, so you can try before you buy. When you purchase any of our publications, you contribute toward the hard work of the Raspberry Pi Foundation, so why not double your giving this holiday season by helping us put the power of digital making into the hands of people all over the world?

Anyway, that’s it for now — I’m off for more mince pies!

The post Brand-new books from The MagPi and HackSpace magazine appeared first on Raspberry Pi.

MagPi 75: 75 greatest projects, chosen by you

Post Syndicated from Rob Zwetsloot original https://www.raspberrypi.org/blog/magpi-75-greatest-projects/

Hi folks, Rob from The MagPi here! A few weeks ago, we asked you to vote on your top 50 favourite Raspberry Pi projects from the last two-or-so years. We had thousands of responses, but there was one clear winner…and you can find out who that was in issue 75 of The MagPi, out tomorrow in stores, and available today online!

MagPi 75 Raspberry Pi magazine front cover

See who you folks voted for…

You heard right, the magazine is available a day early to download and buy online! Don’t say we never spoil you.

The community has voted

As well as counting down your 50 favourites, we’ve also got 25 other amazing projects selected by Eben Upton, Philip Colligan, Carrie Anne Philbin, and others!* Is your favourite project on the list?

MagPi 75 Raspberry Pi magazine

We don’t want to spoil the surprise — you’ll have to get the magazine to read the whole thing!

And there’s so much more!

On top of community favourites, we bring you a lot more in issue 75. This month we have a big feature on using the Raspberry Pi Camera Module, we show you ten of our favourite starter kits, and we also have a guide on building a secret radio chat device.

MagPi 75 Raspberry Pi magazine

Want to use the new Raspberry Pi TV HAT? We show you how.

All this along with news, reviews, community features, and competitions!

MagPi 75 Raspberry Pi magazine

See what we saw at Maker Faire New York!

Get The MagPi 75

You can get The MagPi 75 tomorrow from WHSmith, Tesco, Sainsbury’s, and Asda. If you live in the US, head over to your local Barnes & Noble or Micro Center in the next few days for a print copy. However, you can get the new issue online today! Check it out on our store, or digitally via our Android or iOS apps. And don’t forget, there’s always the free PDF.

Rolling subscription offer!

Want to support the Raspberry Pi Foundation and the magazine? You can now take out a monthly £5 subscription to the magazine, effectively creating a rolling pre‑order system that saves you money on each issue.

The MagPi subscription offer — The MagPi 75

You can also take out a twelve-month print subscription and get a Pi Zero W plus case and adapter cables absolutely free! This offer does not currently have an end date.

Thanks for sticking with The MagPi for 75 issues! Here’s to hundreds more.

*Oi, Zwetsloot, why wasn’t I asked?! – Alex

The post MagPi 75: 75 greatest projects, chosen by you appeared first on Raspberry Pi.