AlexaPhone

AlexaPhone

Martin Manders has a passion for upcycling vintage technology. He’s well-known for using the Raspberry Pi to add ‘smarts’ to classic VCR and radio technology, but his latest project, the AlexaPhone, makes an old telephone ultra-smart with a connection to Amazon’s Alexa voice search system. The full article can be found in The MagPi 47 and was written by Lucy Hattersley Martin has stripped out a classic 1970s Trimphone and fitted a Raspberry Pi inside. “You lift the handset, speak your query, and the response from Alexa is read out via a built-in speaker,” explains Martin. Alexa provides users with information on the web via voice search, including weather, news, and vital facts like ‘how old is Graham Norton?’ or ‘why is the sky blue?’. “She has a fun side too,” Martin tells us, “with a seemingly bottomless selection of dad jokes and preprogrammed responses to odd questions like ‘would you like to build a snowman?’.” Beyond the jokey façade, Alexa also sets timers and reminders, plays music, and reads audiobooks. Some of the many parts packed into the phone. Apart from the pirate “I have a real weakness for retro design,” says Martin, “especially telephones and televisions.” The Trimphone was the height of technology in the 1970s, replacing the bell ring of classic phones with an electronic warbler. “I think I picked it up at a car boot sale in Brighton about 15 years ago,” he recalls. “It proved perfect for the AlexaPhone project, as the internal wiring has convenient modern ribbon cables for connection to the Raspberry Pi.” Martin used an old USB internet phone to connect the Trimphone’s microphone to the Raspberry Pi. A cheap portable speaker is stripped down and fitted inside to play back the responses. “After some digging around, I came across Sam Machin’s excellent AlexaPi code on GitHub,” reveals Martin. “It offers Alexa integration for the Raspberry Pi with a physical button connected to the GPIO pins. It’s a very tight fit for everything in the phone “The AlexaPhone started out as a quick distraction,” he continues, “but was so much fun to build it just took over. “I got the AlexaPi software fully working on my Raspberry Pi 3 in the workshop, then repeated all the steps, removing cables as it gradually became wireless-enabled and headless. Getting all of the components to fit inside the phone body was a bit of a tight…
Source: AlexaPhone

Hack a remote control with Pi Zero

Hack a remote control with Pi Zero

Ever wanted to use a Raspberry Pi to remotely control an Arduino, but using something smaller and more portable than a keyboard? Here we’ll show you how to add a Pi Zero and wireless radio to a controller from an RC toy, turning it into a versatile and customisable project controller! The full article can be found in The MagPi 46 and was written by James Lacey You’ll need Large RC car controller Slice of Radio XinoRF USB power bank Toggle switch Hook-up wire Micro USB cable STEP-01 Prepare the controller Open up the controller by removing any screws and plastic retention clips. Locate and remove the main PCB of the controller. You will see contacts on the PCB, which the joysticks or buttons on the controller touch to send signals to the integrated circuit (IC) on the board. Using a multimeter, you should be able to follow each contact to a pin on the main IC. On this controller there are four contacts, so four IC pins should be found and labelled. STEP-02 Remove the main IC The IC will probably be soldered to the PCB, so cut off all the legs with pliers and desolder all the legs from the board. Now is also the time to remove other large components from the PCB that may interfere with the placement of the Pi Zero. Remembering which pin hole connects to which IC, solder differently coloured wires to each hole and the other half of the contacts (which are usually connected via a common trace). It’s now time to prepare the Pi Zero. STEP-03 Preparing the Raspberry Pi Solder on only the first ten pins of a male GPIO header to the Pi Zero, so the serial pins are populated with connectors. Leave the rest of the GPIO holes unpopulated so you can solder on the pin connectors. Prepare a microSD card with Raspbian Jessie Lite on it, then connect to an HDMI monitor, mains power, and a keyboard to run raspi-config. Next, get the code from the GitHub repository and place it in your home directory. STEP-04 Wiring up the Pi If you are using the code without alterations, solder the contact for the forward position to GPIO 27, the backward contact to GPIO 22, the right contact to GPIO 23, and the left contact to GPIO 24. Connect the other half of each contact to a 3.3V…
Source: Hack a remote control with Pi Zero

RasPiO Pro HAT review

RasPiO Pro HAT review

One obstacle that newcomers to Raspberry Pi physical computing come up against is trying to figure out which pin does what on the Pi’s GPIO header, particularly since they’re not labelled. Previous solutions have included printing out a GPIO pin reference guide on such items as rulers and key-rings. Alternatively, users could just refer to an online diagram, such as at pinout.xyz. Even then, you still need to count down the two lines of pins on the Pi to locate the one required, which increases the chance of a potentially damaging wiring mistake. The full article can be found in The MagPi 47 and was written by Phil King Enter the RasPiO Pro HAT. Designed by Alex Eames of RasPi.TV, it makes using the GPIO pins a whole lot easier. Around the edges of its built-in breadboard are female header sockets connected to the Pi’s GPIO pins, arranged and labelled in numerical (BCM) order. So, for instance, if you want to hook up a component to GPIO 18, you simply plug its jumper wire into that labelled socket: no more pin-counting! Nor is any extra software required. The HAT works perfectly with GPIO Zero, as well as other libraries. It’s such as simple solution, it’s a wonder no one’s thought of it before. The third female header comprises six extra connections apiece for 3V3 and GND; this comes in handy, since the mini 72-point breadboard doesn’t feature the ‘+’ and ‘–’power rails of larger versions. In addition, you won’t need quite so many jumper wires to power/ground all your components as they are, in effect, wired straight to the relevant GPIO pins. You may need to stock up on a few more male-to-male cables, though. The other big advantage of the RasPiO is that it makes prototyping a lot safer, since a protection circuit with a 330Ω resistor and 3V3 Zener diode is built into each GPIO port. This means that you can use LEDs without extra resistors, and you won’t damage your Pi’s GPIO by wiring something up incorrectly, although you still need to take care not to directly short 3V3 or 5V power to GND! One side effect of this protection circuitry is that some components requiring more than the 10mA limit, such as buzzers, may be underpowered; fortunately, a line of unprotected through-hole ports is included for this purpose. Last word 5/5 The RasPiO Pro HAT really…
Source: RasPiO Pro HAT review

Mod Minecraft Pi with our latest Essentials books

Mod Minecraft Pi with our latest Essentials books

We’re back again with yet another amazing book in our Essentials series. We know you love them, and we also know that a lot of you love Minecraft. So here is Hacking and Making with Minecraft, the best place to learn about how to mod Minecraft Pi using the power of code. Hacking and Making with Minecraft is out this very second for you to go and get online. Stay fresh with this Minecraft version of Splatoon Packed into its pages, which you can download for free as a PDF, are a load of chapters based on articles in the magazine, as well as plenty of brand new tutorials created by the Minecraft Pi Mastermind himself, Martin O’Hanlon. You may have heard of him – he helped get the SpaceCRAFT code working that was run on the International Space Station by Tim Peake! Here’s some of the amazing things you’ll find in the 13 chapters squeezed into the book: Play the game and write your first program Learn how to control blocks using code Create your first mini games Interact with the GPIO pins through Minecraft Control Minecraft with Node-RED and Sonic Pi And lots more exciting stuff! We reckon it will help improve your coding skills, which you should remember when your parents start asking why you’re playing a bit more Minecraft than usual. You can buy Hacking and Making with Minecraft in our app for Android and iOS, as well as grabbing the free PDF. Print versions are coming soon too. The post Mod Minecraft Pi with our latest Essentials books appeared first on The MagPi Magazine.
Source: Mod Minecraft Pi with our latest Essentials books

Fish-eye

Fish-eye

We adore this hybridised fish-tank and LCD screen. Known as the ‘Fish-eye’, the project was build by Thomas Hudson, a developer at the Oregon Museum of Science & Technology. The Fish-eye is a fascinating creature. Unexpectedly, the LCD monitor is situated at the front of the tank, and the Raspberry Pi software superimposes the fish onto the display. “A Raspberry Pi Camera Module sits on top of the fish tank, looking down,” explains Thomas. The full article can be found in The MagPi 46 and was written by Lucy Hattersley Fish have a tranquil, calming effect, and watching them glide serenely around a tank while you work is awesome. And if you want to watch space fish, then the Earth or Moon make great fishy backdrops. “I built the tank out of acrylic using acrylic glue,” Thomas tells us. “It is amazing stuff: fairly toxic, but it welds the acrylic together so it is watertight. “The monitors were free,” he adds. “One from a free box on the sidewalk and another from a friend. Everyone is getting rid of 19-inch monitors right now.” A closer look at the setup on its side With the custom tank constructed, Thomas stripped down the LCD screen and fixed it to the front of the fish tank. “The camera captures live video of the fish from the top view and streams it live to the LCD on the front of the tank. So when you’re looking at the front of the tank, you are looking at both live video of the fish from the top view while watching the ‘real’ fish as seen through the LCD screen.” The Fish-eye uses quite a bit of bit of software to achieve its unique effect. It runs a picture program called Feh (feh.finalrewind.org) to flash full-screen images of space fish on the Moon. Oxmplayer is used to show the live stream and also recorded video of the fish. Finally, the Raspberry Pi runs a surveillance script based on Motion MMAL to identify moving fish and attach bubbles to those fish displayed on the live video feed. “I worked on the project for about a month,” reveals Thomas. “Two shows were happening, so I made two Fish-eyes. One [was] for an annual electronics art exhibition called ByteMe! 5.0; the second was for the Portland Winter Light Festival.” This intersection of moving life and still pixels gave the project…
Source: Fish-eye

Command line Pi

Command line Pi

Ever lost the ‘off switch’ for a program? Sometimes software you’re running seems to have no inclination to stop: either you can’t find out how to quit, or the app has a problem and won’t respond to your q, CTRL+C, or whatever command should close it down. There’s no need to panic, and certainly no need to reboot: just identify the process and quietly kill it. We’ll show you how, and look at what else can be done with knowledge of processes. The full article can be found in The MagPi 46 and was written by Richard smedley. If you like this tutorial, you can find more in our Essentials book, Conquering the Command Line Conquer the command line on your Raspberry Pi Processes Find the many processes running on your Pi with the ps command. On Raspbian, it’s usually called with the a and x switches which give all processes, rather than just those belonging to a user, the u switch shows processes by user, attaching it to a tty. w adds wider output, and ww will wrap over the line end to display information without truncating. Type ps auxww to see, then try with just a or other combinations. You’ll notice that these options work without the leading dash seen for other commands. Both the lack of dashes, and the letters a and x, date back to the original Unix ps of the early 1970s; this was maintained through various revisions by one of Unix’s two family branches, BSD, and baked into the first GNU/Linux ps. Unix’s other branch, System V, extended and changed ps with new options and new abbreviations for command switches, so for ps ax you may also see ps -e (or -ef or -ely to show in long format). The ps aux listing has various headers, including the USER which owns the process, and the PID (process identification number). This starts with 1 for init, the parent process of everything that happens in userspace after the Linux kernel starts up when you switch the Pi on. Knowing the PID makes it easy to kill a process, if it’s the easiest way of shutting it down. For example, to kill a program with a PID of 3012, simply enter kill 3012. To quickly find the process in the first place, use grep on the ps list. For example, locating vi processes:ps aux | grep -i…
Source: Command line Pi

ProtoZero review

ProtoZero review

Breadboards are great for testing out electronics projects, but the end result may well look messy, often featuring a spaghetti-like tangle of jumper wires. Not only that, but such a setup isn’t all that portable, as some loose wires or resistors could easily fall out if you dare to move it. If you’re looking to make your project more permanent and practical, you’ll want to solder the components to a prototyping board like this one. The full article can be found in The MagPi 46 and was written by Phil King The subject of a successful KickStarter campaign, the ProtoZero is the brainchild or Richard Saville, author of the popular Average Man vs Raspberry Pi blog. Resembling the little brother of his previous ProtoPal prototyping board, it’s made of perfboard and is designed to match the dimensions of the Pi Zero perfectly, although it can also be used on any other 40-pin model, including the Pi 3, 2, A+, and B+. While it is can not technically be described as a HAT, as it lacks an EEPROM, the ProtoZero does sit neatly on top of the Pi’s GPIO pins, for which it has two corresponding rows of connector holes with helpful labels. The remaining 154 holes – likewise featuring high-quality ENIG (electroless nickel immersion gold) PCB plating – are arranged in printed lanes of three or four. Components may be soldered to the front or (similarly labelled) rear, if you want to hide unsightly wires and suchlike. Example project ideas include an LED array, temperature monitor, and four-character digital display, but the only limit is your imagination. Note that since the ProtoZero comes in kit form, you’ll first need to solder the supplied 40-pin GPIO header to the board, but this is no more difficult than doing so for the Pi Zero itself – and you’ll be soldering components to it anyhow. One advantage, as well as reduced cost, is that you may elect to use a stacking header (not supplied) instead, enabling you to stack multiple ProtoZeros and/or HATs. While some veteran electronics project makers may prefer to create their own custommade prototyping boards from inexpensive perfboard, the ProtoZero is ideal for lessexperienced users who want to take their projects one step up from the breadboard. With its perfectly rounded edges and matching form factor, it also gives a professional look to Pi Zero projects. The post ProtoZero review…
Source: ProtoZero review

4bot

4bot

You may have seen computers that can defeat grandmasters at chess, win at trivia game shows or, more recently, beat a human at Go, but have you ever played Connect 4 against a robot? Humour us by answering no (statistically speaking, you probably haven’t) and then prepare to be amazed at the 4bot created by David Pride. The full article can be found in The MagPi 46 The 4bot has humble beginnings, as David explains its origins to us: “My wife bought me the brilliant MeArm kit and I used it to build a Lego block sorter, as you do. This used the Pi Camera Module and a colour recognition script I wrote in Python to identify the different coloured blocks, and then used the arm to drop them in the correct ‘buckets’.”

“Based on this, I was then looking for other uses for the colour-capture code,” David continues. “Connect 4 seemed like a really good choice. Research soon led me to find that the game, and the logic behind it, is far from simple. There is good information online; however, whilst I found many versions of Connect 4 for Python, few of them ran successfully on the Pi.” The robot works by taking a picture of the game board, processing the colours, and then giving the game program the state of the board to calculate the next move. “In terms of how well it plays, Connect 4 is a ‘perfect’ game in mathematical terms,” David reveals. “There are a huge but finite number of solutions, and they can all be calculated with enough processing power. The trade-off is in the depth of search and therefore the time taken to calculate each move… If you increase the search depth, this massively increases the calculation time. So I selected a middle ground where the bot plays a pretty meangame, but the total time per move is still acceptable. With capturing and processing the image, calculating the next move, and delivering thecounter, the total time per turn is around 25 seconds.” Eben has a bit of fun at the big birthday bash Recognising the colours currently in play is not easy, though, and took a bit of trial and error to get right. “The trickiest part was undoubtedly capturing the game board accurately every time,” David tells us. “It is extremely lightdependent, as the Python module works by capturing the…
Source: 4bot

Raspberry Pi night vision camera hack

Raspberry Pi night vision camera hack

Many people have a number of Raspberry Pis at home. Some might say those folks are obsessed, but Pis are so versatile that trying out new projects where possible is great fun! Putting them to good use is always exciting, so why not turn a spare Model B into a night-vision CCTV camera, using an inexpensive case, the Camera Module, and a nifty little accessory called the Lisiparoi to provide infrared lighting? If you saw the previous guide on adding push notifications to MotionEyeOS (issue 43), then combining this with night vision would be a great addition! The full article can be found in The MagPi 46 and was written by Wesley Archer You’ll need Lisiparoi LED light ring (infrared version) Cyntech Raspberry Pi case Raspberry Pi NoIR Camera Module USB WiFi adapter MotionEyeOS Drill and small drill bit (1mm or 2mm ideal sizes) Small file (we used a metal nail file) Pencil and a sharp knife (craft or Stanley knife) STEP-01 Mark where you will cut Before cutting into the case, it makes things easier to mark it out first. Grab your pencil, place your Camera Module and Lisiparoi on the case, and then draw around them. You should be able to see the pencil line, and it’s easy to remove if you need to. Make sure you allow enough room around the outside so that it’s not too close to the edge of the case, though! You’ll also need to cut out space for the pins on the Lisiparoi, holes to mount the Camera Module board, and a hole for the camera lens itself. STEP-02 Drill the mounting holes Using a small drill bit (1mm / 2mm is ideal), drill two small holes in the case. If you are very careful, you can use the Lisiparoi as a template. You should now have two small holes in the case and a pencilled outline of the Lisiparoi. It’s now time to drill holes for the header pins, which are a few millimetres away from the bottom edge of the Lisiparoi. It’s best to start small and increase the size of the holes as you go; it doesn’t have to be exact, as the Lisiparoi will hide everything once in place. STEP-03 Drill, file, test, and repeat Whilst doing this, remember – you can always cut more off! To make sure our header pins on the Lisiparoi fit nicely, we drilled the…
Source: Raspberry Pi night vision camera hack

LiV Pi review – air-quality monitoring

LiV Pi review – air-quality monitoring

Coming from Hong Kong, the LiV Pi is a curious, Raspberry Pi-compatible product. Marketed somewhat as a device for businesses to keep an eye on the air quality inside their buildings, it’s a product that’s been created mainly to suit the situation in Hong Kong. The city has some serious air pollution problems, which you can read more about elsewhere. So, with that and general building safety in mind, it does start to make more sense. The full article can be found in The MagPi 46 What the LiV Pi boils down to is a large, colourful acrylic case with a two-line LCD display on the front. Inside, you’re supposed to install a Raspberry Pi along with the specially provided add-on board that functions almost like a HAT. This HAT allows you to plug in some supplied sensors and a real-time clock, and then you’re basically ready to go. LiV Pi ships with three main sensors: a carbon dioxide (CO2) sensor, a temperature/humidity sensor, and an air pressure sensor. The CO2 sensor is the main component here, and the LiV Pi team explain on their website that a rise in CO2 levels in the air is a good indication of air quality, since it’s likely to have bought much nastier air with it. The humidity and temperature sensor allows you to keep track of the environment indoors in other ways, and it sounds like the barometric pressure sensor was thrown into the system just because they could. There’s some fun to be had constructing the full LiV Pi. On the website, you can buy a bare-bones kit of the sensors and board (pre-soldered or not). Alternatively, you can get the full version with a case, which is what we’re looking at here. The price does seem quite steep; $350 for the full LiV Pi is not an easy number to swallow, although it’s not ‘targeted’ towards consumers per se. The construction is quite simple. With the full kit you get the acrylic case, which almost snaps together and is made up of six pieces. The snapping isn’t very firm, so there are screws and spacers to keep it together, making it fairly easy to assemble and disassemble when needed. This version also comes with everything already soldered up on the boards. Then again, there’s not a huge amount of soldering to be done with the basic kit version (from $35):…
Source: LiV Pi review – air-quality monitoring