Category Archives: Programming

Voice-control RC sockets with Google’s AIY Project Kit

Issue 57 of the official MagPi magazine contains a Do-It-Yourself Artificial Intelligence kit made by Google. The build instructions inside issue 57 are straightforward, so that you can talk to an intelligent device within minutes.

However, the installation walk-through in the MagPi57 did not work without problems, therefore I recommend to follow the instructions on Google’s AIY Project Page.

Speech recognition is an amazing feature for the Pi and if you ever wanted to know what “the answer to life, the universe and everything ” is, you should go for it!

The kit turned out to be very popular and it is currently difficult to get hold on it. It is sold out at many places :-(.

Continue reading Voice-control RC sockets with Google’s AIY Project Kit

Monitoring air quality with a Nova PM2.5/PM10 Sensor and Python

It is a major problem in almost all large German cities, that fine particulate matter is frequently exceeding  its maximum permissible value of 50 μg/m3. In a special issue of the Make Magazine (IoT special 01/2017), I read an article about the Nova PM SDS011 sensor, which is using the principle of laser scattering to measure the concentration of particulate matter between 0.3 to 10 μm in the air. The sensor is cheap (about 20 Euro) and easy to use, since it communicates via serial connection.

For placing the sensor into an enclosure,  it is equipped with a nozzle that allows to connect a hose of max. 1 m length. The UART communication protocol requires a bit rate of 9600 baud, with 8 data bit, no parity and one stop bit.

Continue reading Monitoring air quality with a Nova PM2.5/PM10 Sensor and Python

Learning Banana Pi – New Book available!

A few month ago I’ve been invited by PACKT publishing to review a book about the Banana Pi. This book is for anyone who wants to explore Banana Pi and get started building projects on their own using it. No prior experience of working with single board computers is required.9309OS_Learning_20Banana_20Pi_This book will take you from opening your Banana Pi’s box for the first time all the way to working with hardware and code. The book is available from PACKT as ebook and paperback.

USBasp USB-Programmer Firmware update

I recently purchased a cheap USBasp clone (Made in China), originally developed by Thomas Fischl. It is an USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega88 or ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed.

IMG_6998No driver is needed under Linux in order to program Amtel chips. With the Arduino IDE, it is enough to connect +5V, GND, MISO, MOSI, SCK and RESET to the respective pins of the microcontroller. However, after uploading a sketch, avrdude complained about an outdated firmware version:

avrdude: warning: cannot set sck period. please check for usbasp firmware update

So I decided to attempt to update the firmware on the USBasp using one of my Arduino UNO boards as the programmer. There is a lot of confusing information on the web about how to do this, so here is what worked for me:

Continue reading USBasp USB-Programmer Firmware update

How to plot the frequency of PIR sensor events?

With a PIR sensor one can detect movements within it’s field of view and trigger other hardware, such as surveillance cameras. It is also possible to record the frequency of movements over time, e.g. to monitor motion activity in a room of your apartment.

pir_sensorWith a PIR sensor attached to my RasPi, I recorded motion events by storing UNIX timestamps in a single-column MySQL table. I wanted to visuaize these data points as a histogram displaying the frequency of motion events over time, but this task turned out to be more complicated than expected using GNUPlot. So here’s a short tutorial how it works:

Continue reading How to plot the frequency of PIR sensor events?