Schlagwort: raspi

  • 50 Raspberry Pi 4 Tips and Tools: pt 1

    50 Raspberry Pi 4 Tips and Tools: pt 1

    Reading Time: 5 minutes

    Whether you are new to making with Raspberry Pi or have been at it for years, there are always new tools and techniques to be learned. For the new arrival to the making community, this list will be a great resource to introduce you to tools that you may not have heard of before, and a short cut to get to the bits of software that work best for Raspberry Pi projects. If you’ve been doing this for a while, you may want to count how many of these tools are already in your makerspace. If you get to 50, you probably need a bigger makerspace.

    Warning

    Some of these tools use mains electricity and heated parts. Always follow connection instructions and never leave heated elements unattended.

    1. 3D printer

    The 3D printer is a fairly recent addition to the maker scene. To be able to print something solid a few years ago was like science fiction, but now it’s a reality. Printers come in many sizes and prices, so you can match your printer to your budget and requirements. There are several choices for filament too, such as PLA (a good beginner’s choice) or ABS and many other more specialised types. If you have the time and patience, you can get a small unassembled one for less than £100, but for better quality (and less frustration) you may want to spend a bit more.

    Affordable 3D printing

    Download a copy of The MagPi 69 to learn all about affordable 3D printing.

    In a 3D printer motors move the printhead and heated flatbed in three dimensions as the melted filament is built up in layers. The filament is pushed into the extruder head and melted before it hits the printing surface

    2. Breadboard

    Breadboards are solderless circuit boards and allow for fast prototyping of projects. The boards come in several sizes and consist of a matrix of small connector holes into which components and jumper wires can be inserted to make circuits. Click here for our breadboard tutorial.

    Breadboards are solderless circuit boards that allow for the fast prototyping of projects

    3. Speaker

    Some projects need to make a noise, and the sound quality depends on the type of speaker you use. There are small piezoelectric speakers if all you need are beeps and pops; alternatively, you may need a larger dynamic speaker.

    A mini speaker can vastly improve Raspberry Pi's audio output

    4. LEDs

    LEDs (light-emitting diodes) are a bit like very small and efficient light bulbs. They glow when current is passed through them, but they need to be connected correctly. Because they are diodes, the current only flows one way, unlike in conventional light bulbs.

    5. Resistors

    Resistors are used in electrical circuits to reduce current flow. They are used for many reasons, including changing the brightness of an LED. They can be a fixed value, with stripes to indicate the resistance; or variable, with a slider or dial to change the resistance.

    6. Motors

    When a current is applied to an electric motor, a spindle in the centre rotates. It spins because of an electromagnetic field that is caused by the flow of current. Motors come in all kinds of sizes, from mini drone motors to industrial ones.

    Motors come in all kinds of sizes, from mini drone motors to industrial ones

    7. Diodes

    Diodes are known as semiconductors because they only conduct electricity in one direction. This can be useful for a number of reasons; for example, to protect your Raspberry Pi from being damaged if you are connecting it to motors.

    8. Sensors

    There are many types of electronic sensors. You may want to detect light or vibration, sound, or heat. There are sensors for all of these and many more. Sensors allow us to capture data about the world around us.

    Use sensors to detect motion, light, heat, sound or vibration

    9. Code editor

    There are several code editors for Raspberry Pi. IDLE used to be the standard Python editor in Raspbian, but now you might want to give Thonny or Geany a go. If you are feeling adventurous, you could try installing PyCharm.

    Use a text editor to craft the code to control your Raspberry Pi

    10. SSH and VNC

    If you want to run your Raspberry Pi headless (without monitor, keyboard, and mouse), you will probably want to connect to it by typing in commands using SSH, which provides a terminal, or you can have a windowed version with VNC.

    Tools for building & prototyping

    11. Clamps

    For holding bits of your build together until it’s stuck or you need to change it.

    12. Crocodile clips

    Connect one component to another without soldering, tape, or breadboard.

    13. Crimping tool

    Pinches connectors onto wire, fixing it to the connector. Can also can cut/strip wires.

    14. Screwdrivers

    You’re going to need several different screwdrivers of different sizes/types.

    15. Craft knife

    Stanley knives are good for most work, but you might also want something lighter.

    16. Tweezers

    Tweezers can get you out of a fix when that little screw disappears.

    17. Hot glue gun

    Sometimes there is no substitute, but it’s not suitable for the young ’uns.

    18. Hand drill

    Most of the time a cordless is best.

    19. Saw

    Hacksaws for metal/plastic parts, jigsaw/circular for big builds, mitre saws for angles.

    20. Pliers

    A good set of long-nose/snipe-nose pliers should be on hand at all times.

    21. Etcher

    Because your Raspberry Pi generally relies on being booted from an operating system on a microSD card, you will require a way to write that data first. The open-source program you need for this is called Etcher from Balena.

    Use balenaEtcher to image your boot file

    22. Gears and wheels

    If you are making any sort of moving robot, you’re probably going to need wheels or gears. Some kits come with them, such as the CamJam EduKit 3. You can buy them separately or even 3D-print them.

    Tools for storage

    23. USB stick

    Add extra storage to your Raspberry Pi with a USB thumb drive. You can store more files than the microSD card, and you can transfer files from another computer to your Raspberry Pi.

    24. Memory card

    Make sure you have multiple microSD cards. An 8GB microSD card can be used to install Raspbian and other operating systems. It’s a good idea to have your regular microSD card and at least one other card for testing out projects.

    25. Storage box

    When making projects, you quickly rack up additional kit – not to mention cables, components, and Raspberry Pi boards. Keep everything in one place by adding a storage box to your shopping list.

  • Sania Box encourages kids to build a PC – no adult required

    Sania Box encourages kids to build a PC – no adult required

    Reading Time: 2 minutes

    Sania Jain is one of a growing band of teenage entrepreneurs keen to share their ideas with peers. In her case, her idea is to spread a love of coding and STEAM skills with children who may not have had a chance to explore it before.

    Sania’s eponymously-named DIY computer box is powered by a Raspberry Pi Model 4 and comes with everything needed to create your own PC, barring a screen. Unlike some products supposedly aimed at inspiring kids to learn computing and electronics skills, the Sania Box computer can be built and used by children aged eight and above without adult supervision. In doing so, they’ll develop crucial STEM (science, technology, engineeering and maths) skills that will stand them in good stead both at school and outside the classroom. 

    Sania’s build-it-yourself computer comes with a Raspberry Pi 4, a keyboard, mouse and cables, plus a bespoke add-on board containing a variety of code. The preinstalled Python code is intended to help those with limited coding experience to jump straight into exploring its possibilities. Python scripts for electronics and IoT (internet of things) projects are included. 

    Sania Box is based around Raspberry Pi 4 but comes with a specially designed add-on board

    Once the Sania Box owner has mastered the codes that come with the device further codes can be downloaded from the Sania Box website. Sania envisages users „never running out of new codes to learn“ and believes coding is critical to developing creativity and problem-solving skills.

    The DIY computer kit was designed and developed by Silicon Valley startup Moonshot Junior, a startup that specifically caters for STEAM products and the youth entrepreneur market. Sania Box is currently fundraising through a Kickstarter campaign and will then be available from either Moonshot Jr or Sania’s own website.

    Sania has ambitions beyond product development, however. She has already published five books and she intends Sania Box to be an “embedded computer [used] as an interactive tool for educational outreach”. With this in mind she recently visited underprivileged parts of India, showing off the possibilities of coding.

    “I became interested in programming because programming makes up so many things in our lives. Everything I was interested in, such as robotics and computer science, was possible due to programming. I wanted to learn it so I could make things from code too,” says Sania. She hopes that, through Sania Box and code, other children will be similarly inspired.

    Sania Jain shares her love of coding and technology with pupils at at school in India

  • Sania Box encourages kids to build a PC – no adult required

    Sania Box encourages kids to build a PC – no adult required

    Reading Time: 2 minutes

    Sania Jain is one of a growing band of teenage entrepreneurs keen to share their ideas with peers. In her case, her idea is to spread a love of coding and STEAM skills with children who may not have had a chance to explore it before.

    Sania’s eponymously-named DIY computer box is powered by a Raspberry Pi Model 4 and comes with everything needed to create your own PC, barring a screen. Unlike some products supposedly aimed at inspiring kids to learn computing and electronics skills, the Sania Box computer can be built and used by children aged eight and above without adult supervision. In doing so, they’ll develop crucial STEM (science, technology, engineeering and maths) skills that will stand them in good stead both at school and outside the classroom. 

    Sania’s build-it-yourself computer comes with a Raspberry Pi 4, a keyboard, mouse and cables, plus a bespoke add-on board containing a variety of code. The preinstalled Python code is intended to help those with limited coding experience to jump straight into exploring its possibilities. Python scripts for electronics and IoT (internet of things) projects are included. 

    Sania Box is based around Raspberry Pi 4 but comes with a specially designed add-on board

    Once the Sania Box owner has mastered the codes that come with the device further codes can be downloaded from the Sania Box website. Sania envisages users „never running out of new codes to learn“ and believes coding is critical to developing creativity and problem-solving skills.

    The DIY computer kit was designed and developed by Silicon Valley startup Moonshot Junior, a startup that specifically caters for STEAM products and the youth entrepreneur market. Sania Box is currently fundraising through a Kickstarter campaign and will then be available from either Moonshot Jr or Sania’s own website.

    Sania has ambitions beyond product development, however. She has already published five books and she intends Sania Box to be an “embedded computer [used] as an interactive tool for educational outreach”. With this in mind she recently visited underprivileged parts of India, showing off the possibilities of coding.

    “I became interested in programming because programming makes up so many things in our lives. Everything I was interested in, such as robotics and computer science, was possible due to programming. I wanted to learn it so I could make things from code too,” says Sania. She hopes that, through Sania Box and code, other children will be similarly inspired.

    Sania Jain shares her love of coding and technology with pupils at at school in India

  • Sania Box encourages kids to build a PC – no adult required

    Sania Box encourages kids to build a PC – no adult required

    Reading Time: 2 minutes

    Sania Jain is one of a growing band of teenage entrepreneurs keen to share their ideas with peers. In her case, her idea is to spread a love of coding and STEAM skills with children who may not have had a chance to explore it before.

    Sania’s eponymously-named DIY computer box is powered by a Raspberry Pi Model 4 and comes with everything needed to create your own PC, barring a screen. Unlike some products supposedly aimed at inspiring kids to learn computing and electronics skills, the Sania Box computer can be built and used by children aged eight and above without adult supervision. In doing so, they’ll develop crucial STEM (science, technology, engineeering and maths) skills that will stand them in good stead both at school and outside the classroom. 

    Sania’s build-it-yourself computer comes with a Raspberry Pi 4, a keyboard, mouse and cables, plus a bespoke add-on board containing a variety of code. The preinstalled Python code is intended to help those with limited coding experience to jump straight into exploring its possibilities. Python scripts for electronics and IoT (internet of things) projects are included. 

    Sania Box is based around Raspberry Pi 4 but comes with a specially designed add-on board

    Once the Sania Box owner has mastered the codes that come with the device further codes can be downloaded from the Sania Box website. Sania envisages users „never running out of new codes to learn“ and believes coding is critical to developing creativity and problem-solving skills.

    The DIY computer kit was designed and developed by Silicon Valley startup Moonshot Junior, a startup that specifically caters for STEAM products and the youth entrepreneur market. Sania Box is currently fundraising through a Kickstarter campaign and will then be available from either Moonshot Jr or Sania’s own website.

    Sania has ambitions beyond product development, however. She has already published five books and she intends Sania Box to be an “embedded computer [used] as an interactive tool for educational outreach”. With this in mind she recently visited underprivileged parts of India, showing off the possibilities of coding.

    “I became interested in programming because programming makes up so many things in our lives. Everything I was interested in, such as robotics and computer science, was possible due to programming. I wanted to learn it so I could make things from code too,” says Sania. She hopes that, through Sania Box and code, other children will be similarly inspired.

    Sania Jain shares her love of coding and technology with pupils at at school in India

  • Add navigation to a low-cost robot

    Add navigation to a low-cost robot

    Reading Time: 7 minutes

    If you completed the steps in the last low cost robot-building article, you’ll have added a camera to your Raspberry Pi-powered lunchbox robot. This enabled your robot to take photos and provided a robot’s-eye view of the world. Now a robot builder gets to take this much further and make the robot use this camera to make decisions about the world.

    In this tutorial we’ll look at how to make an environment for testing computer vision. It demonstrates using OpenCV to condition images, to remove noise and simplify them. You’ll learn how to extract data, check the content of an image and how to make a robot turn.

    For instructions on how to build your lunchbox robot click here.

    Lunchbox robot in our colour-controlled test area. The robot's camera sees which colour wall is in front of it. The robot uses this information to choose which way to turn

    You’ll need

    1. A test course

    For trying out behaviours, robot builders make test courses. The goal is to create an environment with only the specific features to try out the robot. Find a floor area in a neutral colour, ideally somewhere white or grey without patterns or colour.

    Make walls using flat colours such as red, blue, green and yellow. A toy box or coloured card work for this. Use white or neutral background walls. Cameras take better pictures with bright and consistent lighting. In good lighting, colours are clearer, making processing easier. Good options are daylight or bright white indoor lighting. Avoid tinted or patchy lighting.

    Top tip: Lighting matters

    Lighting should be neutral in colour, bright and diffused. Spotlights, low light and coloured lights cause problems with visual processing.

    2. Installation

    This step may take some time. Plug a mains-powered USB adapter into the robot’s Raspberry Pi before proceeding. Before installing the packages, make sure Raspbian is up to date with:

    sudo apt update –allow-releaseinfo-change

    There are some system packages needed for running the Python libraries.

    sudo apt install libcairo-gobject2 libwebp6 libilmbase23 libgdk-pixbuf2.0-0 libjasper1 libpango-1.0-0 libavcodec58 libavutil56 libcairo2 libswscale5 libatk1.0-0 libgtk-3-0 libtiff5 libpangocairo-1.0-0 libavformat58 libopenexr23 libgfortran5 libatlas3-base

    Finally, install the Python packages needed for OpenCV, NumPy, and picamera:

    sudo pip3 install opencv-python-headless numpy imutils picamera[array]

    3. Set up the camera

    The function setup_camera in the file find_contours.py gets the camera ready. For quick processing time, and to simplify the image, line 11 sets a camera resolution of 128×128.

    Our robot’s camera is upside down, so the rotation is set to 180 degrees. Using camera features saves processing on Raspberry Pi.
    Line 14 creates capture_buffer, space to store image data from the camera. Lines 15 and 16 start the camera with two seconds of warm-up time.

    With the robot in front of a coloured wall, run the following commands:

    export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1

    python3 find_contours.py

    This code send the camera’s captured image to the file original.png.

    4. A little colour theory

    Computers store colours as RGB or BGR, for red, green, and blue pixels. In find_contours.py, on line 21, we convert the image from BGR to the HSV colour system, which is suitable for this image processing.


    Figure 1
    shows how HSV works. Saturation measures how vivid or intense the colour is, from a low value being white or grey, to a full value being vivid. Hue indicates the colour – red, orange, blue, green, yellow, etc.

    Transforming the image into HSV – Hue, Saturation, and Value – lets the robot pick out colour intensity (saturation) and then find its tint (hue), while mostly ignoring the colour brightness (value).

    Figure 1: The HSV colour space

    5. Image processing pipelines

    The code processes images from the camera through a series of transformations to find the colour of a wall. Each transform is a small step; for example, finding all the pixels that match a criteria or making an outline of an area.
    Later stages use the transformed output of earlier ones. The outputs are joined to other inputs, forming a pipeline.

    The diagram in Figure 2 shows where data flows from one process to another, making it easier to understand what is going on. Use images from real outputs, boxes for stages, and lines to show the flow of data.

    Figure 2: It takes a few steps for visual processing, with a number of transformations. A pipeline is a useful way to visualise this

    6. Thresholding or masking

    Thresholding tests if every pixel has values within a range. Line 22 of find_contours.py uses cv2.inRange for this. It makes a new binary image, storing True if the pixel has values between the lower limits and the upper limits.

    The find_contours.py range allows all hue values while filtering for saturation values over 140, for only vivid colours and the value component to values brighter than 30. The output file masked.png shows the output, with coloured walls in white (see Figure 3 for an example).

    The S and V values of the lower bound on line 22 can be adjusted up if too much area is matching, or down if too little is.

    Figure 3: Example of a masked or thresholded image. Pixels are only on (white) or off (black)

    7. Finding contours

    OpenCV can inspect a black and white image and find outlines for different areas. It calls these outlines contours. In find_contours.py, lines 28 and 29 obtain a list of contours. Each contour is a list of points describing the outline.

    On line 30, the contours are sorted by area. By finding the first contour in this list (the biggest), the code has likely found the most significant coloured area.

    On line 48, the contour is drawn out to a debug image with_contours.png. Run the code and download the image to see how the contours look (see Figure 4 for an example).

    Figure 4: This is the original image, after a contour has been found from the threshold image and drawn back on it

    8. Finding the colour

    For this code to choose by colour, it needs the hue from the middle of the contour. It takes this colour from the original picture. The robot uses OpenCV moments for finding the middle of a contour.

    By dividing the sum of X coordinates (m10) by their count (m00), the code obtains the average X, their centre. The code also obtains the average and centre of the Y coordinates (m01 divided by m00). The middle of the contour comes from combining these.

    The code on line 36 of find_contours.py extracts the colour from the hsv output at the middle of the contour.

    9. Using the pipeline in a robot

    The get_saturated_colours function is imported from find_contours.py, enabling this code to reuse the pipeline from already tested code.

    A continuous stream of images is needed to use the pipeline to drive the robot. Line 8 of camera_nav.py creates this stream; line 9 extracts the data. Line 8 sets up the main loop as a for loop that runs forever with a new image each time.

    The main loop puts the image through the pipeline and uses the output to determine if the robot turns right, left, or goes forward. The camera’s image rate sets the timing.

    The colour returned by get_saturated_colours is HSV.

    10. Matching the colour

    The camera_nav.py code uses the hue component from get_saturated_colours.
    OpenCV stores a hue value as degrees divided by 2 to fit into 8 bits (up to 255). Figure 5 shows a colour wheel with hue values in degrees and OpenCV values.

    Figure 5: A hue colour wheel is handy for looking up colours. The figures below the degrees show the OpenCV values

    The code in camera_nav.py matches a yellow range on line 12, and a blue range on line 15, printing the matched colour and turning the robot. By setting up a series of walls of different colours, the robot can now navigate by wall colours. Expect to change these ranges for different test areas.

    Ensure the robot is on battery power and in the test course before running this.

    Extending the pipeline leads to detecting edges and finding the angle of the horizon. This could be used to line a robot up with a wall

    11. Improving robot vision

    The find_contours.py code is a simple demonstration of computer vision. It’s also easy to confuse it. Finding the image under the contour and averaging the colour would make it more stable.

    The code could be combined with distance sensors, so only walls close enough were detected. Encoders or an inertial measurement unit (IMU) could be added to make a precise turn.

    Advanced techniques such as Canny Edge Detection with HoughLines could pick out the horizon, determining the angle and distance, so the robot could line up with a wall. OpenCV is capable of face detection and even has machine learning and neural network modules.

    Top tip: Reduce background clutter

    A cluttered background causes the robot to detect random things. Neutral backgrounds without ‘noise’ make this easier to test.

    12. Further reading

    Robot vision is a significant area of study in robotics, and this article has barely scratched the surface. It’s one of the more rewarding and exciting spaces of robotics, worthy of further reading.

    The PyImageSearch site is a superb resource to learn more about computer vision and dig further into detecting different attributes from an image.

    Danny Staple (this article author’s) book, Learn Robotics Programming, has a section on computer vision, building face- and object-following behaviours, and casting the camera and pipeline stages to a mobile phone browser to view in real time.

  • Bit Time Rotary Dial Phone project showcase

    Bit Time Rotary Dial Phone project showcase

    Reading Time: 4 minutes

    The Rotary Dial Phone project is part of a wider initiative called Bit Time – a project that has been running in Basildon, Essex over recent months. It’s the brainchild of Dave Norton and Laura Travail. Dave is a digital Artist and drama practitioner whose work ranges from large-scale interactive installations to live theatre performed in a virtual world. Laura is an artist and context strategist with an outdoor theatre and live-art background.

    Lead artist Laura explains, “Bit Time is an intergenerational project, combining the skills and knowledge of the very young with those of our elders.

    Artists Dave Norton and Laura Travail run the intergenerational Bit Time project in Basildon, Essex

    „As artists and facilitators, we’ve been bringing together these ideas and possibilities into playable works that in themselves keep that momentum going. These are projects about communication technology, but they are also communication technologies in themselves. By interacting with the art, you are interacting with each other.”

    Cold calling

    So, the retro phones… where do they fit into this story? Phone project artist Dave Norton says, “The inspiration for the question/answer phones came from a desire to build a device that lets you share a message with someone you’ll never meet. A digital time capsule of anonymous thoughts, advice, stories, and memories that could be listened to by anyone. You have no idea who might hear your message and how it could affect them.”

    He explains how the system works: “You walk past a phone and it starts ringing, you pick it up and the operator asks you to answer a question, e.g. ‘what was your first phone?’, ‘what will a phone of the future look like?’ A ‘recording’ light comes on and you leave your message and hang up. Later on, you see another phone that also rings as you walk past; you pick it up and it plays back a random message left by someone else.”

    Testing a phone for use in the Rotary Dial Phone Project. Power constraints mean the phone's bell and the recording sign have to be disconnected when the Raspberry Pi that controls them boots up

    A motion detector identifies when someone walks past, while a push-button detects when the receiver is lifted. The phone’s mic and speaker are hooked up to a Raspberry Pi, which chooses a random audio file question to play. “The mic starts recording the user’s message for 15 seconds, or until they hang up, then the whole process restarts. The answer phone works in a similar way, but only chooses random audio files to play back.”

    The upcycled rotary phone: triggered by a motion detector, each phone starts ringing when someone walks past it. Raspberry Pi randomly selects and plays an audio file containing a question

    Since the installation needed to work in any kind of location, it couldn’t rely on WiFi to transfer audio files between the phones, particularly as the audio files needed to be checked manually before they could be shared with the public. “I ended up having to code a ‘syncing’ mode, which is activated when a USB drive is inserted into Raspberry Pi, which automatically transfers all the audio files to the drive,” reveals Dave.

    
Maker Dave Norton says it was easy to snip the wires from each dial phone’s speaker, microphone and hang-up button and connect them to Raspberry Pi

    You talkin’ to me?

    The Bit Time project, including the rotary dial phones, ultimately became an exhibition which toured Basildon in summer 2019. Dave says, “There’s something really unburdening about being anonymous, and something really pleasing about being given an open platform to speak your mind. I loved the idea that the installation starts as a blank slate and, as it travels to different events and locations, it collects a mixture of stories and thoughts and shares them with anyone who cares to listen, something akin to a travelling storyteller.”

    He says the phones elicited a variety of reactions. “Some people just hang up straight away, some people audibly freak out that they’re actually being recorded, some yell bizarre phrases, but most people genuinely answer the question. No two answers have been similar and it makes for some really interesting listening… We’ve ended up with hundreds of varied audio responses – it would be lovely to build some sort of audio installation using all the clips.”

    The question phone plays a random question to whoever picks up the handset and records their response

    Quick facts

    • The phones project took around three weeks to complete

    • Basildon Library Creator Space provided a location to construct the Bit Time artwork

    • A 5 V solenoid is used to ring each phone’s bell

    • Dave programmed each Raspberry Pi using Python

    • He suggests the phones could be used in the foyer of a venue after an event, to glean honest views from attendees

  • Raspberry Pi Kit and Gadget Guide

    Raspberry Pi Kit and Gadget Guide

    Reading Time: 11 minutes

    We all know that Santa loves a mince pie, but did you know that he is often partial to leaving Raspberry Pi boards under the tree of those on his ‘nice’ list?

    Well, if you got a Raspberry Pi for Christmas, then you may want to know about some of the awesome accessories you can get for it to really get the most out of your brand new computer. With so many cool accessories available, it can be a minefield knowing which ones to go for, so let us help you make up your own mind based on some ideas of ours.

    Raspberry Pi cases

    We think Raspberry Pi looks cool as it is, but a case is a highly recommended accessory. Not only will it protect your Raspberry Pi and the delicate circuitry, it can also enhance the way some of the additional accessories work when used in combination.

    Official Raspberry Pi 4 Case

    If you want an affordable, reliable, and hackable case, then you cannot go wrong with the official Raspberry Pi case. Available in red and white or black and grey, this case will house your Raspberry Pi with ease. If you’re feeling adventurous, you can also hack the case to fit a small fan for cooling!

    Price: £5
    magpi.cc/case

    The official Raspberry Pi 4 case comes in black, red, white or grey

    Pibow Coupé 4

    The Pibow by Raspberry Pi veterans Pimoroni is a classic Raspberry Pi case. Designed to be quick, easy, and cheap, the Pibow is made up of multiple layers of laser-cut acrylic. The Coupé version is slimmed down and gives easy access to Raspberry Pi’s GPIO and other inputs.

    Price: £8
    magpi.cc/pibow

    Assembling the Pibow Coupe case’s rainbow layers is fun and the result looks great

    SecurePi Case

    The SecurePi case looks very futuristic, especially with those angles! This case provides protective covers for your microSD card, USB, Ethernet and micro HDMI ports, and also has venting which is ideal for providing airflow for keeping your Raspberry Pi cool. It has space for the PoE HAT or Fan SHIM too!


    Price:
    £10 magpi.cc/securepi

    SecurePi provides a protective cover for your microSD card, USB, Ethernet and microHDMI slots and also has an air vent on top

    Aluminium Raspberry Pi 4 Case

    Aluminium is a great, lightweight metal that is also strong and is an ideal choice for a Raspberry Pi case because of these properties. This case looks great, especially if used as part of a 4K home media setup. With the holes, the cooling potential is also fantastic.
    Price: Price: £10
    magpi.cc/aluminium

    The Aluminium Raspberry Pi 4 case is strong, light and has holes to keep things cool

    Anidees Raspberry Pi 4 Case

    Made of aluminium, the Anidees case provides ample protection for your precious Raspberry Pi. It comes in two colours – silver or black – and has an extra tall version to accommodate some HATs too. Oh, and it has an clear lid so you can see your Raspberry Pi in all its glory!

    Price: £37
    magpi.cc/anidees

    Anidees Raspberry Pi 4 case: choose the extra-tall model if you want your case to accommodate some HATs too

    Our biggest fan

    Raspberry Pi 4 is the most powerful Raspberry Pi yet. All this horsepower means it can get a bit hot, though. The most effective cooling method is active cooling, which is typically accomplished with a fan. The Fan SHIM is perfect as it is low-profile, inexpensive and allows you to use the GPIO pins for other accessories.

    The Fan SHIM has a low profile and effectively cools the Raspberry Pi 4

    Essential add-ons

    Raspberry Pi Keyboard

    You’ll need a keyboard in pretty much every Raspberry Pi project going. The Raspberry Pi Keyboard comes in a variety of layout options, and is available in two colour schemes. Not only does the keyboard connect via USB, it also has three additional USB 2.0 ports to free up ports on your Raspberry Pi.

    Price: £16 magpi.cc/keyboard

    The Official Raspberry Pi Keyboard double as a hub with three extra USB ports

    Raspberry Pi Mouse

    Something simple, yet extremely effective and an essential accessory for any Raspberry Pi project, allowing you to navigate through any graphical user interface. The Raspberry Pi Mouse, when combined with the Raspberry Pi Keyboard, can be powered from the keyboard’s USB hub, keeping those precious ports free on your Raspberry Pi itself.

    Price: £7
    magpi.cc/mouse

    Rii i8+ Mini Wireless Keyboard

    If you want to go one step further, why not combine the keyboard and mouse into one and make it wireless while you’re at it? With the Rii i8 Mini Wireless Keyboard with Touchpad, you can do just that! The supplied USB wireless dongle plugs into your Raspberry Pi and connects automatically.

    Price: £18
    magpi.cc/wirelesskeys

    The Rii i8+ mini wireless keyboard is a convenient way to add functionality to your Raspberry Pi setup

    Retro Cube Bluetooth Speaker

    Why use a USB port or cable when you can use Bluetooth to keep things wireless? This little speaker, by retro gamepad specialists 8bitdo, is a fantastic little Bluetooth speaker. Styled like a retro console controller, this rechargeable speaker provides up to eight hours play after one hour of charging.

    Price: £18 magpi.cc/speaker

    The 8bitdo Bluetooth speaker entertains for up to 8 hours before needing to be recharged

    4 Port USB Hub

    Whilst Raspberry Pi has four USB ports, they can be used up quickly depending on how you are using it. Having a dedicated USB hub is always handy, particularly if you have a Raspberry Pi Zero. This four-port hub has both USB and micro USB connectors, so works on any Raspberry Pi!

    Price: £8 magpi.cc/usbhub

    With both standard USB-A and microUSB ports, this 4-port hub has you covered

    We recommend: USB microSD card adapter

    If you’re regularly writing microSD card images for your Raspberry Pi, a USB microSD card adapter is a great tool to have, especially if your computer doesn’t have an SD card slot.

    magpi.cc/usbsd

    Cool HATs

    There are hundreds of HATs available for Raspberry Pi. As they are so easy to connect and set up, they are a perfect accessory

    Enviro

    The Enviro is a fantastic piece of kit. It allows you to monitor a number of environmental factors, such as temperature, light, and sound. The fully-featured Enviro + Air Quality version also includes a gas sensor. Simply connect to your Raspberry Pi, install the code, and you’ll have your very own monitoring station.

    Price: £28
    magpi.cc/enviro

    Use the Enviro HAT to monitor temperature, light and sound. There's also a version that measures air quality and acts as a gas sensor

    Display-O-Tron HAT

    The Display-O-Tron HAT is a fantastic little screen, backlit with controllable RGB LEDs, has six capacitive touch buttons, and also features a small LED bar graph! If you want to run your Raspberry Pi ‘headless’ (i.e. without a screen connected), then the Display-O-Tron HAT is ideal.

    Price: £23
    magpi.cc/displayotron

    Display-O-Tron HAT: ideal for displaying data without a computer screen

    Sense HAT

    If you want something a little more ‘out of this world’, then the Sense HAT is a perfect choice. Used on the International Space Station as part of AstroPi, the Sense HAT monitors temperature, humidity, pressure, and orientation. It also has an 8×8 LED matrix on top for additional display purposes.

    Price: £30 magpi.cc/sensehat

    The Sense HAT - as used on the International Space Station - is packed with environment-monitoring sensors

    TV HAT

    TV on a Raspberry Pi? Yes, that’s right! With the TV HAT and a bit of configuration, you can set your Raspberry Pi to receive terrestrial television channels. It is even possible to record TV shows so that you can watch them back at your leisure too!

    Price: £20
    magpi.cc/tvhat

    Use the TV HAT to receive terrestrial TV signals on your Raspberry Pi

    pHAT DAC

    A DAC (digital-to-analogue converter) is a must for anybody who takes listening to music seriously. The quality of your music is much better when a DAC is used, and the pHAT DAC is a great little accessory that you can use to play music to your heart’s content.

    Price: £13
    magpi.cc/phatdac

    pHAT DAC materially improves audio on your Raspberry Pi

    Electronic starter kits

    A Raspberry Pi can do more than play retro games or videos. Thanks to the GPIO pins, you can interact with a variety of sensors and devices.

    Jam HAT (LED & Buzzer Board)

    If you’re not that good at soldering and want something that is pre-assembled in a HAT form, then the Jam HAT is a great alternative. With LEDs, buttons and a buzzer, you can use the code examples provided to create your own unique projects, all for under a tenner!

    Price: £7
    magpi.cc/jamhat

    Jam HAT is a simple board that adds LEDs, buttons and a buzzer to give pizzazz to your coding projects

    CamJam EduKit

    Prototyping is a great way to start experimenting with sensors, LEDs, buzzers, and everything else that can be connected to a Raspberry Pi. The CamJam EduKit contains a breadboard, an essential tool that allows you to make your own prototype circuits without soldering a thing, as well as other essential components.

    Price: £5
    magpi.cc/edukit

    CamJam EduKit provides buzzers, sensors, LEDs, a breadboard and connectors for prototyping circuits

    We recommend: Resistor lead bending tool

    Prototyping is essential, and this handy tool makes it easier to bend those resistors into breadboard-friendly form.

    magpi.cc/resistorbend

    Gaming kits

    Feeling adventurous? Have a go at building your own Raspberry Pi-powered gaming setup.

    TinyPi Pro

    What good is a portable games console unless it fits in the smallest of pockets? Enter the TinyPi Pro – a do-it-yourself kit that is a small but perfectly formed games console. These sell like hot cakes, but are a real gem if you can get a hold of one, and you’ll learn lots during the build.

    Price: £90 magpi.cc/tinypipro

    TinyPi Pro offers a DIY approach to portable gaming

    BASIC Monster Arcade Controller Kit

    If the full Picade kit is a bit too lavish for you, then the Arcade Controller Kit by Monster is a great alternative. With this kit, you’ll build an arcade stick that houses your Raspberry Pi, which can be connected to your TV for a more portable setup.

    Price: £60
    magpi.cc/monsterbasic

    BASIC Arcade Controller Kit is a Raspberry Pi house-cum-joystick

    PiGRRL 2.0 kit

    If you fancy 3D-printing your own case (designs are included) and putting your build skills to the test, then consider the PiGRRL 2.0 kit. You’ll need to supply the Raspberry Pi and the case, but you’ll have a great time putting it all together and testing it out when complete.

    Price: £56
    magpi.cc/pigrll2

    PiGRRL 2: Make your own handheld games console with a case and parts you print yourself

    Picade

    When it comes to arcade kits, Pimoroni’s Picade is king, and for very good reason! The kit is expertly crafted and has been refined since it was initially launched after a successful Kickstarter campaign. It comes in two options – with an 8-inch or 10-inch display – and with detailed step-by-step build instructions and videos.

    Price: £150 to £195
    magpi.cc/picade

    Pimoroni Picade is an expertly crafted miniature arcade machine

    Gaming accessories

    Raspberry Pi is an excellent choice for emulating and playing retro games. But what accessories should you consider?

    SN30 Pro+ Bluetooth Gamepad

    There are so many controllers to choose from, but 8BitDo’s wireless gamepads are an excellent choice. The quality and looks of these controllers really add that ‘wow’ factor to any retro gaming build. This one has analogue thumbsticks and comes in a choice of three colours.

    Price: £45
    magpi.cc/sn30pro

    8bitdo SN30 Pro+ Bluetooth games controller adds a wow factor to Raspberry Pi gaming

    MEGAPi Case

    If you’re going to build a retro gaming system, what better than this fantastic scaled version of the Sega Mega Drive from RetroFlag? Their cases are spectacularly well designed and this one is the perfect combination of nostalgia and functionality, especially with the programmable shutdown buttons and cooling fan.

    Price: £25 magpi.cc/megapi

    MEGAPi Case: a scaled-down version of the classic Sega Mega Drive complete with programmable buttons

    GPi Case

    Why not go one step further and make a portable retro gaming system? The GPi Case is a beautiful replica of a retro handheld console, and the attention to detail is breathtaking. A Raspberry Pi Zero (not supplied) is housed in a detachable cartridge and it even runs off regular AA batteries for gaming on-the-go.

    Price: £60
    magpi.cc/gpicase

    Create your own Raspberry Pi Zero-based retro handheld games console with the GPi Case

    Classic USB Games Controller

    If you want functionality without breaking the bank, then the classic USB game controller is an excellent choice. Modelled on a classic controller, this connects to your Raspberry Pi via USB – and a generous cable length means you don’t need to sit too close to your TV to play!

    Price:
    £8
    magpi.cc/usbcontroller

    At £8, the Retro-bit USB game controller is an affordable way to use your Raspberry Pi as a gaming device

    We recommend: Micro USB to USB-C adapter

    This little adapter lets you use your existing micro USB power supplies with the new-style USB-C ports on Raspberry Pi 4.

    magpi.cc/microusbc

    Robot building kits

    R2-D2 or C-3PO? Or are you more of a BB-8 fan? No matter your favourite, you can always build your own with one of these kits.

    CamJam EduKit #3

    If you are after a budget kit, this CamJam one is a great introduction to robotics. You’ll need to supply your own Raspberry Pi and chassis (something to attach the kit to), but it’s a great way of getting into the world of robotics before delving into something a little more complex.

    Price: £18 magpi.cc/edukit3

    CamJam EduKit #3 offers a low-cost introduction to robotics

    STS-Pi

    The STS-Pi is a great little robot kit that gives you the bare bones to build a two-wheeled roving robot. You’ll need to supply a Raspberry Pi, Camera Module, and motor driver (such as the Explorer pHAT), but you’ll learn the basics of robotics with this nifty kit.

    Price: £23
    magpi.cc/stspi

    STS-Pi is a great two-wheeler robot kit

    MeArm

    These types of robots are used in manufacturing and engineering plants – well, maybe not Raspberry Pi versions, but the same style. With the MeArm kit, you can build a robotic arm that is controlled using the two supplied thumbsticks (or with code). An ideal option for a budding robotics engineer!

    Price: £70
    magpi.cc/mearm

    MeArm is a controllable robotic arm - just like those used in industry

    MonsterBorg

    The title says it all here: this is the ultimate Raspberry Pi robot and is designed to withstand some punishment. The chassis is rugged and made of aluminium, and the wheels make it a great off-road choice, especially with the three hours run time. Oh, and it runs any side up, too!

    Price: £210
    magpi.cc/monsterborg

    We recommend: MotoZero

    A motor driver capable of powering four motors, this board is a great and affordable choice for any robotic build.

    magpi.cc/motozero

    Picade X HAT USB-C

    If you fancy building your own arcade setup without a kit, this add-on makes controller configuration a breeze. It works with the Pi 4 too!

    magpi.cc/xhat

    Picade Plasma kit

    Want flashy LED arcade buttons instead of plain ones? This kit adds all the jazziness you’ll need! It comes in six- or ten-button options.

    magpi.cc/picadeplasma

  • Learn R with Raspberry Pi

    Learn R with Raspberry Pi

    Reading Time: 3 minutes

    DataCamp

    Price: FREE (or $568 per year)

    Created by: datacamp.com

    R is a language intrinsically linked to data and statistical analysis. Popular with scientists and number crunchers, it has fans around the globe.

    If you’ve spent a lot of time in Python and other programming languages, some of the features of R are confusing at first. Assignment operators are arrows, and lists are one-indexed (with the first item starting at position one, rather than zero). All of this is designed to make working with large datasets more friendly.

    DataCamp is a great learning resource for R, Python, and SQL. It uses a web-based code editor (which admittedly, we have mixed feelings about). The basic course is free, and you can pay for a DataCamp subscription to access a wide range of advanced courses. A subscription isn’t cheap though, coming in at over $568 per year, although there are frequent half-price sales and it is aimed at budding data scientists.

    Datacamp helps you learn the statistic-focused language and is ideal for wannabe data scientists

    Coursera

    Created by: Duke University & John Hopkins University
    Price: £38 / $49 (per month)

    Coursera offers a range of courses from universities. There are two that should be of interest. The first is Introduction to Probability and Data from Duke University (magpi.cc/courseraprobability), with a 4.7 star rating. Led by Mine Çetinkaya-Rundel, Associate Professor of the Practice Department of Statistical Science, the course features R, but it’s more about learning to crank data. It gives you a grounding in probability and Bayes’ rule. It covers sampling methods, and forms part of a larger Statistics with R Specialization, which you can take to learn more about R.

    The second suggested course is R Programming from John Hopkins University (magpi.cc/courserar). This will get you closer to the R language.
    After a seven-day free trial, you’ll pay Coursera a monthly fee to access the courses.

    Coursera provides access to online learning tools provided by respected academic institutions

    Introduction to R for Data Science

    Created by: Microsoft

    Price: FREE ($99 certificate)

    We’re big fans of the edX platform, which offers a range of courses from respected universities and organisations. Its Introduction to R for Data Science course is provided by Microsoft and runs on the DataCamp platform (so it’s an interactive web approach). This is interspersed with video tutorials and short online quizzes. The edX community is vibrant, with an active forum that is ready to answer any questions you might have.

    It’s an accessible course and, thanks to being on edX, you can enrol and take the course for free. You only need to pay to get a certificate at the end.

    The edX platform offers curated learning content from the likes of Harvard, MIT and Microsoft

    R websites

    Bookmark these webpages while learning R.

    R-bloggers

    R-bloggers is a website aggregator for blogs on R. In it, you’ll find the latest contributions from hundreds of different R bloggers.

    Keep abreast of what's being posted online about R with the R-blogger content aggregator

    R-exercises

    R-exercises aims to help people develop and improve their R programming skills. R-exercises was initiated and is maintained by Research for Decisions, a Dutch research and consulting firm.

    Revolutions

    Revolutions (blog.revolutionanalytics.com) is a blog dedicated to news for the R community. It’s a great place to find out recent developments and news.

    Data sources

    Data

    The US and UK governments have made huge datasets open. Everything from business figures to the environment, through mapping and spending, can be found online at
    data.gov.uk.

    The UK and US governments publish vast data sets you can use. UK ones can be found at data.gov.uk

    Kaggle

    Kaggle is an online community owned by Google. It’s a great resource for datasets, as well as featuring blogs, competitions, and tools.

    Dataquest

    There’s a range of datasets around, from Google, Wikipedia, and Amazon, and even news outlets such as BuzzFeed. Dataquest has a great list of sources for you to bookmark.

  • Smart classroom assistant machine learning tutorial

    Smart classroom assistant machine learning tutorial

    Reading Time: 7 minutes

    First, you’ll create an assistant that uses a list of rules for understanding commands, and you’ll learn why that approach isn’t very good. Next, you will teach the assistant to recognise commands for different devices by training it using examples of each command.

    Smart-Classroom: Use machine learning and Scratch to turn on a lamp and control a fan

    1. Get started

    Head to machinelearningforkids.co.uk in a web browser. You’ll then need to click on ‘Get Started’, and then click on ‘Try it now’.

    The Machine Learning for Kids website helps you get started with AI

    2. Create a project

    Click on Projects in the menu bar at the top, and then click on the ‘+ Add a new project’ button. Name your project ‘smart classroom’ and set it to learn to recognise text, then click on Create. You should now see ‘smart classroom’ in the projects list; click on this project.

    Select Project templates and name your new project 'smart classroom'

    3. Prepare the project

    Now we need to get a project ready in Scratch. Click on Make, click on Scratch 3, then click on ‘Scratch by itself’. The page then warns you that you haven’t done any machine learning yet. Ignore this and click on ‘Scratch by itself’ to launch Scratch. Finally, click on ‘Project templates’ and then click on the ‘Smart Classroom’ template.

    4. Add a list of rules

    Figure 1: click on 'classroom' in the Scratch sprites pane

    In this step, you will edit the project to include a list of rules to activate and deactivate the fan and the lamp. Click the classroom sprite to select it, as shown in Figure 1. Click on the Code tab and create the script shown in Figure 2. Once you’ve done that, click on File and then on ‘Save to your computer’, and save the program to a file.

    Figure 2: The Scratch code for a rules-based approach

    5. First tests

    Click on the green flag to test your program, and then type in a command and watch the program react! The following commands should all work:

    Turn on the lamp
    Turn off the lamp
    Turn on the fan
    Turn off the fan

    Type in anything else and your program does nothing! Even if you make a small spelling mistake, the program does not react.

    6. Beyond rules

    You’re telling your virtual classroom assistant to react to commands using a simple rules-based approach. But if you wanted your program to understand commands that are phrased differently, you would need to add extra ‘if’ blocks.

    The problem with this rules-based approach is that you need to exactly predict all the commands the smart classroom assistant will understand. Listing every possible command would take a very, very long time. Next, you will try a better approach: teaching the computer to recognise commands by itself.

    7. Examples for training

    Close the Scratch window and go back to the Training tool, then click on the ‘< Back to project’ link. Click on the Train button because you need to collect some examples so that you can train the computer. To collect different examples, you need to create ‘buckets’ to put the examples in.

    Train your computer to recognise commands by adding text examples to the project. Make sure you assign each command to the correct 'bucket' so it results in the correct action

    To create a bucket, click on ‘+ Add new label’ and call the bucket ‘fan on’. Click on ‘+ Add new label’ again and create a second bucket called ‘fan off’. Create a third and a fourth bucket called ‘lamp on’ and ‘lamp off’.

    Click on the ‘Add example’ button in the ‘fan on’ bucket, and type in a command asking for the fan to be turned on. For example, you could type ‘Please can you switch on the fan’. For the ‘fan off’ bucket, you’ll need to click ‘Add example’ again and then use something like ‘I want the fan off now’. Do the same for the ‘lamp on’ and ‘lamp off’ buckets.

    Add as many and as varied example phrases as you can for each command

    8. More examples for more training

    Continue to add examples until you have at least six examples in each bucket. Be imaginative! Try to think of lots of different ways to ask each command.

    For example:

    For ‘fan on’, you could complain that you’re too hot.
    For ‘fan off’, you could complain that it’s too breezy.
    For ‘lamp on’, you could complain that you can’t see.
    For ‘lamp off’, you could complain that it’s too bright.

    More is good: the more examples you give your program, the better the program should get at recognising your commands.

    Use equal numbers: add roughly the same number of examples for each command. If you have a lot of examples for one command and not the others, this can affect the way that the program learns to recognise commands.

    Make the examples really different from each other: try to come up with lots of different types of examples. For instance, make sure that you include some long examples and some very short ones.

    9. Start the training

    You will now train the program using the examples, and then test it. The program will learn from patterns in the examples you give it, such as the choice of words and the way sentences are structured. Then, based on the patterns the program finds, it can interpret new commands.

    Click on the ‘< Back to project’ link, then click on ‘Learn & Test’. Click on the ‘Train new machine learning model’ button. If you have enough examples, the program should start to learn how to recognise commands from these examples.

    10. Test the training

    Wait for the training to complete. This might take a minute or two but once the training has completed, a test box appears. Test your machine learning model to see what it has learned by typing in one of the commands you added to a bucket, and then press ENTER. The command should be recognised.

    Now type in commands that are not in the buckets. If you’re not happy with how the computer recognises the commands, go back to the previous step and add some more examples. Then select the ‘Train new machine learning model’ button again.

    Instead of writing rules for the program, you are giving the program examples. The program uses the examples to train a machine learning model. Because you are supervising the program’s training by giving examples, this machine learning approach is called supervised learning.

    11. Use it in Scratch

    Now update your Scratch program to include your machine learning model instead of the rules-based approach. Click on the ‘< Back to project’ link, click on Make, then Scratch 3. Here you can read the instructions on the page to learn how to use machine learning blocks in Scratch.

    Click on Open in Scratch 3, then on File and ‘Load from your computer’, and select the Scratch project you saved earlier. When Scratch asks you whether to replace the current project, click on OK.

    Click on the Code tab, and update your Scratch code (Figure 3) to use your machine learning model instead of the rules you first added. The ‘recognise text’ block is a new block added by your project. This new block can receive a message and return one of the four labels, based on the machine learning model you have trained.

    Figure 3: Revised for a machine learning approach, the code features ‘recognise text’ blocks

    12. Scratch AI

    Click the green flag to test your new code. Test your project by typing a command and pressing ENTER on your keyboard. The fan or lamp should react to your command.

    Make sure you test that this works even for commands that you didn’t include as examples in the buckets.

    Save your project as before. Your Scratch smart virtual classroom now uses a machine learning model instead of a rules-based approach. Using machine learning is better than using rules, because training a program to recognise commands for itself is much quicker than trying to make a list of every possible command.

    Top tip: machine learning

    You need to tell an AI what to learn. The more you give it to learn with, the better it will be. The more examples you use to train the machine learning model, the better your program should get at recognising commands.

    To learn about how to can improve the model with ‘confidence scores’, head to magpi.cc/smartclassroom.

    Top tip: Go further

    Can you get the model to tell you the weather or date? Give it a go!

    Top tip: Bring more projects to life

    Want to discover more great ‚makes‘? You can find this project and others on the Raspberry Pi projects website.

    Head to Raspberry Pi's dedicated Projects website for more great 'makes'

  • Aquatic Mini Observation System

    Aquatic Mini Observation System

    Reading Time: 3 minutes

    “My project is named AMOS (Aquatic Mini Observation System),” Murray tells us. “It is a solar-powered, autonomous airboat for measuring water quality over large, distributed areas.”

    Murray has worked on a couple of prototypes for the boat. The first one was made out of a kayak beer cooler (a small kayak that acts as a beer cooler) and had propellers that would end up getting gunked up. He also tested distance measuring with a Raspberry Pi Compute Module’s stereo vision before settling on a lidar module and a Raspberry Pi 3B+.

    “During this past winter, I built a second prototype, this time using a longer surfboard-type design constructed from glued-together insulation foam that was given a coat of fibreglass to give it some added strength and stiffness,” Murray explains. “Instead of the water propellers, a single 10-inch drone propeller and motor were used and connected to a small waterproof servo motor at the stern end of the boat. This design was lighter (about 13 kg) and longer, and although the air propeller only produced about a tenth of the thrust provided by the dual water propellers, the improved draft and hydrodynamic shape made it slightly faster in the water.”

    Sensors of all kinds are placed on the AMOS, both for navigation and data collection

    A Raspberry Pi controls the speed and angle of the air propeller, takes sensor readings from the water, interacts with the lidar module, and has several other functions so that it knows its speed and heading.

    “I’m hoping that AMOS will be used for water testing by environmental services companies, and industrial customers such as mine operators that may be required by law to confirm that pollution limits in bodies of water surrounding their operations are not exceeded,” Murray reveals. “I’m hoping also to be able to offer it at an attractive price point, with modular components so that researchers or robotic boat enthusiasts could also use it, or some subset of it, in their own projects.”

    Major tests

    The prototypes aren’t just proofs of concept, either: they’re fully functioning test beds, as Murray explains: “Approximately 150 km of testing has been completed on the second AMOS prototype in 2019. It can work well in shallow water (as little as 2 cm depth) and can travel through regions of water with lots of grass or other vegetation without any worries about getting stuck. Its airboat design works best under conditions of low wind (less than 20 km/h) and it can travel at a top speed of about 2.7 knots (5 km/h). Provided the sun is shining on a clear day and higher than about 40 degrees in the sky, AMOS can run at top speed without depleting the charge of its battery.”

    Murray plans for AMOS to be on sale in the summer, so you don’t have too long to wait.

    The AMOS is solar powered, and can maintain itself all day when it's sunny

  • CutiePi project showcase

    CutiePi project showcase

    Reading Time: 4 minutes

    Having long dreamt of owning a usable Linux-based portable device, a group of enthusiasts set out to create one and the CutiePi tablet was born. Based around a Raspberry Pi Compute Module 3+ Lite and custom carrier board, it features an 8in touchscreen, typical tablet features, and everything you need to make your Raspberry Pi projects portable.

    “We tried to make the CutiePi tablet on par with normal tablets,” says project lead Penk Chan. Penk is a digital nomad wannabe from Taiwan, currently living in Tokyo and working as a principal software engineer at The Qt Company. He’s leading a team of open-source enthusiasts to make the CutiePi tablet happen.

    Penk Chan and fellow open-source enthusiasts in Tokyo created the Raspberry Pi 3+-based CutiePi tablet

    “You’ll find a gyro, a micro-controller for battery and button monitoring, WiFi/Bluetooth and a speaker. We also kept the camera connector and made the remaining GPIO pins available, keeping it hacking friendly.” This will enable it to be used as a launchpad for users’ portable Raspberry Pi projects.

    Making a portable device isn’t easy, though. “It’s not just about the Li-Po battery nor the DC-DC step-up converter,” says Penk. “Those features that we take for granted in consumer electronics, like using the device while it’s charging, reading remaining battery level, or simply detecting a power cable plug-in, are very hard to get right with modules and kits, let alone having a user interface that works. To top it all off, you need a case that houses all the hardware parts and cables.”

    The CutiePi tablet has a Chromium-based web browser and supports all the common touch gestures

    Custom carrier

    The first CutiePi prototype was a cardboard box which housed an off-the-shelf HDMI display, a Raspberry Pi 3, and a power bank. For the second one, they stripped everything from the Raspberry Pi 3 board and soldered flex cables to replace the bulky HDMI connector, with the electronics now housed by a 3D-printed case.

    While most hobby projects would have stopped there, the team went on to create a third prototype, based on a Compute Module 3+ Lite connected to their own custom-designed carrier board. “Using the Compute Module allowed us to make the device a lot thinner, explore other form factors other than the regular Raspberry Pi 3’s, and probably most important of all, it allowed us to mass-produce the CutiePi tablet,” explains Penk.

    Taking around three months to develop, the CutiePi carrier board is based on the reference designs made freely available by Raspberry Pi, and the team have open-sourced their now OSHWA-certified hardware: magpi.cc/CutiePiBoard.

    “At the heart of this project is our love for open-source, and CutiePi is our expression of that affection,” says Penk. “All designs are available under open-source licence, and anyone who wants to produce it, or even build on it to make their next portable project, can freely do so. In fact, we advocate it.”

    Make your own CutiePi: 3D-printable files for the tablet case will be freely available

    Multi-touch display

    The CutiePi tablet features a 1280×800 MIPI-DSI display, with a five-point capacitive multi-touch panel. The user interface is built on top of Raspbian, and you can access the standard Raspberry Pi Desktop via a toggle switch. “When you toggle on over to our made-from-scratch, touch-friendly UI, you will have access to the CutiePi shell, including a WiFi settings manager, a Chromium-based web browser that supports all the common touch gestures, an on-screen keyboard with multiple languages layout, and a terminal emulator, as part of our software version 1.0 release.”

    A schematic for the CutiePi showing its components and features

    Penk tells us that in the future it will be possible to support native Raspberry Pi apps in the CutiePi shell through use of XWayland, a fully-fledged X server implementation for the Qt Wayland Compositor being used for the display.

    It all sounds very promising and, with the hardware parts near finalised, the team are focusing on the design for the final version of the tablet’s enclosure. They have decided to crowdfund the project in order to mass-produce CutiePi, so keep an eye on those crowdfunding sites for it.

    Quick facts

    • CutiePi gets its name from the Qt framework used

    • The carrier board features a sleep/wake button

    • The CutiePi prototype uses a 5000 mAh LiPo battery

    • A 3D-printable case design file will be released very soon

    • A Raspbian image will also be made available for testing

    CutiePi can be used as a ebook device as well as a touchscreen tablet

  • Top 10 advanced Raspberry Pi projects

    Top 10 advanced Raspberry Pi projects

    Reading Time: 3 minutes

    A robotic beast

    A serious robot, the DiddyBorg (£220 / $299) is diddy in name only and a true Raspberry Pi automated monster. Program it, remote-control it, or just have it sitting pretty in your workshop. Your choice.

    DiddyBorg is seriously capable robot you can program and control remotely using your Raspberry Pi

    PiGrrl 2

    DIY handheld gaming

    We’ve covered this project in a previous issue of The MagPi, but this project deserves mentioning again: with some 3D-printed parts, and some ingenious Adafruit PCB parts, you too can make a handheld console (£56 / $60).

    PiGRRL 2: Make your own handheld games console with a case and parts you print yourself

    Retro-cool at home

    This big build by Bob Clagett is incredibly thorough, and shows you how to build a wooden arcade cabinet from scratch, complete with lights and cool art.

    Bob Clagett talks you through making a full-size arcade machine. How retro-cool is that!

    Pinball table

    High score mania

    If an arcade machine is a bit too new for you, how about something a bit more classic and physical like a pinball table? This one repurposes an old bed.

    Turn an old bed into a Raspberry Pi-controlled pinball table. Genius!

    Raspberry Pi classic

    This kind of project is a classic among the community, especially as the mirror software part is so easily done. Building a frame is quite fun and a great first-time carpentry project.

    Turn your Raspberry Pi display into a magic mirror and learn carpentry skills along the way

    Take Raspberry Pi anywhere

    This tiny laptop project allows you to bring your Raspberry Pi with you wherever you want to go, and do some work while you’re there.

    By turning your Raspberry Pi into a tiny laptop you can take it out and aboutou

    Home assistant

    Voice-controlled computer

    A number of big voice services are available on Raspberry Pi. Alexa is one of the easiest to get onto Raspberry Pi, thanks to the excellent AlexaPi software.

    Scan your friends

    This big project is great for showing off at your local Raspberry Jam or maker event. It takes a lot of Raspberry Pi boards and cameras to create the project, but it does capture impressive 3D scans.

    A 3D scanner like you've never seen before, this one makes a great display piece

    3D printer controller

    Futuristic plastic printing

    Have a new 3D printer? How about interfacing it with Raspberry Pi using the amazing OctoPrint? It’s especially helpful if you think of something cool to print while on the go.

    Octoprint adds 3D printing to your Raspberry Pi and offers a web interface for on-the-move updates

    Smart CCTV system

    Recognise your visitors

    CCTV cameras with Raspberry Pi are not too difficult to put together. We like this project as it uses computer vision and face detection to recognise known people as well.

    Face detection and CCTV functions make this a smart security setup

    Learn to program

    Got the tools and the skills to raise a barn and then some, but lacking the ability to print ‘Hello World’? Take a look at our books on controlling electronics with Python and GPIO Zero and learning C.

  • Add internet access to a vintage computer using Raspberry Pi

    Add internet access to a vintage computer using Raspberry Pi

    Reading Time: 7 minutes

    The bulletin boards of the 1980s haven’t died out quite yet, but they have gone online. There’s only a handful of BBSes (bulletin board systems) that you can dial up with your old-time modem.

    If you like the idea of accessing an internet-based BBS from your Atari ST, Amiga, or BBC Micro, then we can use a Raspberry Pi computer to act as a translator. You can even use modern services like Twitter! All we need to do is get Raspberry Pi talking in one of the most popular communications protocols of all time: RS232.

    By interfacing the Raspberry Pi computer UART interface to RS232 and then using WiFi, we bridge the gap between old and new technology

    A little history

    Every Raspberry Pi computer has a form of serial access, which is one of the oldest and simplest ways of communicating with computers. These days you’re more likely to use TCP/IP, the protocol of the internet, to chat to a remote device, but back in the day it was RS232 that ruled the communications world.

    Raspberry Pi circuitry features a further simplified version often referred to UART (universal asynchronous receiver/transmitter) running at 3.3 V, but we can adapt it to ‘full’ RS232 at 12 V so that older computers can handle the signal.

    Cheat #1: If you don’t fancy soldering, you can buy these pre-assembled units (for a few pounds) that can connect to the GPIO

    You’ll need

    Top tip 1: Not just vintage

    This project works well with older PCs. Although they refer to them as COM ports, their 9-pin connectors are really RS232.

    Top tip 2: Be careful of weird wiring

    Do your research on your choice of classic machine. Some, such as the Cambridge Z88, use non-standard wiring to their connectors.

    Study and shop

    To ‘downgrade’ a Raspberry Pi to RS232, we’ll need to build a small circuit to act as a transceiver so the vintage computer can ‘hear’ our virtual modem and the RS232 signals do not fry our delicate Raspberry Pi board. Luckily, all the heavy lifting for such a job can be done by the MAX3232CPC integrated circuit. All you need to do is wire it up, add a few capacitors, and you’ll be BBSing in no time.

    Have a look at the circuit diagram in Figure 1. We’ve deliberately made it larger than it needs to be for simplicity. More experienced makers will be able to reduce it in size if they wish.

    Figure 1: the connector from the solder (rear) side. Use DuPont-style jumper cables to connect the circuit to your GPIO. Make sure you wire up correctly to pins 2 and 3 and ground it

    Soldering the main circuit

    Time to get building. Thankfully, the circuit itself is not very complicated, but it’s also unforgiving, so make sure all the wiring is in the correct place or nothing will work! We recommend starting with the IC socket, then the wiring, followed by the capacitors, finishing with the headers (optional if you’d like to use jumper cables). The result takes the two transmit (TX) and receive (RX) lines from the GPIO and feeds them into the IC. The MAX3232CPC converts the data into RS232 standard and outputs them to the 9-pin D connector and vice versa. Check and double-check everything.

    Add connectors

    Unless you’re going for a permanent setup or looking to make it as low-profile as possible, we recommend using DuPont-style jumper cables to connect the circuit to your GPIO. Which model of Raspberry Pi you use is up to you, but unless you have a specific use case in mind, a Raspberry Pi Zero W is the perfect choice as it’s small and there’s little horsepower required. You will also need to solder up the 9-pin D connector. The diagram (Figure 1) shows the connector from the solder (rear) side. Make sure you wire up correctly to pins 2 and 3 and ground it too.

    Raspberry Pi time

    Your Raspberry Pi Zero W will need a bit of configuration before you can get going. Start with a fresh microSD card with Raspbian Lite (we don’t need a desktop, but feel free to install ‘full’ Raspbian if you wish). This is also a great project for reusing any old low-capacity microSD cards you have, as there’s not much software to install. Once booted up, make sure everything is up to date by running sudo apt -y update && sudo apt -y upgrade. Time to grab a refreshing beverage as Raspbian applies all the latest updates.

    Prepare your virtual modem

    An ‘out of the box’ Raspbian installation isn’t quite ready to go back to the 1980s just yet, so we need to do a little further configuration. From the command line, run sudo raspi-config to start the Raspberry Pi configuration utility. From the top of the menu, start by changing your password (optional, but recommended); then, under Network Options, set your host name (again, optional) and configure WiFi. Finally, under Interfacing Options, enable SSH and Serial. When asked ‘Would you like a login shell’, select ‘Yes’. Now exit the utility and shut down the computer (sudo shutdown).

    Cheat #2: The simplest solution of all is the widely available USB-to-RS232 cables based on the Prolific PL2303 chipset

    Testing time

    Check your circuit board for any short circuits or dry solder joints. Once happy, connect it to the GPIO. There are four connection points: one for 3.3 V (physical pin 1), ground (pin 9), and TX/RX (pins 8 and 10 respectively). We recommend getting an RS232/USB cable and testing with a modern computer first. Connect the 9-pin connectors together and boot your Raspberry Pi. Now, using your favourite Terminal emulator program (we like Serial for macOS), try to connect over RS232. Raspbian’s default settings are 115,200bps (connection speed), eight data bits, no parity, one stop bit (aka 8N1).

    Troubleshooting

    Having problems? RS232 can be a tricky beast as, unless everything is perfect, nothing will work at all. The most common issue will be polarity of the TX and RX lines. For things to work, the RX of the GPIO must be connected via the MAX3232CPC to the TX line of the computer and vice versa.

    Start by checking that your speed is correct and the protocol is set for 8N1. Also try ‘reset’ or ‘send break’ in your terminal emulator, which is sometimes needed to wake up the connection. Finally, try using a null modem cable (which crosses over the lines) or swapping the connectors to pins 8 and 10.

    Get online

    If everything is working, you should now be greeted with the Raspbian terminal login (you might need to press ENTER a couple of times to wake it up). You can now log in as normal. If the connection is behaving, feel free to try it out on a real vintage machine. Some may require adapters to connect (1990s home computers favoured 25-pin D connectors).

    You will probably need to reduce the speed of the connection, as many older computers cannot handle the default 115,200bps. Unless your computer is very old, 9,600bps will probably work. To set the port to this, enter the following from an SSH session:

    sudo stty -F /dev/serial0 9600

    Connect to a BBS

    Almost every BBS is now online and ‚talks‘ using a protocol called Telnet. It is very insecure, sending plain text over the internet and has since been replaced with SSH (Secure Shell). However, many of these services are being run on original equipment that has no support for SSH, so Telnet it is.

    Many classic BBSes are still online, some even supporting PSTN modems. These days, most can be found at the end of an IP address

    The Telnet client software is not installed by default, so run sudo apt install telnet. Once finished, try connecting to the popular Particles BBS (running on an Apple II/e!), by entering:

    telnet particlesbbs.dyndns.org 6400

    Within a few seconds you’ll see a welcome message. After you’ve had a look around, use CTRL+] followed by ‘exit’ to leave Telnet.

    Emulate a classic modem

    If you want a genuine experience, and full compatibility with vintage BBS software, it’s easy to emulate the classic Hayes AT command-set. To install the emulator:

    sudo apt install tcpser

    Before running tcpser, go back into raspi-config, select ‘Interfacing Options’, then ‘Serial’, and answer ‘No’ when asked if you want a login shell to be accessible and then ‘Yes’ if you want the serial port to be enabled. Now start tcpser using SSH:

    tcpser /dev/serial0 -s 9600 -l 7

    (You can change 9600 to be your desired speed).

    Try connecting over serial again and this time you’ll be able to enter AT commands, replacing phone numbers with domain names.

    Polarity is the most common problem encountered when working with RS232. Remember that TX (transmit) goes to RX (receive) and vice versa

    Do more!

    Your original ‘comms’ software should be blissfully unaware that it is talking over the internet. There’s now another web of vintage BBSes to explore on your original machine, but why stop there? The Raspbian repositories are full of command-line software that can be accessed by your classic machine. Tweeting from an old 8-bit is always fun, so why not install ‘t’, a command-line Twitter client (github.com/sferik/t)?

    Of course, you can now do anything in the Raspbian shell that you can in an SSH session, so get your BBC Model B to operate LEDs and switches, or have your Commodore Amiga send Telegram messages!

  • Add internet access to a vintage computer using Raspberry Pi

    Add internet access to a vintage computer using Raspberry Pi

    Reading Time: 7 minutes

    The bulletin boards of the 1980s haven’t died out quite yet, but they have gone online. There’s only a handful of BBSes (bulletin board systems) that you can dial up with your old-time modem.

    If you like the idea of accessing an internet-based BBS from your Atari ST, Amiga, or BBC Micro, then we can use a Raspberry Pi computer to act as a translator. You can even use modern services like Twitter! All we need to do is get Raspberry Pi talking in one of the most popular communications protocols of all time: RS232.

    By interfacing the Raspberry Pi computer UART interface to RS232 and then using WiFi, we bridge the gap between old and new technology

    A little history

    Every Raspberry Pi computer has a form of serial access, which is one of the oldest and simplest ways of communicating with computers. These days you’re more likely to use TCP/IP, the protocol of the internet, to chat to a remote device, but back in the day it was RS232 that ruled the communications world.

    Raspberry Pi circuitry features a further simplified version often referred to UART (universal asynchronous receiver/transmitter) running at 3.3 V, but we can adapt it to ‘full’ RS232 at 12 V so that older computers can handle the signal.

    Cheat #1: If you don’t fancy soldering, you can buy these pre-assembled units (for a few pounds) that can connect to the GPIO

    You’ll need

    Top tip 1: Not just vintage

    This project works well with older PCs. Although they refer to them as COM ports, their 9-pin connectors are really RS232.

    Top tip 2: Be careful of weird wiring

    Do your research on your choice of classic machine. Some, such as the Cambridge Z88, use non-standard wiring to their connectors.

    Study and shop

    To ‘downgrade’ a Raspberry Pi to RS232, we’ll need to build a small circuit to act as a transceiver so the vintage computer can ‘hear’ our virtual modem and the RS232 signals do not fry our delicate Raspberry Pi board. Luckily, all the heavy lifting for such a job can be done by the MAX3232CPC integrated circuit. All you need to do is wire it up, add a few capacitors, and you’ll be BBSing in no time.

    Have a look at the circuit diagram in Figure 1. We’ve deliberately made it larger than it needs to be for simplicity. More experienced makers will be able to reduce it in size if they wish.

    Figure 1: the connector from the solder (rear) side. Use DuPont-style jumper cables to connect the circuit to your GPIO. Make sure you wire up correctly to pins 2 and 3 and ground it

    Soldering the main circuit

    Time to get building. Thankfully, the circuit itself is not very complicated, but it’s also unforgiving, so make sure all the wiring is in the correct place or nothing will work! We recommend starting with the IC socket, then the wiring, followed by the capacitors, finishing with the headers (optional if you’d like to use jumper cables). The result takes the two transmit (TX) and receive (RX) lines from the GPIO and feeds them into the IC. The MAX3232CPC converts the data into RS232 standard and outputs them to the 9-pin D connector and vice versa. Check and double-check everything.

    Add connectors

    Unless you’re going for a permanent setup or looking to make it as low-profile as possible, we recommend using DuPont-style jumper cables to connect the circuit to your GPIO. Which model of Raspberry Pi you use is up to you, but unless you have a specific use case in mind, a Raspberry Pi Zero W is the perfect choice as it’s small and there’s little horsepower required. You will also need to solder up the 9-pin D connector. The diagram (Figure 1) shows the connector from the solder (rear) side. Make sure you wire up correctly to pins 2 and 3 and ground it too.

    Raspberry Pi time

    Your Raspberry Pi Zero W will need a bit of configuration before you can get going. Start with a fresh microSD card with Raspbian Lite (we don’t need a desktop, but feel free to install ‘full’ Raspbian if you wish). This is also a great project for reusing any old low-capacity microSD cards you have, as there’s not much software to install. Once booted up, make sure everything is up to date by running sudo apt -y update && sudo apt -y upgrade. Time to grab a refreshing beverage as Raspbian applies all the latest updates.

    Prepare your virtual modem

    An ‘out of the box’ Raspbian installation isn’t quite ready to go back to the 1980s just yet, so we need to do a little further configuration. From the command line, run sudo raspi-config to start the Raspberry Pi configuration utility. From the top of the menu, start by changing your password (optional, but recommended); then, under Network Options, set your host name (again, optional) and configure WiFi. Finally, under Interfacing Options, enable SSH and Serial. When asked ‘Would you like a login shell’, select ‘Yes’. Now exit the utility and shut down the computer (sudo shutdown).

    Cheat #2: The simplest solution of all is the widely available USB-to-RS232 cables based on the Prolific PL2303 chipset

    Testing time

    Check your circuit board for any short circuits or dry solder joints. Once happy, connect it to the GPIO. There are four connection points: one for 3.3 V (physical pin 1), ground (pin 9), and TX/RX (pins 8 and 10 respectively). We recommend getting an RS232/USB cable and testing with a modern computer first. Connect the 9-pin connectors together and boot your Raspberry Pi. Now, using your favourite Terminal emulator program (we like Serial for macOS), try to connect over RS232. Raspbian’s default settings are 115,200bps (connection speed), eight data bits, no parity, one stop bit (aka 8N1).

    Troubleshooting

    Having problems? RS232 can be a tricky beast as, unless everything is perfect, nothing will work at all. The most common issue will be polarity of the TX and RX lines. For things to work, the RX of the GPIO must be connected via the MAX3232CPC to the TX line of the computer and vice versa.

    Start by checking that your speed is correct and the protocol is set for 8N1. Also try ‘reset’ or ‘send break’ in your terminal emulator, which is sometimes needed to wake up the connection. Finally, try using a null modem cable (which crosses over the lines) or swapping the connectors to pins 8 and 10.

    Get online

    If everything is working, you should now be greeted with the Raspbian terminal login (you might need to press ENTER a couple of times to wake it up). You can now log in as normal. If the connection is behaving, feel free to try it out on a real vintage machine. Some may require adapters to connect (1990s home computers favoured 25-pin D connectors).

    You will probably need to reduce the speed of the connection, as many older computers cannot handle the default 115,200bps. Unless your computer is very old, 9,600bps will probably work. To set the port to this, enter the following from an SSH session:

    sudo stty -F /dev/serial0 9600

    Connect to a BBS

    Almost every BBS is now online and ‚talks‘ using a protocol called Telnet. It is very insecure, sending plain text over the internet and has since been replaced with SSH (Secure Shell). However, many of these services are being run on original equipment that has no support for SSH, so Telnet it is.

    Many classic BBSes are still online, some even supporting PSTN modems. These days, most can be found at the end of an IP address

    The Telnet client software is not installed by default, so run sudo apt install telnet. Once finished, try connecting to the popular Particles BBS (running on an Apple II/e!), by entering:

    telnet particlesbbs.dyndns.org 6400

    Within a few seconds you’ll see a welcome message. After you’ve had a look around, use CTRL+] followed by ‘exit’ to leave Telnet.

    Emulate a classic modem

    If you want a genuine experience, and full compatibility with vintage BBS software, it’s easy to emulate the classic Hayes AT command-set. To install the emulator:

    sudo apt install tcpser

    Before running tcpser, go back into raspi-config, select ‘Interfacing Options’, then ‘Serial’, and answer ‘No’ when asked if you want a login shell to be accessible and then ‘Yes’ if you want the serial port to be enabled. Now start tcpser using SSH:

    tcpser /dev/serial0 -s 9600 -l 7

    (You can change 9600 to be your desired speed).

    Try connecting over serial again and this time you’ll be able to enter AT commands, replacing phone numbers with domain names.

    Polarity is the most common problem encountered when working with RS232. Remember that TX (transmit) goes to RX (receive) and vice versa

    Do more!

    Your original ‘comms’ software should be blissfully unaware that it is talking over the internet. There’s now another web of vintage BBSes to explore on your original machine, but why stop there? The Raspbian repositories are full of command-line software that can be accessed by your classic machine. Tweeting from an old 8-bit is always fun, so why not install ‘t’, a command-line Twitter client (github.com/sferik/t)?

    Of course, you can now do anything in the Raspbian shell that you can in an SSH session, so get your BBC Model B to operate LEDs and switches, or have your Commodore Amiga send Telegram messages!

  • Andrew Suttle interview

    Andrew Suttle interview

    Reading Time: 3 minutes

    “My first Raspberry Jam was CamJam in autumn 2013, when I showed some programs I had written,” Andrew tells us. “I also enjoy developing robots and doing electronics. I first went to the Colchester club run by John Woods in 2016, when I built a robot car using a Raspberry Pi. The Colchester club is run at the university and I like going there very much. The lab we use has all new oscilloscopes and I used them recently with some op-amp circuits. I also built my own oscilloscope from a kit and John Woods helped me get it working, as I had not soldered one of the connections properly. I took my oscilloscope into school and used it there.”

    Andrew isn’t the only young person at the club, either: “Several other children from my school have also gone to the club and I have built projects with them. We made an ‘I ♥ Pi’ team and entered competitions. We also had a ‘Pi Rates’ team. My brother also goes to the club. He is building a security project with Arduino, and I might use some of his ideas in a programming course I am making.”

    While some go there to build physical projects, others learn to code

    What kind of people attend?

    At the moment, it is all children aged 8 to 14 who come along with their parents, but we don’t have set age limits. The youngest children usually want to learn Python; the older children usually have a project of their own that they want to work on. People often drop in for a few sessions and solve a particular problem and then stop attending. We have had some stay for years and they are all from different local schools.

    One boy, Taylor, came regularly until he was 18. He developed several AI projects. He got a scholarship to Cambridge University, and graduates this year.

    Other members have entered competitions and we have had members win in the ‘BigBang’, ‘Pioneers’, and ‘EasternDigital’ competitions. EasternDigital is an ‘adult’ competition for companies and one of the winners three years ago was ten years old; he was too young for their children’s competition!

    What projects have you or other people made there?

    As well as the AI projects I have mentioned, we have had members developing robotic arms. Then there was a flight control system for model aircraft and several robot cars.

    Several children have gravitated towards embedded systems. Two children, Zara and Andrew, developed a plant monitoring system.

    What are you working on at the moment?

    Some of the younger children who are new to the club are doing directed tasks. Samuel, aged eight, and Xingtong, aged eleven, are both working on TicTacToe. But we do very little teaching.

    Some children are doing their own Python projects, with Python always a popular language. Robyn, aged twelve, has made a Mastermind-style game linked with Hangman. Andrew, now aged 14, has developed a version of Conway’s game of life.

    There are also several Arduino projects on the go. Victor, aged eleven, has just finished his security control system which is based on an Arduino Uno and written in C.

    There are always robots. We have a robot arena that is purpose-built for the development of robots, and we have a lot of knowledge and resources to support a robot project. The arena is 100 square metres in area, and has a six-metre-high ceiling to accommodate flying robots.

  • Cheeseborg project showcase

    Cheeseborg project showcase

    Reading Time: 4 minutes

    Making a splash with your final-year university project can be the ideal way to gain the attention of potential employers and land yourself your dream job. Appealing to your lecturers’ and classmates’ stomachs is also a pretty effective way of getting them onside.

    Hearing from Taylor Tabb about the robot project he and friends Mitchell Riek and Evan Hill cooked up for their mechanical engineering degree, it’s little surprise to learn that having graduated in the summer of 2019, he’s already embarked on a fantastic-sounding Raspberry Pi-focused career.

    Taylor Tabb and his Cheeseborg-designing colleagues at Carnegie Mellon knew appealing to fellow students' rumbling tums would win them over

    Taylor studied mechanical engineering at Carnegie Mellon University, exploring how people interact with hardware, and thinks Raspberry Pi is the ideal platform for this. He now works for creative agency DeepLocal, making ‘wild and whimsical’ robots.

    Say cheese!

    “Cheeseborg was born out of our need to concept, design, and build a final prototype of a project in our senior engineering design class,” says Taylor. “As hungry college students awake at hours that it’s often hard to find food, we knew this was our calling – not just for us, but for grilled cheese eaters everywhere.”

    The Raspberry Pi-powered AIY voice kit recognises a request for a grilled cheese sandwich and picks up bread to butter and toast thanks to Arduino Mega

    Cheeseborg is a dedicated, hands-free grilled cheese making robot that will satisfy cheese cravings at all hours. The Google Assistant SDK and AIY Voice Kit provide voice activation. Both “work fantastically with Raspberry Pi 3 Model B+,” says Taylor. Their customised build of Google Assistant, sourced from the AIY Kit and Google Cloud SDK, allowed them to add some personality: you can ask about the weather while awaiting your sandwich.

    Raspberry Pi also triggers its assembly, while motor control circuits and motion are operated by Arduino Mega. Taylor reveals, “We wrote our own code, but also used open-source Arduino libraries,” dictating timings and the motions for each step. Carnegie Mellon’s Department of Mechanical Engineering’s makerspace provided hardware commonly used in 3D printer kits, such as stepper motors and linear motion carriages. However, the acrylic parts were designed and laser-cut by Mitchell, Evan, and Taylor. Impressively, the project cost just $200 to build, and took approximately eight weeks to complete.

    Cheeseborg begins to take shape in the Carnegie Mellon University makerspace

    Taste test

    The team undertook three weeks of customer research to identify grilled cheese preferences. “There was a lot of going back and forth between our build, CAD software, and laser cutter, adjusting parts as we learned more about the mechanics of bread and cheese,” recalls Taylor. They spent days just tuning the grilling time to get the gooeyness and crispiness just right, while experiments in applying the butter resulted in a thoroughly dairy-spattered makerspace.

    Eventually, they went with a spray ‘butter’. “We aimed at the cooking plates and activated just before the bread was moved to be cooked, thus buttering both sides [not to say the rest of Cheeseborg]. In the end, we found if we just spray the grill plates every five [sandwiches] or so, it still is enough to make a crispy, gooey grilled cheese!

    As with all good projects, we had no idea if it was going to work until 4am the morning before it was due, when Cheeseborg popped out its first fully hands-free grilled cheese sandwich.”

    Cheeseborg creators Taylor, Mitchell and Evan at 5am when their invention was finally finished

    Making your own grilled cheese robot

    1. This is the ideal project with which to use Google Assistant in Google’s Raspberry Pi AIY Voice Kit, and the Google Cloud SDK for voice activation. Experiment with phrases to initiate the snack-assembly process.

    Cheeseborg is an ideal project for Google Assistant in the Raspberry Pi-enabled AY Voice Kit

    2. Raspberry Pi now hands over to Arduino. Use Arduino Mega to control the robot that assembles the grilled cheese sandwich once Raspberry Pi instructs it. Open-source Arduino libraries are invaluable here.

    Raspberry Pi hands over to Arduino Mega to control the robot that assembles your tasty snack

    3. Use tongs or suction to pick up slices of bread and add a chute for the snack’s delivery. However, positioning bread to be buttered and adding cheese takes patience.

    Add a chute to deliver the grilled cheese sandwich into the hands of your grateful friends and family

    Interest levels online have been such that Taylor and his colleagues may consider offering a kit version. While he cautions that there’s a huge amount of fine-tuning involved, he says, “If anyone out there is building a grilled cheese robot, we’re more than happy to offer any insights.” Contact him at tabb.me/grilledcheese.

    Warning! Hot mess!

    Gooey butter is messy stuff. Be prepared for your kitchen, as well as your grilled cheese sandwich, to be buttered all over!

    Quick facts

    • Taylor’s first Raspberry Pi project was a ‘not great’ radio telescope

    • Taylor now works with Raspberry Pi almost daily

    • His business card says he’s ’sweeter than Raspberry Pi!’

    • Taylor thinks there’s a whole world of culinary robots to come

    • He recently made a not-so-edible bubble maker

      Hungry students were delighted to encounter Cheeseborg at their final year expo

  • SmartiPi Touch 2 review

    SmartiPi Touch 2 review

    Reading Time: 2 minutes

    The SmartiPi case is designed to work with the 7-inch official Raspberry Pi touchscreen, effectively turning a Raspberry Pi into a (bulky) tablet or fixed monitor. As there’s no real room for rechargeable batteries as standard, it works better in a more fixed environment.

    One of the unique features of the SmartiPi is the interchangeable faceplates on the front of the case. As well as allowing for a Raspberry Pi Camera Module to be mounted inside the case, it enables you to add a Lego-compatible plate. It’s not large, so you can’t do much with it, but it’s a very neat addition nonetheless.

    The SmartiPi Raspberry Pi case looks sleek and compact from the front

    Smart build

    Construction is extremely easy, just requiring you poke some ribbon cables in the right place and fasten and tighten some screws to make sure everything is mounted properly. You can choose little feet for the display, or a foldable stand so you can angle the screen – both are easy to install and even replace. There’s also a little case fan and vented rear panel to keep your Raspberry Pi cool.

    It’s extremely well thought out, and a very handy case if you need a compact ‘Raspberry Pi with screen’ solution that just looks nice.

    SmartiPi's additional case fan and vents can be handy for intensive loads

    Verdict

    The SmartiPi is great case if you need a stationary tablet, although making it mobile might be a little more tricky.

    8/10

  • The biggest Raspberry Pi projects of 2019

    The biggest Raspberry Pi projects of 2019

    Reading Time: 4 minutes

    Raspberry Pi NAS and Samba

    Raspberry Pi 4 introduced improved throughput on the Ethernet port, taking it up to full-fat Gigabit speeds. So it’s perhaps no surprise that building a super-fast NAS (network attached storage) drive was top of the wish-list for many a Raspberry Pi owner.

    Given the popularity of NAS, it’s little surprise to see How to set up Samba also take a top spot on our yearly tutorial list. It’s easy to use a Raspberry Pi as a Samba file server where you can store backups and share files from all the other computers on your network.

    Raspberry Pi 4 USB and Ethernet ports

    SSH and VNC

    SSH (also known as ‘Secure Shell’) is an encrypted networking technology that enables you to manage computers from the command line over a network. It’s a technology that many users are unfamiliar with, until they get a Raspberry Pi and want to get into it from another computer on their network. Our How to setup SSH tutorial gets newbies up and running.

    While SSH is from the command line, VNC enables you to access your Raspberry Pi desktop remotely. Our VNC: Remote access a Raspberry Pi tutorial was another big-hitter in 2019.

    VNC Server displays your IP address and is used to log your Raspberry Pi to VNC Connect so you can access Raspberry Pi via the wider internet

    How to build a Carputer (car computer)

    And now we’re into the biggest project of 2019. How to build a Carputer (car computer) with your Raspberry Pi and touchscreen. Raspberry Pi makes a fantastic car computer, thanks to its small footprint and fast processing power: it’s better than many computers found in commercial cars.

    Car Computer

    Build a Raspberry Pi cluster computer

    Cluster computing is one of the most modern programming techniques around. There’s strength in numbers and some of the world’s most powerful computers are built of hundreds, in not thousands, of inexpensive systems.

    PJ Evan’s Build a Raspberry Pi cluster computer tutorial shows you how to link up four Raspberry Pi boards to build a powerful cluster. This can be used to create a more powerful server (such as the one running this website) or used to learn cluster computing programming techniques.

    Cluster computing is a reasonably niche activity, but our readers are a pretty clever bunch so we’re going to hope many of them find a use for this.

    Each Raspberry Pi in the cluster is known as a node and works in parallel with the others to produce faster results than they could individually

    The Interactive tabletop RPG table

    Plunder dungeons and slay dragons in digital style with this simple TV conversion project for all your role-playing game needs. The MagPi magazine’s very own Rob Zwetsloot built this touchscreen RPG companion device, and it turns out a lot of readers want to build one too.

    dndmain-web

    Steam Link on Raspberry Pi

    Gamers rejoiced when Steam released Steam Link. This software enables you to turn a Raspberry Pi into a streaming console, enabling you to play PC games remotely. The games run on PC, and are typically streamed to a Raspberry Pi sitting underneath a television. Our Steam Link tutorial shows you how to set up Steam Link on a Raspberry Pi 4.

    Steam Link

    Code Pac-Man in Python

    It’s one of the most famous games ever made, and Pac-Man in Python is a great learning tool. It’s no surprise that many gamers want to recreate games in Python and our sister magazine, Wireframe recently released a whole book – Code the Classics – dedicated to just that.

    <img src="https://www.blogdot.tv/wp-content/uploads/2020/01/the-biggest-raspberry-pi-projects-of-2019-4.jpg" alt="

    Code your own Pac-Man game in Python

    „>

    ANPR: Car Spy Raspberry Pi

    Automatic number plate recognition is used by the police to match cars against a huge database. We don’t have that database, but OpenCV can be used to detect car number plates and detect your own car. It wasn’t long ago that ANPR technology was extremely expensive to purchase, and Raspberry Pi makes it available to everybody. And our ANPR: Car Spy Raspberry Pi project certainly seems to have sparked some interest.

    <img src="https://www.blogdot.tv/wp-content/uploads/2020/01/the-biggest-raspberry-pi-projects-of-2019-5.jpg" alt="

    Our target. The software does a great job of recognising number-plates from different heights and angles

    „>

    Build a Raspberry Pi telephone exchange

    Transform your humble home phone line into a feature-packed PBX (private telephone exchange) with Raspberry Pi and Asterisk. Many readers might just want to experiment with telephone exchange technology at home, but there’s a good business case for learning how to do this: professional PBX systems cost thousands of pounds.

    <img src="https://www.blogdot.tv/wp-content/uploads/2020/01/the-biggest-raspberry-pi-projects-of-2019-6.jpg" alt="

    Build a VoIP Telephone Exchange with Raspberry Pi

    „>

    The ZX Spectrum Next

    ZX Spectrum Next has been in development for quite some time, but has only been on our website for a few weeks. In that time it’s become one of the biggest stories of the year. David Crookes investigated the development of the ZX Spectrum Next computer with a FPGA (field programmable gate array) using Raspberry Pi Zero as an extender to act as a virtual tape drive, sound interface and 3D graphics enhancer.

    The ZX Spectrum Next contains a Z80 processor on an FPGA, 1MB of RAM expandable to 2MB,
hardware sprites, 256 colours, RGB/VGA/HDMI video output, and three AY-3-8912 audio chips

  • Enviro pHAT Raspberry Pi review

    Enviro pHAT Raspberry Pi review

    Reading Time: 2 minutes

    See also: Enviro + review

    The Enviro (£28/$30. Pimoroni)also features the same slimline pHAT form factor to match the size of a Raspberry Pi Zero, although it can be used with any Raspberry Pi model.

    Sensing the world

    The Enviro’s BME280 weather sensor monitors temperature, barometric pressure, and humidity. As on the Enviro +, this has been positioned at the left edge of the board, away from Raspberry Pi’s CPU, and there’s even a little smile-shaped slot around it to help reduce heat radiated through the board. Even so, you’ll need to adjust its temperature reading for accuracy (by measuring that of the CPU itself and deducting a factor of it).

    A smartphone-style LTR-559 light and proximity sensor detects the ambient light level and also proves handy as a substitute for a push-button when you put your finger on it. The board’s tiny MEMs microphone measures sound levels, useful for monitoring noise pollution, and can also be used to record audio.

    At the time of writing, most of the code examples provided with the Python library are aimed at the Enviro + Air Quality board. However, it’s easy to edit the code for missing sensors from the all-in-one example to get it showing rolling graphs for temperature, pressure, humidity, and light level on the LCD. There are also a couple of examples that make use of the mic to plot noise levels and frequencies.

    If you don’t need to test air quality and just want a simple environmental sensor with a built-in display, the Enviro is ideal. The light sensor could also come in handy for use in IoT setups, such as to trigger your lights to come on when the light level falls below a certain level.

    If you also require motion/direction sensing, the original Enviro pHAT is still available (albeit without the mini LCD).

    The reverse of the Enviro for Raspberry Pi

    Specs

    • Built-in sensors: BME280 temperature/pressure/humidity, LTR559 light/proximity, SPH0645LM4H-B noise

    • Display: 0.96-inch colour LCD (160×80)

    • Dimensions: 65×30×8.5 mm

    Verdict

    Lacks the gas sensor of the Enviro + Air Quality board, but features the same mini LCD screen to display your environmental data without a monitor.

    8/10

  • Organnery pipe organ

    Organnery pipe organ

    Reading Time: 3 minutes

    Raphaël tell us that he increasingly found components for first-generation digital pipe organs – many of which are installed in churches across the world – to be either obsolete, expensive, or simply unobtainable, threatening to consign many an instrument to the scrap-heap.

    The solution has been Organnery, a project to to strip the organs of their old electronics and replace them with something new. “After some thoughts and calculations, we came up with a method that would retain the console, keyboard, and controls and instead make use of a small, affordable, and efficient single-board computer,” he says.

    The chosen device was a Raspberry Pi, selected because of its worldwide availability, strong development community, and affordable price. It offered a perfect way of bringing pipe organs back to life so that they can be played as before, while allowing modern options such as a touchscreen.

    “There are lots of good HATs available covering sound output, MIDI, and control interfaces,” says Daniel James, boss of 64 Studio, the company tasked with creating the software.

    Digital organs have been used in place of pipe organs within churches for a while, but damp and the scarcity of spare parts mean they’re not lasting as long

    Fine tuning the Organnery

    As such, Daniel and colleague Chris Obbard began to work on a customised Debian GNU/Linux image called Organnery (GitHub link) that made use of the open-source classical organ modelling software Aeolus and Raspberry Pi’s capabilities. With eleven different temperaments, variable tuning, three or more manuals, and a pedal board, as well as MIDI in/out control and the flexibility to play different sounds, a personalised experience is possible.

    “Organnery needed to be set up as a single-use appliance, and the requirements came directly from the organists we’ve been working with to refine the system,” Daniel says. “We made adjustments to the Aeolus source code as well as to supporting programs. These included Mididings, a scriptable MIDI router and processor written in Python.”

    Daniel also created minimal system images based on Debian Buster using Dibby, which is a collection of scripts that leverage the distro’s packaging tools. “This approach was a far leaner and more reproducible way to build appliances than starting from a standard image and stripping the system down,” Daniel says.

    The Aeolus software allows a collection of stops to be saved to a USB memory stick for each organist

    Retro hits

    So what’s the verdict? “Organnery offers a major sound upgrade since the sound produced by the Aeolus software is of a much better quality than digital electronics from the 1980s,” Raphaël says. “It gives the organ player access to new ‘pipes’ and complete control over sound placement in space, from a standard stereo system up to 3D Ambisonic diffusion.”

    Most Organnery systems are being retro-fitted into existing organs, but the system can be built from scratch using standard and affordable MIDI hardware. “Some of the smaller organs made for the domestic market have a five-pin MIDI Out socket and can be obtained for next to nothing,” Daniel explains. “Aeolus and Organnery can also make learning the classical organ much more accessible than it has been in the past.”

    Even so, bringing organs back to life, complete with the original woodwork and physical controls, is perhaps most satisfying. “Church organ consoles are also often made of expensive hardwoods so we are saving trees,” Daniel says. For organists used to the age-old interface of their instruments, that’s sure to be extra music to their ears.

    The MIDI switches of an organ are being retro-fitted with new electronics, powered by Raspberry Pi

  • ZX Spectrum Next Raspberry Pi project showcase

    ZX Spectrum Next Raspberry Pi project showcase

    Reading Time: 4 minutes

    “For me, the goal has been to encourage a new generation of bedroom coders,” says legendary games developer Jim Bagley, who is among a group of Spectrum fans behind the project. Jim has been programming games professionally for the past 31 years and is a key member of the specnext.com team dedicated to bringing back the ZX Spectrum.

    Jim Bagley is a legendary games developer and ones of the leading lights behind bringing back the ZX Spectrum

    With 3113 Kickstarter backers handing over £723,390 in cash, many others potentially share that dream.

    Work has certainly progressed well. “When the Next was first announced three years ago, it was intended to be a normal Spectrum with an SD card and a Raspberry Pi Zero as an extender,” Jim explains. “Raspberry Pi was going to be used to add extra features such as hardware sprites and hardware scrolling so that newcomers would find it easier to code the computer and get the wow factor of getting something running instantly on the screen.”

    During the Kickstarter campaign, however, a large field-programmable gate array (FPGA) was announced for the Next – a configurable integrated circuit which allowed the hardware sprites, scrolling, and other advanced features to be incorporated within the machine itself. “It freed up Raspberry Pi Zero to do something else,” Jim says. So the developers began to play around.

    It will work with CRT and VGA monitors, as well as more modern screens, thanks to the support of a HDMI output

    Load and run

    One of the initial ideas was to recreate the feel of loading a game from tape – generating the series of scratchy, beepy, high-pitched noises which could be heard as a program was ingested into the computer. On the original hardware, this was accompanied by a loading image slowly building on the screen and animated stripy borders.

    Rather than have Next users connect a cassette deck, the developers had a cunning plan. “We thought it would be a good idea to have commands sent back and forth between the Next and Raspberry Pi Zero,” Jim says. This developed into a tool allowing a TZX file (a format that stores an exact copy of a ZX Spectrum tape) to be uploaded from an SD card to Raspberry Pi Zero. By sending it back down to the new-gen Speccy through an audio-in pin, the Next would be fooled into thinking it’s loading a cassette. “It gives the original feeling of loading from tape,” Jim affirms.

    The ZX Spectrum Next contains a Z80 processor on an FPGA, 1MB of RAM expandable to 2MB,
hardware sprites, 256 colours, RGB/VGA/HDMI video output, and three AY-3-8912 audio chips

    Are you there, SID?

    Having a Raspberry Pi Zero accompanying the Next has also enabled other audio delights. A Sound Interface Device (SID) emulator has been developed that allows audio created for Commodore’s SID programmable sound generator chip to be played on the Next.

    It will also be possible to enjoy Atari ST audio files and tunes created using music trackers on the Commodore Amiga. “We can send the audio through a GPIO pin and it goes straight to the FPGA, where it’s mixed with the audio of the Next,” Jim explains. To achieve all of this, the developers have used DietPi to create a new OS called NextPi. “It remains a fully functioning Raspberry Pi Zero that is running at the same time as the Next, but we wanted the Next to be more in control.”

    Games made specially for the Next are saved as .NEX files which load directly to the computer via a
SD card. Since the games are 768kB in size (or 1792kB for the 2MB models), it would take too long to route them via Raspberry Pi Zero

    The most recent extra use for the Next’s Raspberry Pi Zero is the ability to connect the latter to its own display. “It’s possible to send screens to Raspberry Pi Zero so that you can have a dual screen,” Jim says. “This means you could have a game being played on the Next, with a global map or stats shown via Raspberry Pi Zero.”

    The team is now looking to get USB controllers to work via Raspberry Pi Zero, allowing them to be read by the Next. “We’d also like Raspberry Pi Zero to help with 3D maths so you can take vertices, have them rotated, and passed back,” Jim says. In the meantime, the team is readying the new computer for a January release and a new Kickstarter is being planned for those who didn’t pledge the first time around. We’re certainly looking forward to seeing where it – and RaspberryPi – goes next.

    Rather than simply emulate the Spectrum, the Next uses a field-programmable gate array chip that acts as a Z80 processor with the addition of advanced features

    Raspberry Pi loading

    1. Games in the file format TZX – a tape format used for preservation purposes – need to be saved on to an SD card and inserted into the ZX Spectrum Next. 

    Games are installed on the ZX Spectrum Next from an SD Card

    2. A game can then be selected via the Next computer’s built-in Browser mode. Raspberry Pi Zero will be instructed to load the game’s data from the SD card.

    Select a game in the ZX Spectrum Next’s Browser mode and Raspberry Pi Zero instructs it to load from the SD card.

    3. Raspberry Pi Zero sends the data back to the ZX Spectrum Next as audio and this generates the once-familiar loading noise and loading screen ahead of the game running.

    Raspberry Pi sends data to the ZX Spectrum as audio, resulting in the familiar electronic loading sounds of 80s computer games

    Looking for some more retro gaming joy? You could always: code your own retro games console, build your own retro game with PICO-8, indulge in an entire issue of The MagPi dedicated to retro gaming or this incredible hardback ‚Code The Classics‘ guide, brand-new from Raspberry Pi Press for a more £12?

  • 50 Raspberry Pi tips and tools in The MagPi magazine issue 89

    50 Raspberry Pi tips and tools in The MagPi magazine issue 89

    Reading Time: 2 minutes

    A lot of projects need specific tools, and there’s a lot out there to choose from. Raspberry Pi maker Mark Vanstone takes a look at the 50 best physical and digital tools you can use to build projects.

    Click here to buy The MagPi magazine issue #89

    50 Raspberry Pi 4 tips & tools

    Raspberry Pi kit & gadget guide

    Quickly do more with your Raspberry Pi with kits and accessories. Our guide to the best add-ons, HATs, starter kits, robot builds and accessories has everything you need.

    Raspberry Pi kit & gadget guide

    Add internet to a classic computer

    Missing the days of dial-up? Build an interface to the modern world for an old computer (an Atari ST, in our case) using a RS232 receiver.

    Add internet to a classic computer

    Design a 3D printer pendant with BlocksCAD

    BlocksCAD is a 3D model editor that runs just fine on the faster Raspberry Pi 4. In this tutorial we look at how to use this Scratch-like language to design a pendant for a 3D printer.

    Design a 3D printer pendant

    Aquatic Mini Observation System

    We’ve got the best community projects every month. Murray Lowery-Simpson used Raspberry Pi at the heart of this solar-powered, autonomous boat that measures water quality.

    Aquatic Mini Observation System

    Cheeseborg

    What could be more entertaining than this AI-powered grilled-cheese sandwich machine? We take an in-depth look at this capable cheese-making robot.

    Cheeseborg

    Plus! Win one of five Raspberry Pi and black Official Case kits.

    The MagPi is available as a free digital download, or you can purchase a print edition online or in stores.