Squeeze Controller: hack a dynamo torch

Squeeze Controller: hack a dynamo torch

Have you seen those dynamo torches, the ones that you repeatedly squeeze to light three white LEDs? Well, this month we are going to take a pair of these and turn them into a unique games controller. A new type of controller offers the possibility of new types of games, or a better way to control some existing types of games. This tutorial was written by Mike Cook and first appeared in The MagPi issue #83. Subscribe in print for 12-months and get a free Raspberry Pi. Hack a dynamo torch The torch, or flashlight for our American cousins, can come in many forms. These days there are lots of self-powering devices which involve actually generating the power needed to drive them by the efforts of the user. With a dynamo torch, the user repeatedly squeezes a lever to spin a magnet in a coil and generate electricity. We took one apart and measured the voltage the generator produced. As you can see in Figure 1, the output is AC with a peak-to-peak voltage of almost 80 V; when squeezed, the frequency rapidly rises to about 170Hz. You’ll need Two dynamo torches A/D converter (ADC), e.g. MCP3008 Assorted electronic components Figure 1 Oscilloscope trace of the raw output from the dynamo torch Warning! High voltage The dynamo torches in this project can produce high voltage, so be careful. This voltage is very high, but is loaded down by putting a white LED across it; this shorts the negative voltage and limits the positive voltage to about 3 V, which is the forward voltage drop across the LED. This is a cheap and nasty design. You can pump the leaver to sustain a voltage or just squeeze once for a pulse, as shown in Figure 2. This shows 24 rapid squeezes followed by a single squeeze and release; it is measured over five seconds. Note how the trace is changing so rapidly that we can’t see the individual waveform, only the envelope. Figure 2 Oscilloscope trace of 24 rapid squeezes and then a single squeeze at the end Conditioning the signal The idea is that we can condition this signal to make a games controller. Basically, we need to make it into a DC signal by adding a series diode and then getting just the peaks of this signal with an envelope follower, which is sometimes called a peak detector. This uses a…
Source: Squeeze Controller: hack a dynamo torch

Send Raspberry Pi to (near) space with high-altitude balloons

Send Raspberry Pi to (near) space with high-altitude balloons

On 16 July 1969 the Apollo 11 rocket launched, taking humans to the moon for the first time. If all the space celebrations have inspired you, then consider looking into HAB (high-altitude ballooning) with Raspberry Pi: it’s the closest many of us will get to launching a spaceship. Unless you have access to a rocket or other kind of spaceship, it’s a bit tricky to put your Raspberry Pi into space. However, with a very special balloon (and some luck with the weather) you can get pretty close. HABs can go over 30 km into the sky – high enough to get amazing photos of the curvature of the Earth. July is likely to be a very busy month for people in the space community, as the 50th anniversary of the Apollo 11 mission is celebrated by everyone! We got in touch with Pi HAB launcher extraordinaire Dave Akerman, who is working on an amazing launch for 16 July to commemorate the launch of Apollo 11 on 16 July 1969. Here’s the special model ship in the payload… This model of the Apollo 11 payload is being used in an Apollo 50 launch celebration Dave has successfully launched the Apollo 50 mission. Click here to follow its progress.

HAB Required hardware A HAB is made up of the balloon itself and the payload. At the very least you’ll need to pack a tracker: there are GPS trackers that also use mobile data, SPOT trackers that use satellites, APRS which uses radio signals, and UKHAS radio trackers. For photos, you can use a Raspberry Pi Camera Module or USB camera. You’ll also need a parachute so it can land safely once the balloon bursts. A Raspberry Pi as the main computer will be required as well, along with a power supply for the electronics. Programming the HAB Software for the Raspberry Pi inside your payload is not too complicated: it’s popular to live-stream the view of your camera, so using any internet connectivity you have in conjunction with the camera you’ve installed can be a good idea. Otherwise, you can have images save onto the Raspberry Pi as it goes. A lot of trackers will usually have a lot of software already set up for them. Do your research and make sure you’ve got everything tested before attempting a launch. Dave Akerman has a great guide. Launch preparations There’s a long…
Source: Send Raspberry Pi to (near) space with high-altitude balloons

Upcycle old technology with Raspberry Pi

Upcycle old technology with Raspberry Pi

Upcycled Technology: Clever Projects You Can Do With Your Discarded Tech Author: Daniel Davis Price: £20.99/$13.49 (hardback), £6.43/£8.17 (Kindle e-book) URL: tinkernut.com Upcycled Technology: Clever Projects You Can Do With Your Discarded Tech Half the battle of upcycling technology is coming up with a concept. The rest is identifying and working with devices that can help you achieve your aim. This article first appeared in The MagPi 83 and was written by David Crookes This new book by creative technologist Daniel Davis hopes to inspire, guiding you through six projects that help you turn old webcams, laptops, CD-ROM drives, smartphones, iPods, and mobiles into backup cameras, projectors, 3D printers, security cams, and smartwatches. In doing so, it examines key stages of the upcycling process, explaining why you should reconsider chucking away your old tech, and even describing where you may find stuff that others don’t want. In that sense, it’s a handy resource. A crucial chapter picks apart a handful of tech and looks at the useful components they contain, and there’s a good look at the tools you’ll likely need for your projects – including a Raspberry Pi, of course. That said, none of the projects actually uses a Raspberry Pi and, despite the steps clearly explaining the processes, it often skims when it could go in-depth. But you do get a solid grip of the various concepts and it’s a good introduction to upcycling, particularly in its cheaper e-book form. iFixit Author: iFixit with help from users Price: Free URL: ifixit.com iFixit You shouldn’t generally tackle technology like a bull in a china shop and hack away at products’ innards without thought. It’s always a good idea to see what goodies they contain first, so that you can determine what could be used in your upcycled technology projects and how they can best fit with a Raspberry Pi. This wiki-based site has repair guides that take you under the skin of a device to look at specific parts. It also has full tear-downs which show you the safest way to dismantle lots of different technology – perfect for identifying any problems and every significant component you’ll come across. Full lists of tools used are available, and there’s a store where you can buy any you need, too. Retro Raspberry Pi Hands-On Hardware Projects Author: Constantin Adam Price: £8/$10 (special offer) URL: Packt As well as running the excellent…
Source: Upcycle old technology with Raspberry Pi

Make a self-healing Raspberry Pi: create a recovery partition

Make a self-healing Raspberry Pi: create a recovery partition

Most modern operating systems come with a ‘recovery partition’, a reserved area of the drive containing everything needed to get the machine back to a clean install. So, if something goes badly wrong, you can start over. In the world of Raspbian, this normally means overwriting the image on the microSD card. This is perfectly fine, but what if you have a large number to do, say a classroom’s worth, or you don’t have access to another device to do the burning? We’re going to create an alternative version of Raspbian featuring a recovery partition. Raspberry Pi, heal thyself! Raspberry Pi recovery partition: you’ll need Raspbian Stretch Full image Raspbian Stretch Lite image Jumper (or F-F jumper cable) Lots of hard disk space Debian/Raspbian OS Create a custom image for a classroom and know you can quickly get back to a clean, working machine after each session Prepare your workspace This tutorial will describe how to create a bootable image featuring a restore partition, but there’s also a script to automate the process that you can download from magpi.cc/junkPr. This also contains the code shown some of the trickier commands shown later. Make sure you have uuidgen installed by running it from the command line. If not, run: sudo apt install uuid-runtime Most commands here will need to be run as root. To avoid having to enter ‘sudo’ every time, you can switch to root using: sudo su Create a working directory on your machine and make sure you’ve downloaded both the Raspbian Full and Raspbian Lite images (we’re using 2019‑04-08). Unzip them as follows: unzip 2019-04-08-raspbian-stretch-full.zip unzip 2019-04-08-raspbian-stretch-lite.zip Calculate the image size Our image needs to be big enough for Raspbian Full, including its boot partition, and a second partition containing Raspbian Lite with an image of Raspbian Full. We measure disk sizes in sectors, each one 512 bytes in size. Find out how many sectors are used by the partitions: fdisk -lu 2019-04-08-raspbian-stretch-full.img fdisk -lu 2019-04-08-raspbian-stretch-lite.img Each command produces output detailing how many sectors are required (see Figure 1). The boot partition starts at sector 8192 to allow for the file allocation table. To calculate the size needed: 8192 + Raspbian Full Boot Partition + Raspbian Lite Main Partition + (Raspbian Full Main Partition × 2) With these Raspbian versions, you will need 24,426,283 sectors. Figure 1 Use fdisk to view the partitions and calculate the sizes you…
Source: Make a self-healing Raspberry Pi: create a recovery partition

Chris Barnatt interview

Chris Barnatt interview

In the dark ages before YouTube, finding shows about technology, science, and computers on TV was a bit tricky. They were few and far between, so when Tomorrow’s World and How 2 were on, a lot of young people watched. Now, with 2020 just around the corner, there’s a wealth of video channels online to satisfy your cravings for tech knowledge – and one of them is ExplainingComputers, run by Chris Barnatt. This article first appeared in The MagPi 83 and was written by Rob Zwetsloot “I remember reading the Ladybird book [‘How it works’: The Computer] when I was six or seven years old,” Chris tells us. “[I was] fascinated by the pictures of magnetic core storage, which were still in use at the time. When I was about 13, my parents bought me a ZX81 – in some ways the Raspberry Pi of its day – and I soon learnt to program it in BASIC and assembler, and wrote my first articles for computer magazines. I subsequently spent 25 years lecturing in computing and future studies in the University of Nottingham.” A classic game, remade with Raspberry Pi In 2007, Chris launched ExplainingComputers.com as an ‘online computing textbook’, which led to him starting the YouTube channel in 2008. This has covered a huge range of tech concepts and projects, and became a weekly show at the end of 2015. From last year, Chris has added Raspberry Pi videos. He makes use of his production experience at the BBC to add animations to his videos as well. When did you first learn about the Raspberry Pi? I remember watching a report on Raspberry Pi on the BBC’s Click TV show shortly after the board was first launched. But I didn’t get one until a year or so later. Since that time, Raspberry Pi, and SBCs (single-board computers) more generally, have been an increasing part of my life! I now have about 40 SBCs, including every Raspberry Pi aside from the first Model A. The aptly named DEVASTATOR ROBOT is powered by a Raspberry Pi Zero What are some of your favourite videos that you’ve made? On ExplainingComputers, my favourite videos are often those that show viewers how to do things with low-cost hardware and/or free software – which is why I like working with Raspberry Pi, and why it is so popular with my audience. I remember making a video a…
Source: Chris Barnatt interview

TV Wall controlled by Raspberry Pi

TV Wall controlled by Raspberry Pi

Where would the Wizard of Oz have been without the visual artifice that kept his myth alive? Being confronted with Johanna Tano’s wall of TV screens surely has a similar disembodied effect to the sight that greeted Dorothy and pals when they entered the Emerald City. Harnessing the power of Raspberry Pi computers, Johanna has been able to sync up and independently control up to 30 analogue TV displays at once. Self-taught programmer Johanna’s visual installations have appeared at music festivals, in a forest in Sweden, and at fashion shows. Each is controlled by Raspberry Pi. In her aptly named TV Wall, Johanna demonstrates the possibilities of using old tech and new in a highly engaging fashion. The TV Wall had its debut at Stockholm’s Fashion Week in 2017, where the likes of singer Kelis partied to a backdrop of multi-screen live video mash-ups. See also: Make comics from TV recordings Vintage television with Raspberry Pi TV HAT Ambient TV lighting system TV Wall: Quick Facts Johanna once created a fortune-teller from a rotary-dial telephone She harnessed real space data to generate visual art, controlled by an EEG She was part of the Berlin-based tech-art collective Lacuna Lab Her first Raspberry Pi project lit up Sweden with 45 LED light trees users controlled remotely She views Raspberry Pi as the ideal way to control hardware used in conceptual art projects The sun always shines on TV In its most recent iteration, the TV Wall is central to Swedish singer Zacharias Zachrisson’s (AKA ‘Vacation Forever’) music video for Shadow. He says: “Together with the video director, Albin Eidhagen, we created custom-made videos and animations for the TV screens, which was live-mixed when we filmed it.” The result is a decidedly eighties video, not unlike something by A-Ha.

Appropriately enough, the video came about when the singer saw the TV Wall displaying live code-generated visuals on Instagram and got in touch with Johanna. She had only a week to assemble the build for the music video shoot and says things “get complicated, fast” as the installation is scaled up and more TVs – and more IP addresses – are added. Those inspired by her project can follow in her footsteps by breaking it down. “Figure out how to get a video signal from Raspberry Pi to a TV, then how to stream video from a computer to a Raspberry Pi,” she…
Source: TV Wall controlled by Raspberry Pi

Cambridge Uni develops Raspberry Pi smart cars that skip traffic jams

Cambridge Uni develops Raspberry Pi smart cars that skip traffic jams

Trials of autonomous cars on a track in Cambridge have proved that traffic congestion headaches could be largely avoided in the future. The results of tests using a small fleet of Raspberry Pi-controlled cars by Cambridge University researchers were presented at the International Conference on Robotics and Automation in Montreal in June.

Mimicking motorway mayhem Scale models of existing cars were fitted with motion-capture sensors and Raspberry Pi controllers, and communicated with each other over wireless LAN. Researchers were keen to establish the behaviour of self-driving cars when faced with obstacles, such as a broken‑down vehicle. Where the robot cars were operated independently from each other, a car stuck behind one that had broken down had to slow down or stop and wait for a gap in the traffic in order to pull out into the next lane and overtake the obstacle. So far, so similar to commuters’ everyday experience. However, in scenarios in which it was possible for the robot cars to communicate, the cars were able to drive ‘co-operatively’. If a car in the inner lane slowed down or stopped, a signal was sent to all the other cars. Those in the outer lane slowed slightly so cars behind the slower one were able to pull out and avoid a collision, thus keeping both lanes of traffic flowing smoothly. With improved road safety it was possible to pack cars more closely, improving efficiency by between 35% and 45%, depending on whether the tests were modelling co-operative or ‘aggressive’ driving modes. Each car contained a Raspberry Pi Zero W to control the micro-servo arm and DC motors Cross-car communication “Autonomous cars could fix a lot of different problems associated with driving in cities, but there needs to be a way for them to work together,” says report co-author Michael He, an undergraduate student at St John’s College who designed lane-changing algorithms for the experiment. The algorithm calculates whether it is safe to change lanes, and whether there’s a compelling advantage to doing so – a perhaps more rational approach than some human drivers. The researchers now plan to trial larger fleets of cars with more complex scenarios such as road junctions and a wider range of vehicle types. More information about the experiment can be found on the University of Cambridge website. The post Cambridge Uni develops Raspberry Pi smart cars that skip traffic jams appeared first on…
Source: Cambridge Uni develops Raspberry Pi smart cars that skip traffic jams

Get started with PICO-8

Get started with PICO-8

At the forefront of a new wave of ‘virtual’ consoles, PICO-8 packs a pixel-perfect punch of 8-bit delights. Containing everything you need to make your own games, from code to graphics to sound, it has a super-active and supportive community of makers and creators behind it. With its own built-in game browser, you’ll have access to a huge library of games straight out of the gate. The good news is you can get it running on your Raspberry Pi in just a few steps, meaning you’ll be sitting cross-legged in front of the living room TV in no time. This article first appeared in The MagPi 83 and was written by Dan Lambton-Howard You’ll need USB game controller(s) (Any generic 2-button controller will do) PICO-8 Keyboard, mouse, and an internet connection Step 1: Prep a Raspberry Pi First things first, you’ll want a Raspberry Pi set up and ready to go. These steps are tested on a fresh install of Raspbian Stretch with Desktop, so you’ll want to do the same. You can plug in your USB controller (PICO-8 supports one or two) and, for these first few steps, you’ll need to plug in a USB keyboard and mouse as well. Once you’ve got it all up and running, though, a controller and WiFi is all you’ll need to download and play games. o make Raspberry Pi boot straight into PICO-8, you’ll need to set system preferences to boot into CLI after editing .bashrc Step 2: The Lexaloffle shuffle Next, you will want to download a copy of PICO-8 from the Lexaloffle website. To do this, you’ll need to set up an account and buy a licence, which is a steal at around £12 at the time of writing. Once you’ve done that, go to the Downloads section of your new account on the website and download the Raspberry Pi version of PICO-8. You can use Chromium to download the zip file straight to your Raspberry Pi. Note: with your newly acquired licence, you can download Windows, macOS, and Linux builds of PICO-8 as well. A nice perk! Step 3: 3, 2, 1… launch! Extract the contents of the zip file into your /home/pi directory. Navigate to the newly unzipped folder and you will see a bunch of files. Most interesting for us is pico8 (not the .dat), which is the virtual console itself, and manual.txt. The manual contains loads of valuable information,…
Source: Get started with PICO-8

Smart palm tree greenhouse

Smart palm tree greenhouse

Thomas Geers is a fan of palm trees, although they’re not very common in Germany, where he lives. Seeking to help conserve an endangered species of palm tree – the Chilean honey (or wine) palm, Jubaea chilensis – he bought some seeds in the summer of 2018. One issue, however, was palm tree seeds’ long germination time: up to a year. This inspired Thomas to build a fully automated smart greenhouse to ensure stable conditions for the seeds and possibly encourage faster germination. This article first appeared in The MagPi 83 magazine. Free Raspberry Pi with a 12-month print subscription to The MagPi magazine. After purchasing a standard mini greenhouse from a hardware store, he modified it with a homemade housing. “The housing consists of a wooden frame and 1 cm-thick plywood, which are bolted together,” he tells us. “The wood is painted with a weatherproof wood glaze.” He then equipped it with various sensors and automated systems for watering, heating, lighting, and air humidity – all controlled by a Python script running on Raspberry Pi 3B+ linked to a relay board. Four switches enable manual control of heat, fans, watering, and light, while an LCD screen displays current temperature and moisture levels Smart palm tree greenhouse: fast facts The electronics are hidden in the rear of the housing The housing cover and shell can be removed quickly Sensors can be connected and disconnected outside the housing Thomas also has a squirrel/bird box observed by a PiNoir camera… Two great tits make this their home (see the live stream). With the rear panel removed, we can see the Raspberry Pi 3B+, relay board, and other electronics. In the housing cover, two LED plant lamps provide light Automatic for the palm tree seeds “For automatic irrigation, there are twelve spray nozzles in the housing cover which will be activated as soon as the soil is too dry,” explains Thomas. “For this purpose, there is a capacitive earth moisture sensor (Giesomat) in the earth.” Another key factor is maintaining an ideal temperature for the seeds. For this, Thomas placed a DS18B20 sensor in the soil and a heating mat underneath the container. “As soon as the earth temperature falls below a set value, the mat heats up the earth,” says Thomas. The automated lighting system comprises two LED plant lights which are switched on and off via a day/night time control – 12…
Source: Smart palm tree greenhouse

1986 PiNG Video Doorbell

1986 PiNG Video Doorbell

Smart doorbells have been ringing in the changes for home security for a while now, streaming video and audio to mobile devices whenever their button is pressed. They let you see and communicate with visitors regardless of whether you’re in or out. While one of the most popular devices is Ring, however, Martin Mander opted to create his own. This article first appeared in The MagPi 83 and was written by David Crookes “I took it as a personal challenge to build something with similar functions to Ring with a Raspberry Pi for a much lower cost,” he says, indulging his passion for taking old tech and giving it a new lease of life using Raspberry Pi. And so, the idea for the PiNG video doorbell was born. “At its most basic, it’s just a Raspberry Pi, a webcam, a button, and an amplified speaker, which many folks have lying around already,” Martin says. What’s more, he reckons it is simple enough for others to recreate and he actually created it with this in mind. Raspberry Pi and pHAT BEAT are placed inside an old cassette player wired to the intercom outside. The pHAT BEAT is also connected to the player’s original speaker so that speech and the chime can be heard Securing the system For a long time, Martin kept putting his project to one side as he sought an easy way to make video calls via Raspberry Pi. He noted the release of a browser-based version of Google Duo. “Before that, I was on the point of installing Android on a Raspberry Pi to see if I could use Duo that way,” he says. “But the first test of Duo’s web app was amazing. From that point, it was full speed ahead.” Martin found Duo worked best on a Raspberry Pi 3, which he originally connected to a Logitech webcam, plus a screen, mouse, and keyboard (later swapping the webcam for a LifeCam HD‑3000 which has an integrated microphone). The real challenge was to make the setup work with a headless Raspberry Pi and buttons. This involved coding mouse movements, clicks, and keyboard strokes using the Python module PyUserInput. “When someone presses PiNG’s button (which is a standard doorbell I bought on eBay), the script uses the PyUserInput module to move the cursor around the screen, emulating mouse clicks and keystrokes to control the Google Duo web app,…
Source: 1986 PiNG Video Doorbell