Category Archives: Raspberry Pi How-to’s

Banish Advertising From Your Whole Network with Pi-Hole

Pi-Hole_admin_interface

What is Pi-Hole?

Pi-Hole is a Linux network-level advertisement and internet tracker blocking application which acts as a DNS sinkhole (And optionally a DHCP server), intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but can be used on other machines running Linux and cloud implementations.
Pi-Hole has the ability to block traditional website adverts as well as adverts in unconventional places, such as smart TVs and mobile operating system adverts.

The Pi-hole project was created by Jacob Salmela as an “Open Source” alternative to the AdTrap.

Controlling Mindstorms EV3 with a Raspberry Pi

Original Article: The MagPi, The Official Raspberry Pi Magazine

LEGO Mindstorms is a great tool to gain experience in understanding robotics, but what if you wanted to make your own input sensor? In this guide, we will show how simple it is to construct a circuit to control a Mindstorms robot through GPIO in Raspberry Pi.

We will show every step from connecting the robot to writing the code. The result will be a program in Ch, a superset interpreter of C/C++, to control the direction of the robot with a push-button.

Timelapse Photography with Raspberry Pi Zero

long-camera-adaptor-for-pi-zero

This tutorial will guide you through taking photos using a Pi Zero and camera, to make a simple timelapse-capturing device. Use it to make a timelapse of a plant growing with the delay set to a day, or the progress on your building work with hourly photos, or a soldering project with a photo every 5 seconds.

Enable the camera

This tutorial assumes you have already set up your OctoCam as per the instructions. If you’re using a camera and a Pi, make sure the camera is connected.

In the Terminal, type sudo raspi-config and press Enter. This will bring up a menu on the screen. You’ll need to press 5, then choose option 1 to enable the camera, and then choose yes. Once you finish with the menu you should get prompted to reboot. This needs doing!

Build a Raspberry Pi Streaming Music Player

Pi MusicBox

In this tutorial, I will be going through steps to making your very own Raspberry Pi music player. This process is pretty straightforward, so you shouldn’t come across any problems at all.

For this project, I am going to be using a pre-built software package called the Pi Musicbox. This software contains plenty of features & functionality that make it great as a Music player.

This project is a headless music player so you will need to use a different device to be able to control it. The good thing is you can pretty much use any device that has a browser to be able to interact with it.

pHAT DAC for Raspberry Pi Zero

If you want to see how to do this visually, then be sure to check out my full video below. It goes through all the steps to getting this setup and working correctly in no time at all. If you do like the video be sure to subscribe, so you stay up to date.

Writing Your First Shell Script with Raspberry Pi

First Bash Script with Raspberry Pi

In this tutorial we’ll be writing our first bash script for Raspberry Pi. We’ll create a directory to keep this and future scripts, write the actual script, and set it up as something that can be executed from the shell.

Scripts are an incredibly powerful tool to have in your toolbox. In essence, a script is just a sequence of commands that you could otherwise have entered into the shell. The power of scripts is that they can be used to make decisions, and execute certain commands based off that decision. Scripts can be scheduled to run at certain times, and can execute trigger other scripts.

In this tutorial we’re assuming you’re familiar with how to use the terminal to navigate the file system and create files and directories.

24-bit, 192KHz Audio for the Raspberry Pi Zero with the pHAT

pHAT DAC for Raspberry Pi Zero

The pHAT provides a super affordable high-quality DAC for your Raspberry Pi. It pumps out 24-bits at 192KHz from the Raspberry Pi’s I2S interface on its 2×20 pin GPIO header.

Use pHAT DAC to build a tiny, lush-sounding streaming music device, or use it with Scroll pHAT to make a beautiful spectrum analyser!

Features

  • 24-bit audio at 192KHz
  • Line out stereo jack
  • Optional landing for dual RCA phono connector
  • PCM5102A DAC over the Raspberry Pi’s I2S interface
  • pHAT DAC pinout
  • Compatible with Raspberry Pi 3B+, 3, 2, B+, A+, Zero, and Zero W
  • Female header requires soldering

WS2812 Addressable LEDs: Raspberry Pi Quick-start Guide

This tutorial is aimed at getting some instant gratification from your WS2812 LEDs (trade name: neopixels). I’ll briefly cover a bare-bones setup for Raspberry Pi.

If you’ve never used a Raspberry Pi before, we’ve got you covered with our free, online Raspberry Pi How-To’s.

Temperature Sensing With Raspberry Pi

The Raspberry Pi lacks analogue input, and while it’s possible to use an Analogue to Digital Converter (ADC), the DS18B20 is a fantastic, easy to use digital sensor that uses the Dallas 1 wire communication interface. Fortunately for us, the Raspberry Pi comes with built in software handling for 1 wire sensors which makes using sensors such as the DS18B20 pretty straightforward.

What is 1-Wire Communication

The Dallas 1-Wire protocol is a method of serial communication designed for simple communication between 1 Master and multiple Slave devices. Serial communication means that data is sent bit-by-bit along a single data line.

1 wire communication is most commonly used for temperature sensors, EEPROM chips, and other simple devices. Unlike other serial communication protocols such as I2C, which allows for device IDs/addresses to be assigned and handled by the master device, 1 wire devices have an unchangeable, factory set device ID. By differentiating between unique device IDs, you can chain multiple slave devices on a single data bus.

Setup Raspberry Pi Zero with Headless WiFi

Raspberry Pi Zero
The following instructions will work anytime, you don’t necessarily have to follow them for the first boot – this is just a very convenient way to get your Raspberry Pi onto a network without using any plug-in peripherals like a keyboard, mouse or monitor.

What is “headless,” anyway?

A computer setup without a monitor is said to be running headless. You might want to do this if you’re installing your Pi into some project, or want to keep power-usage and cost minimal. This kind of setup is what the Pi Zero W was built for. The idea is that you can still access your Pi’s terminal interface over your network using a protocol called SSH.

All we need to do is get our Pi set up with the right WiFi credentials and we’ll be able to remotely access it through a terminal program, as if we were using the terminal Pi’s own desktop. What’s more, we’ll get our Pi connected to WiFi without ever having to plug in a monitor, keyboard or mouse to configure it.

How to Multi-Boot Your Raspberry Pi with “BerryBoot”

boot-multiple-operating-systems-raspberry-pi-with-berryboot
If you want to spend less time swapping cards and more time playing with your Raspberry Pi, installing the BerryBoot multi-boot manager makes it dead simple to boot multiple operating systems from one SD card. Read on as we walk you through the process.

Why Do I Want to Do This?

BerryBoot is a boot management tool for the Raspberry Pi that adds quite a bit of functionality to the Raspberry Pi experience. The biggest benefit is that it allows you to boot more than one operating system off the SD card. You can store the operating systems either on the card itself or, if you want more room, you can configure BerryBoot to use the SD card only as a launcher and to run the operating systems off an attached hard drive.

Boot Raspberry Pi from a USB Mass Storage Device

boot-multiple-operating-systems-raspberry-pi-with-berryboot
By default, the Raspberry Pi boots from a microSD card. But since the release of the Raspberry Pi 3, new Pis have been able to boot from a USB mass storage device as well. Making that happen is a pretty easy thing to do, and it’s the subject of this how-to.
A word of warning: the new boot mode is in its experimental stage, so it might not work with your USB stick or hard drive. According to the Raspberry Pi Foundation, a couple of non-working examples are the Kingston DataTraveler 100 G3 32 GB and the Verbatim PinStripe 64 GB. The USB compatibility issue will only affect some of us, but the next warning is relevant to us all: setting the boot mode is permanent. With that said, this sounds much scarier than it is: your Pi will still boot preferentially from the microSD card, if one is plugged in.

Using the ‘Google Cloud Vision API’ with your Raspberry Pi

What is the ‘Google Cloud Vision API’?

Google Cloud Vision API enables your robot to understand the content of an image by encapsulating powerful machine learning models in an easy to use REST API. It quickly classifies images into thousands of categories such as “robot”, “elephant”, “flower”. It detects individual objects and faces within images. It capable of finding and reading printed words contained within images, and even determines the language it is written in. You can use it to build metadata for your image collection, and can be used to moderate offensive content through image analysis.
The Vision API enables you to detect different types of inappropriate content from adult to violent content. It analyzes images uploaded by the request, or integrate with your image storage on Google Cloud Storage.

Raspberry Pi Cheat Sheet – Learning Basic Linux Commands

A big part of using a Raspberry Pi is also using the terminal. The terminal is something that a lot of people try to avoid, because they feel like it is a bit hard to use. But it doesn’t need to be that that way, because in reality we can break it down to just a few basic commands that you need to know to do code, tty, and most everything else.

Using Flask to Control Raspberry Pi GPIOs

With this project you can create a standalone web server with a Raspberry Pi that can toggle two LEDs. You can replace those LEDs with any output (like a relay or a transistor). In order to create the web server you will be using a Python microframework called Flask.

Parts Required

Here’s the hardware that you need to complete this project:

  • Raspberry Pi (any Pi should work, I recommend using Raspberry Pi 3) – view on eBay
  • SD Card (minimum size 8Gb and class 10) – view on eBay
  • Micro USB Power Supply – view on eBay
  • Ethernet cable or WiFi dongle
  • Breaboard – view on eBay
  • 2x LEDs
  • 2x 470Ω Resistors
  • Jumper wires

How to install “Raspbian” on the Raspberry Pi

A lot of our tutorials here on The Pi start the same way – with a link to this one. That’s because a huge number of great Raspberry Pi projects start with installing Raspbian on the Raspberry Pi. Raspbian is the Raspberry Pi’s most popular operating system, a spin off of the Linux distribution Debian that works well on the Raspberry Pi’s hardware.

Raspbian is a competent and versatile operating system that gives your Raspberry Pi all the comforts of a PC: a command line, a browser, and tons of other programs. You can use a Raspberry Pi running Raspbian as a cheap and effective home computer, or you can use it as a springboard and turn your Raspberry Pi into any of countless other functional devices, from wireless access points to retro gaming machines. Here’s how to install Raspbian on the Raspberry Pi.



Do NOT follow this link or you will be banned from the site!