Jun 192017

Plug in a USB microphone

Increase mic volume for USB device to full using


Screenshot - 150617 - 11:14:09

(F6 to change to USB device and arrow keys move across to Mic and up arrow increases volume to full, Esc to quit)

Make a test recording:

arecord -D plughw:1,0 -f S16_LE test.wav

CTRL-C to quit

aplay test.wav

Sign up to Google cloud platform for free



Google Cloud Speech API -> go to Credenitials tab -> Create Credentials -> API Key -> cut and paste your API key for use in speechAnalyser.py later

sudo apt-get install mplayer

sudo apt-get install sox

sudo apt-get install flac

sudo apt-get install python-pycurl

sudo apt-get install python-pip

sudo pip install feedparser

sudo pip install yahoo-finance

search for stock/share symbols at https://uk.finance.yahoo.com/lookup/ and edit getShares.py to suit.
while in folder /home/pi pull ZIP file from our server with

wget www.securipi.co.uk/vr.zip

unzip vr.zip

chmod a+x speech.sh

edit speechAnalyser.py so it contains your Google Cloud Speech API key

nano speechAnalyser.py

save it and exit

run it while connected to the internet

python speechAnalyser.py

say the trigger word “oscar”, wait for a beep, and then say either “news, weather, shares, time, light on, light off, flatter me”

(light on & light off control a red LED with a 220 ohm resistor connected to GPIO4 and GND pins)

You can make a really good room mic, with 15 feet range, using a USB audio adapter and a MAX9812 amplified microphone (cost about £5 for both items on eBay)


You can download our 3D print case design from



Use a hot-glue gun to secure the boards in place.


With thanks to these web pages:


May 152017

Home Automation and Security projects book for Raspberry Pi


Our latest ebook is now available to download instantly in PDF format from www.trcomputers.co.uk and as a Kindle eBook from Amazon at https://www.amazon.co.uk/dp/B071LC88M1

You can download a Sample PDF


Chapter 1 – Wireless Doorbell project for under £20/$25.
We show you how to receive signals from a Lloytron MIP wireless doorbell push on your Pi, and have your Pi take a photo from a Raspberry Pi camera module, time & date stamp it, and email it to your phone. We also show you how to play a custom MP3 door chime sample when the doorbell is pressed – your doorbell can now be any MP3 sound you like. Also works with Lloytron MIP wireless door sensors, wireless PIRs and other generic wireless driveway alarms. We also show you how to take pictures from USB webcams, USB video capture devices, scan for Bluetooth & WiFi MAC addresses when the doorbell is pushed or sensor triggered.

Chapter 2 – Reverse-engineer 433MHz & 315MHz wireless gadgets using £10/$12 of hardware.
Learn how to receive/clone codes from remote controls and re-transmit signals to wireless remote control mains sockets, relays and light switches that operate at 433.92MHz (Europe) or 315MHz (North America) AM and use Manchester/OOK encoding using your Pi. Learn codes and then turn lights, relays and power sockets on and off at set times using Python. Control lights, relays, and power sockets from a web page on your phone or tablet. We also include a Python script that can capture a wireless code & replay it, or replay a different code with the same timing values, or a range of codes. (no more time wasted messing about with Audacity, Inspectrum, RTL-SDR, Baudline and GNU Radio).

Chapter 3 – How to control hardware from a web browser.
Learn how to use Apache web server on your Pi to interact with a web page on your phone. Contains Javascript/CGI and PHP examples. Turn an LED on and off from anywhere using two buttons on your phone’s web browser. Turn remote control mains sockets, lights and relays on and off from anywhere using buttons on your phone’s web browser.

Chapter 4 – Working with CCTV audio on your Pi.
Learn how to stream high quality CCTV audio from one place to another. We show you the best hardware to use.

Chapter 5 – Make a pan and tilt CCTV mount for your Raspberry Pi camera for around £12/$15.
We show you how to control two SG90 mini servos and a pan tilt bracket from your Raspberry Pi. Control the camera using graphical buttons and sliders on your Pi’s desktop. Stream video to VLC media player at remote location and control camera via SSH. Stream video to a remote web browser and remote control pan and tilt from same web browser window.

Mar 212017


To make this security camera project you’ll need:

  • Raspberry Pi Zero W
  • Raspberry Pi camera module
  • SG90 micro servo
  • Micro SD card with latest Raspbian Jessie
  • 3D printed bracket and base
  • 8x Nylon M2 nuts and bolts
  • 20x 2p coins to weight the base down

The STL files to print the brackets are at www.securipi.co.uk/twistcam.zip


and you can edit the original files at:




Before attaching the Raspberry Pi and camera to the 3D printed parts, it’s a good idea to do the following at the Desktop -> Preferences ->Raspberry Pi Configuration:

  • Enable SSH
  • Change passwords for Pi and Root users to something secure and hard to guess.
  • Enable the camera
  • Boot to CLI

Reboot the Pi and login to the terminal

sudo iwlist wlan0 scan

will show WiFi routers near your Pi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

and add these lines at the bottom, using your routers SSID name and password


Save the file, exit and reboot your Pi. It should now auto-attach to your wireless network when it boots up.

The servo wires can be soldered directly in place, or use a Pimoroni GPIO hammer header and cables instead.


Assemble all the parts together

We’re using the open-source ServoBlaster code to control the servo from the BASH command line.

We install it like this:

mkdir twistcam

cd twistcam

wget https://raw.githubusercontent.com/richardghirst/PiBits/master/ServoBlaster/user/servod.c

wget https://raw.githubusercontent.com/richardghirst/PiBits/master/ServoBlaster/user/Makefile

wget https://raw.githubusercontent.com/richardghirst/PiBits/master/ServoBlaster/user/init-script

wget https://raw.githubusercontent.com/richardghirst/PiBits/master/ServoBlaster/user/mailbox.c

wget https://raw.githubusercontent.com/richardghirst/PiBits/master/ServoBlaster/user/mailbox.h

make servod

sudo ./servod

Then test it’s working with:

echo 5=50% > /dev/servoblaster

echo 5=10% > /dev/servoblaster

echo 5=90% > /dev/servoblaster

The commands above move servo number 5 (Pan left & right) on GPIO23 between centre (50%),
left (10%) & right (90%) positions

Setup Video Streaming to a web browser.

On your Raspberry Pi, while in the twistcam folder we made earlier:

sudo apt-get install libav-tools git python3-picamera python3-ws4py

Download the zip file with:

wget http://www.securipi.co.uk/tcs.zip

unzip tcs.zip

chmod a+x *.sh

python3 server.py

Then go to another PC on your network and open a web browser to:



And you should be able to pan the camera left and right using the slider, with hardly any lag.


Disable the red LED on the camera.

When you’re streaming video, you might not want anyone to know when the camera is active. It’s possible to turn off the camera’s red activity LED by doing this:

sudo nano /boot/config.txt

And at the end of the file add the line


Save and reboot your Pi.

Mounting the twistcam upside down.

The Twistcam is designed to sit on a flat surface the right way up, but if you mount it upside down , hanging from a ceiling or shelf then the video will be upside down and the pan controls the wrong way around. You can fix it by downloading this patch and overwriting the original server.py file.

wget http://www.securipi.co.uk/server.py


Start video streaming automatically at boot.

Edit /etc/rc.local so that servod and python3 server.py launch at startup.

nano /etc/rc.local

Insert these lines before the last line which says exit 0

cd /home/pi/twistcam
sudo ./servod
python3 server.py

Save the file and reboot your Pi. Video feed can be controlled from PC or phone.


If you don’t have access to a 3D printer, you can buy the two 3D printed brackets and 8x nylon M2 nuts and bolts here for £11.99 inc VAT.

(Raspberry Pi, Camera and SG90 servo NOT included)

Quantity :


We ship worldwide. Next day delivery in UK and 14 days for delivery worldwide.

Feb 132016

Simple LED and switch project for Redfern Crumble board

This project uses:

1x Red LED

1x Push button switch

1x 270 ohm resistor

4x DuPont cables or croc-clip leads


flat short-legged side of the LED connects to the resistor & black wire.

resistor can be 220 ohm if you don’t have any 270 ohm.

The Crumble program waits until the button is pushed and turns the LED on for 5 seconds, then turns it off.


You program the Crumble by dragging blocks across from the left to the right

Try changing the program so the light only stays on for two seconds. Try changing the program so the LED flashes on and off twice.

Here’s how we power the Crumble


we soldered pin posts onto our Crumble board so we can use standard Arduino breadboard cables with it.

the Crumble board is sat on our 3D printed holder, which you can download from securipi.co.uk/crumble_crib.stl

Feb 092016

PocketPi is a portable Raspberry Pi Zero with a 5600mAh rechargeable battery and 4 port hub that you assemble yourself.


all combined into a 3D printed custom case that measures just 92mm x 42mm x 25mm & looks like this when complete


the boards are soldered together like this


and fit into the case like this


you use a hot-glue gun to fix the parts in place

full instructions can be found in our PDF, including buying links for each part here:

and here’s the STL file for 3D printing your own case and lid

You can edit the design of the case to add your own tweaks here:



If you like this post please follow @securipi on Twitter