Author Archives: Dav Stott

About Dav Stott

Dav Stott is a 30-something computer systems engineer. When he's not getting carried away learning some whizzy new technology, he's taking photos of the things he's cooked up in the kitchen, learning about the world of whisky or out hill walking. Occasionally he writes about it.

Raspberry Pi – Controlling GPIO from the Web

Controlling a Raspberry Pi’s GPIO over the network

My web user interface controlling LEDs. Bottle of Octomore is optional, but recommended.

My web user interface controlling LEDs. Bottle of Octomore is optional, but recommended.

The first step in playing with a Raspberry Pi’s GPIO interface is to turn an LED on and off on command, the Hello World of digital electronics. As fun as that is, it would be more fun to do from my mobile phone using my home wireless network, this article runs through the software that I’ve used to do just that. I haven’t said that these techniques allow real-time web control of GPIO pins because they do not, but I get a response time of about 100ms using wireless ethernet with my Pi which does the job for me.

I’m going to be using Python, as it’s a very popular language on the Raspberry Pi, a bit of HTML and Javascript to provide the user interface and some linuxy goodness to glue it all together. There are many other ways of doing this, but this one is mine. I’m glossing over most of the hardware issues, so please be careful not to blow up your Pi.

Continue reading

Raspberry Pi Robot Tank Control Loop

When we last visited it, my Raspberry Pi Tank was able to be driven around in direct response to buttons being pressed on a web page. However, it could only drive ahead at full speed and wasn’t able to make decisions by itself, such as performing an emergency stop if its operator had just driven it into a wall.

I’ve started to address this with a couple of significant changes to my Python control script

Caution: this blog post includes some computer programs of dubious quality, which may bore or offend your sensibilities.

Continue reading