Blast off with The MagPi 47 Astro Pi special!

Blast off with The MagPi 47 Astro Pi special!

We’ve been following Tim Peake’s adventures in space closely in The MagPi for the last six months, especially all the excellent work he’s been doing with the Astro Pis running code from school students across the UK. Tim returned to Earth a couple of weeks ago so we thought we’d celebrate in The MagPi 47 with a massive feature about his time in space, along with the results and future of Astro Pi… The space celebration doesn’t stop there, print copies of The MagPi 47 come with an exclusive Astro Pi mission patch and an exclusive Tim Peake Astro Pi poster! The results of what Tim, Ed, and Izzy have been up to for the past six months The issue also has our usual range of excellent tutorials, from programming dinosaurs to creating motion-sensor games and optical illusions. We also have the hottest news on high-altitude balloons and how you can get involved sending a Pi to the edge of space, as well as the details on the next Pi Wars Pi-powered robot competition. You can get your latest space-worthy issue instore from WH Smith, Tesco, Sainsburys, and Asda. It’s also available in print on our online store. If you prefer digital, it’s ready to download on the Android and iOS app. Want to make sure you never miss an issue? Subscribe today and start with issue 47 to not only get the poster and mission patch but also a Pi Zero bundle featuring the new, camera-enabled Pi Zero and a cable bundle that includes the camera adapter. This is not the end of Astro Pi, only the beginning. The post Blast off with The MagPi 47 Astro Pi special! appeared first on The MagPi Magazine.
Source: Blast off with The MagPi 47 Astro Pi special!

Submersible drone, powered by Pi

Submersible drone, powered by Pi

A keen scuba diver and RC model maker, Niels Affourtit had always been fascinated by the possibility of building a remote-control submarine, but was deterred due to the expense and the potential for leakages. When he saw footage of a VideoRay underwater ROV (remotely operated vehicle) in 2014, however, his enthusiasm was rekindled and he set out to see if it was feasible to build a video ROV of his own. “When I started Googling, it was the first time I read about the Raspberry Pi,” Niels tells us.“When I found out that the Pi can control servos and ESCs (electronic speed controllers) directly via PWM, has the option for a camera, and has a low power consumption, I realised it was a perfect platform for my ROV.” Naturally, a waterproof hull would also be required. Niels constructed his in just 15 hours using PVCu, similar to drainpipe material. Indeed, the closure is a standard connection for pressure piping, while Niels cut out its transparent screen with a router. The use of brushless motors also helped greatly: “Since the motors are running in water, there are no moving parts through the hull and leakage is almost impossible.” The only parts that pass through the hull are wires for the motors, lights, echosounder, depth and temperature sensors, and communication with a laptop. Since high-frequency wireless signals can’t penetrate water, while low-frequency ones are too slow to send live video, the ROV is tethered to its laptop controller via a long cable. “From OpenROV, I learned to modify a specific Ethernet-over-power adaptor, which reduces the standard four-wire patch cable to only two and makes the wire very insensitive to interference and bad connections. The cable is now 100 metres long, but the maximum reach of the adaptors is in the order of 300m.” Live video and sensor data are viewed on a tethered laptop 3D-printed parts For the propellers and Pi camera tilt system, Niels drafted designs in AutoCAD and 3D-printed them with an Inno3D printer borrowed from a neighbour. “I have experience in 3D drawing via my work [as an engineer for offshore pipelines], so that is an advantage.” Niels’s background in mechanical engineering also came in useful for assembling the electrical components, as did his experience with Python and Linux machines for programming the sensors. Even so, he found the process a real challenge, taking around 200 hours in total.…
Source: Submersible drone, powered by Pi

Build a Raspberry Pi access point with a display

Build a Raspberry Pi access point with a display

This article features the PaPiRus, the Pi PoE, and the Raspberry Pi 3 to build a portable access point with a screen. We will be working with the Pi PoE, but everything in this tutorial can be achieved without it, too. This tutorial assumes your version of Raspbian Jessie is up-to-date. You’ll need PaPiRus ePaper / eInk Screen HAT Pi PoE Switch HAT TP-LINK PoE Injector (optional) 40-pin header GPIO adapter for RPi-Display B+ – female PuTTY Putting everything together Building this access point is extremely easy. It requires minimal soldering and for the rest, it’s really just a question of stacking together the various components. The additional header will allow us to install the PaPiRus on top of the Pi PoE, but we did this via the GPIO adapter. In some cases, your infrastructure will already be able to deliver Power over Ethernet; if not, you’ll need to use a PoE injector like the TP-LINK TL-POE150S. Connect everything up, making sure that the flat cable for the PaPiRus is connected the right way around. Once all is connected and ready to use, a long press on the switch of the Pi PoE module will power up the system. Preparing the access point For the initial preparation, we need to enable SPI. Go to the program menu and find the Raspberry Pi Configuration menu to make sure it’s enabled in the Interfaces tab. Reboot the Raspberry Pi. We’re now ready to install and configure hostapd, which we will use to create the AP part of our system.sudo apt-get install hostapdThen we need to create the configuration file as follows. Note that the file doesn’t exist and that we’re creating a brand new one. This is the right time to download the supporting code from GitHub, which also contains the templates for the configuration files.git clone https://github.com/francesco-vannini/PaPiRus-AP.gitOpen the hostapd.conf template file in the terminal with:sudo nano PaPiRus-AP/hostapd.confReplace the values for ssid and wpa_passphrase in this conf file with details for your network, then copy the file hostapd.conf to the correct directory:sudo cp PaPiRus-AP/hostapd.conf /etc/hostapdAt this point, we need to edit the following file to make hostapd use the above configuration at startup. Open the file with sudo nano /etc/default/hostapd and change it by adding:DAEMON_CONF=”/etc/hostapd/hostapd.conf”Lastly, we start the service with sudo systemctl start hostapd. We really want this configuration not to depend on services that will automatically alter our network settings, so we’ll disable…
Source: Build a Raspberry Pi access point with a display

Build an interactive Raspberry Pi AP

Build an interactive Raspberry Pi AP

This article features the PaPiRus, the Pi PoE, and the Raspberry Pi 3 to build a portable access point with a screen. We will be working with the Pi PoE, but everything in this tutorial can be achieved without it, too. This tutorial assumes your version of Raspbian Jessie is up-to-date. You’ll need PaPiRus ePaper / eInk Screen HAT Pi PoE Switch HAT TP-LINK PoE Injector (optional) 40-pin header GPIO adapter for RPi-Display B+ – female PuTTY Putting everything together Building this access point is extremely easy. It requires minimal soldering and for the rest, it’s really just a question of stacking together the various components. The additional header will allow us to install the PaPiRus on top of the Pi PoE, but we did this via the GPIO adapter. In some cases, your infrastructure will already be able to deliver Power over Ethernet; if not, you’ll need to use a PoE injector like the TP-LINK TL-POE150S. Connect everything up, making sure that the flat cable for the PaPiRus is connected the right way around. Once all is connected and ready to use, a long press on the switch of the Pi PoE module will power up the system. Preparing the access point For the initial preparation, we need to enable SPI. Go to the program menu and find the Raspberry Pi Configuration menu to make sure it’s enabled in the Interfaces tab. Reboot the Raspberry Pi. We’re now ready to install and configure hostapd, which we will use to create the AP part of our system.sudo apt-get install hostapdThen we need to create the configuration file as follows. Note that the file doesn’t exist and that we’re creating a brand new one. This is the right time to download the supporting code from GitHub, which also contains the templates for the configuration files.git clone https://github.com/francesco-vannini/PaPiRus-AP.gitOpen the hostapd.conf template file in the terminal with:sudo nano PaPiRus-AP/hostapd.confReplace the values for ssid and wpa_passphrase in this conf file with details for your network, then copy the file hostapd.conf to the correct directory:sudo cp PaPiRus-AP/hostapd.conf /etc/hostapdAt this point, we need to edit the following file to make hostapd use the above configuration at startup. Open the file with sudo nano /etc/default/hostapd and change it by adding:DAEMON_CONF=”/etc/hostapd/hostapd.conf”Lastly, we start the service with sudo systemctl start hostapd. We really want this configuration not to depend on services that will automatically alter our network settings, so we’ll disable…
Source: Build an interactive Raspberry Pi AP

Learn to code in our Scratch Essentials book

Learn to code in our Scratch Essentials book

One of the core parts of any programming language is the logic and flow of the code. If statements, loops, functions, etc. It’s one thing to learn how a specific language works but understanding the core of programming can help immeasurably. Introducing our Scratch Essentials book, Learn to code in Scratch. Scratch is a great way to build up this core programming knowledge thanks to the way it uses building-blocks of code to do this, and it’s all very visual so you can see how you’re building it. Get started with Scratch and learn the basics of coding today Learn to code with Scratch is available now and takes you from the very beginnings of learning the blocks to creating animations and games to play as well. There’s even a bit on how to control electronic circuits with it like you can in Python! The Scratch Essentials book is available right now on our app, which is available on Android and iOS. You can also download the free PDF for it as well! Stay tuned for news on a print version in the future. The post Learn to code in our Scratch Essentials book appeared first on The MagPi Magazine.
Source: Learn to code in our Scratch Essentials book

Mars Rover

Mars Rover

NASA’s Curiosity is one of the most famous robots on… well it’s technically on Mars, but it’s more famous here on Earth. We think this Curiosity-based build is out of this world. The full article can be found in The MagPi 45 and was written by Lucy Hattersley Marcio Rovai used Curiosity as inspiration for his final project for Coursera’s ‘Create Your Own Internet of Things (IoT) Device’. His Mars Rover – or ‘Mobile Station for Environmental Data Capture’, to use its official name – uses a Raspberry Pi to form the brains of an environmental data capture robot. “It’s a mobile station prototype responsible for environmental data capture, [such] as temperature, humidity, and luminosity,” says Marcio. “The idea is to help students and hobbyists learn how a robot could be remotely controlled, and information captured and displayed over the internet.” “The Rover was based on the Curiosity,” he tells us. “Both were developed for image and environment data collection.” There are, of course, some physical differences (beyond one being slung to another planet). “The real Curiosity has six wheels that makes [it] all-terrain; my Mars Rover is a simple differential wheeled robot with two motors.” Curiosity also has an articulated arm and drill for sample collection, which is missing on the Raspberry Pi Mars Rover. “But the basics are there,” says Marcio. The robot is quite complex Mars Rover uses both a Raspberry Pi and Arduino. “The Pi is responsible for more complex tasks, such as web communication, sensor data capture, and live video streaming – leaving the core stuff like mobility, obstacle avoidance, and remote control with the Arduino.” “Controlling servo motors using PWM outputs directly from RPi GPIO isn’t easy,” he explains, “and it’s best to have a HAT for that. So I decided to leave this job for my little friend, the Arduino Nano.” The Nano’s main tasks are to receive commands, control the servo motors, and monitor the ultrasound sensor for obstacle avoidance. “Curiosity has a more advanced REMS (Rover Environmental Monitoring Station) system that incorporates the following sensors: atmospheric pressure, relative humidity, temperature (ground and air), ultraviolet radiation, and wind currents. So I included sensors for temperature, humidity, and luminosity (as a simulation of ultraviolet). My Rover doesn’t capture wind and pressure data [like] the real Curiosity.” The Raspberry Pi Mars Rover is controlled from an Android phone, which also provides a video stream.…
Source: Mars Rover

Make NeoPixel cosplay eyes with Pi

Make NeoPixel cosplay eyes with Pi

NeoPixels are amazing, addressable RGB LEDs from Adafruit. You can get them in strips, rings or individually, and create incredible effects with them. However, it’s not always clear how to control them on the Raspberry Pi. Recently, friend of the mag Mel Nurdin (of Riddlerule Cosplay) expressed an interest in using NeoPixels in a cosplay of theirs. We decided to cut through the information and create a Pi-powered pair of eyes for their costume: skeleton pun-maker and hotdog salesman Sans from last year’s excellent Undertale game. Follow along to make your own Megalovania eyes, or learn how to use NeoPixels in general for your own projects. The full article can be found in The MagPi 45 You’ll need First-generation Raspberry Pi (A+, B+, Zero, etc.) NeoPixel ring 4× AA battery pack, preferably with a switch 4× rechargeable AA batteries Portable mobile phone power bank Push button Various wires and resistors STEP-01 Prepare your Pi A Raspberry Pi Zero was used in the final build, so it would fit better within the confines of the costume. Update a version of Raspbian Jessie by going into the terminal and using sudo apt-get update then sudo apt-get upgrade, before installing the software needed for the NeoPixels:sudo apt-get install build-essential python-dev git scons swigNow download the library for the NeoPixels:git clone https://github.com/jgarff/rpi_ws281x.git cd rpi_ws281x sconsFinally, we can install the module to the Pi:cd python sudo python setup.py installSTEP-02 Wire up the NeoPixel It’s worth testing this out on a breadboard first, so you can understand the concept of the circuit. Basically, the NeoPixel needs to be powered separately by the four AA batteries, with a data cable coming from a PWM-enabled pin on the Pi to control the LEDs. You don’t need to step up the 3V3 signal from the Pi to do this, so to keep it simple, we’re not. The main thing to remember is that the ground of the NeoPixel needs to be connected to the negative on the battery pack and a ground on the Raspberry Pi. We’ve connected the data pin for the NeoPixel to pin 6 (GPIO 18). The three wires on the right go off to the NeoPixel ring STEP-03 Wire up the button The button is the easy one to wire up. It doesn’t matter which way around it goes, but we have it connected to pin 40 right at the end and to ground on pin…
Source: Make NeoPixel cosplay eyes with Pi

Nucleus Zero Pi Zero case

Nucleus Zero Pi Zero case

The Zebra Zero case we reviewed a couple of issues ago made quite a splash when it was first unveiled. Having wooden parts is still fairly unusual for Raspberry Pi cases, although the Zebra Zero is wooden (albeit with a plastic centre). The Nucleus Zero, though, is completely wooden, through and through. Sure, the screws are metal, but it even comes with wooden spacers. Very cool. The design is very funky, with lots of asymmetrical cuts in the material that give an effect of naturally grown wood, but also allow for some airflow to the chips on the board. Very clever. There’s easy access to the three main ports on the side; in fact, the way the wood is cut for these ports and the SD card slot, it’s pretty easy to figure out how it’s meant to be constructed. It’s only three pieces, after all. Access to the SD card is a little tricky compared to the bare board, and you’ll curse cutting your nails short if you’re in the habit of taking the card out regularly. Not everyone needs to do this often, though, and it’s still quite possible. One thing unique about the Nucleus is that the GPIO holes are completely covered up by the case. For some this won’t be a problem, and it’s nice that this is an option if you don’t plan to use them. There are plenty of other cases out there that open up the GPIO, such as the aforementioned Zebra Zero, so we’re not too bothered about it. In fact, we like it as an alternative for certain Pi Zero projects. This is a pretty sturdy and very protective case for the Zero, then. It’s nice and cheap, too, especially as it’s made of quite nice-looking wood (it’s still laser-cut, of course). Really, it’s just an eye-catching case and if a full-coverage case is what you’re looking for, then maybe it’s the one for you. Last word 4/5 A nice alternative case, whether for the wooden construction or for the full coverage of the Pi Zero. It’s well designed, while still looking great. The post Nucleus Zero Pi Zero case appeared first on The MagPi Magazine.
Source: Nucleus Zero Pi Zero case

Wimborne Model Railway

Wimborne Model Railway

In the beautiful town of Wimborne, very close to where The MagPi is made, is a superb model town that has existed for almost 70 years. It’s a lovely tourist spot and a wonderful attraction, of a type that’s fairly rare these days. As part of the model town, there’s also a great little model railway. During the off season just past, the lights that make up part of this miniature railway were upgraded using a Raspberry Pi, by a team led by Terry Coles, an engineering manager who helps out at Wimborne Model Town. “The fundamental requirement for the lighting is simple,” Terry tells us. “Simulate daylight, dim the lighting to simulate night-time, and then bring on lights in the trackside houses and streets. However, these were not the difficult goals; a bit more work was necessary because the finished system needed to be reliable, easy to use and maintain, and capable of being upgraded readily in the future.” The model railway is very detailed After a lot of discussion, the team settled on a Raspberry Pi Zero for the task: “This allowed for future upgrades and was considered more accessible to the average volunteer than, say, using an Arduino.” The system isn’t just made up of a Raspberry Pi, though: there’s much more to it. The lights being used weren’t just a few LEDs stuck to a breadboard, as Terry explains: “The WiringPi2 library was used to allow programming of a pulse width modulation (PWM) signal. This dims and brightens a 48W LED strip on GPIO pin 18 (the hardware PWM pin) to simulate the ‘Day’ lights. A MOSFET driver was used to carry the current needed. The lighting in the houses and elsewhere was switched by four other GPIO pins via a relay board.” The lights are controlled in sequence The system itself was developed on a Raspberry Pi with Raspbian, to make sure it was all working. Originally written in Python with the RPi.GPIO library, it doesn’t quite support hardware PWM so was then changed to the aforementioned WiringPi2. The final code was then moved over to a piCore image for actual deployment. Terry says that as the volunteers will just turn the Pi on/off rather than do a software shutdown – it’s a bit tricky with the way the system is built – piCore was the obvious choice, as the OS is loaded into memory…
Source: Wimborne Model Railway

Customise the command line

Customise the command line

Take a look at that blinking cursor on your terminal, and at what’s behind it: [email protected] ~ $ The $ is known as the ‘dollar prompt’, awaiting your command; before it you see the ~ (tilde), shorthand for ‘home’ – which is /home/pi in this case. Before that is [user name]@[computer name], in the form [email protected] Not only is this informative (at least if you’ve forgotten who and where you are), but it’s also something you can change and personalise. The full article can be found in Conquer the Command Line along with many other great command line tutorials You can also buy a physical copy of Conquer the Command Line from our shop! New user Let’s start with that user name: pi. If more than one person in your family uses the Pi, you may want to keep the pi user for shared projects, but set up individual login accounts for family members, including yourself. Creating a new user in Raspbian is easy: sudo adduser jo …will create a new user account named jo. You will be prompted for a password (pick a good one) and lots of irrelevant info (dating back to shared university computers of the 1970s) that you can safely ignore by just pressing ENTER at each prompt. Now we have a user account for jo, have a look at /home/jo. Does it look empty? Use ls -A. Jo has never logged into the computer, so you will see the absence of most of the contents of /home/pi for now, such as ~/.gconf , but there is a .bashrc and a couple of other config files. Not every user has a home directory and logs in: cat /etc/passwd …and you’ll see a lot of users listed that aren’t people. This is because files and programs running on a Unixtype system have to belong to a user (and a group – take a look at /etc/group), as we saw back in chapter 1 when we did ls -l. The user passwords are fortunately not listed in the /etc/passwd file in plain text, so if you want to change a password you’ll need to use the passwd command: sudo passwd jo will change the password for user jo. If you’re logged in as user pi, then simply calling passwd will prompt you to change pi’s password. Transformations in the virtual world are always easier than those in nature,…
Source: Customise the command line