Koch Snowflake and the Thue-Morse Sequence

When you first study recursion, you will invariably run into a “factorial” example. But if you are lucky, you will also run into a far more interesting algorithm – one that draws a fractal geometry construct called the “Koch snowflake”. This curve was discovered in 1904 by Swedish mathematician Helge von Koch [1]. Drawing this curve is straightforward, and we will do so using Python turtle graphics. But this curve also has a deeper connection with a mathematical sequence called the Thue-Morse sequence [2], which we will explore in a bit.

Continue reading

Talking to DHT11 Humidity & Temperature Sensor


I am working on a “weather monitor” project that involves a Raspberry Pi taking to a DHT11 Humidity and Temperature sensor and serving up the collected data as a graph, over a web page. So, I wanted to first get an idea about how this sensor works.

The DHT11 is designed to work with a microcontroller, but we can coax it to send data with a simple circuit, as shown above.

Continue reading

A 48 LQFP to DIP adapter PCB


I have been looking at prototyping with some ARM Cortex M4 chips, and many of them use a 48 pin LQFP packaging. Sadly, I haven’t been able to find a decent 48 LQFP to DIP adapter PCB in India. The only one I saw was expensive and designed in a crazy way (4 sets of orthogonal pins) which made it useless for breadboard prototyping. So I decide to create one of my own.

Continue reading

Getting started with ATtiny85 (AVR Programming)


I just got the batch of ATtiny85s I ordered for some pals at a local Maker group. I have articles here on ATtiny84, but not on this chip. So here are some quick notes on getting started with the ATtiny85.

The first thing you need to program the chip is an AVR programmer. I am using a Pocket AVR Programmer from Sparkfun. But you can buy much cheaper programmers. Look for USBtiny programmers – in India you can get one of these for about Rs. 350 from

Continue reading

A Simple Python to Arduino Alert Scheme


My friend asked me the following yesterday:

“Is it possible to make the build script at my company flash some lights when it fails?”

I gave her some suggestions which involved the usual suspects – Python and Arduino. Now it’s all up to you, I said. But soon, I started fidgeting, and I can’t help it. I need to try this myself. ;-)

Continue reading

A Makeshift Tilt-Head for my Raspberry Pi Camera


I want a pan/tilt scheme for the camera of my Raspberry Pi based home monitor robot. But rather than use a pan/tilt bracket with two servos, I thought I could simplify things by using one servo for titling the camera and using the robot chassis swivel to pan the camera.

Continue reading

Ultrasonic sensor HC-SR04 with Dagu Mini Driver on a Robot Chassis


I am working on a Raspberry Pi based robot, and recently acquired a Dagu chassis and a Dagu Mini Driver for this project. As soon as I had the mini driver hooked up and the wheels starts turning, I felt an irresistible urge ;-) to put an ultrasonic sensor on the chassis and have it roam around by itself.

Continue reading