Skip to main content


Showing posts from 2014

Raspberry Pi + PiFace Digital : automatically detects loss of connectivity and reboots Gateway Router (cron job)

The problem:
I have a buggy 4G LTE router (a ZTE MF29 used with Airtel 4G here in Pune, India) which hangs around thrice a week causing loss of connectivity until it is rebooted manually by toggling the power button on its back. I cannot get the 4G LTE router exchanged - I am stuck with it. And there hasn't been any firmware updates, neither does it have any option for rebooting using its webpage based management console. So I have to climb up to the small loft where I have kept my network equipment and manually toggle the power switch on the back side of the router.

The problem is compounded by the fact that I have setup a wired LAN between 2 more apartments in my building complex. Three of us friends bought flats in this building together and we had the foresight to ask the builder to run lengths of CAT5e cables through the concealed wiring pipes between our houses. This allowed us to create our own LAN and have a common internet connection.
Now when the Gateway router threw a f…

Contest Buzzer System (by re-purposing Sparkfun's Arduino based 7 Segment Serial Display)

Quiz contest's are one of the most fun ways to learn things in a group. Throw in a buzzer system and you have sense of urgency, excitement and teamwork surging through the various teams.

Couple of years ago (in 2006) - before Arduino or microcontrollers - me and Ranjit assembled a parallel port based buzzer system. We had 5 buzzers for upto 5 teams - we used the 5 Status pins (nACK, Busy, Paper Out, Select and nError) of the parallel port to read the status of the switches. The project lasted us a long time - till the time they stopped equipping laptops with parallel ports!
Some of the features of this system were:

Use of bell switches as buzzers. the spring action, brings the switches back to off position.Use of microphone coaxial cables - these sturdy yet flexible cables are designed to be stepped upon and still last long!Use of RCA connector to attach and detach buzzers - essential because we were using coaxial cablesPull up resistors to make sure the status pins idled at logic…

Replacing the current sense resistor in Portable Chargers/Power Banks for powering low power DIY projects.

Mobile Phone/Tablet charging Power Banks can be used to power so many DIY projects. But if your project is low power and draws very little current, the power bank will auto turn off after a few seconds thinking that it isn't being used to charge gadget (because the current draw is very low). I need to figure out a way to hack one and locate and replace the current sense resistor with one of a higher value. Here is how I did it.

This told me that the resistor would be located on the return path (ground path) of the output USB connector. I promptly located the R100 SMD resistor in my iBall portable charger. The fact that this resistor was fatter (higher power dissipation rating) and that it was 0.1 ohms in value confirmed that this had to be the current sense resistorI measured the voltage across it when nothing was connected. It was zero volts and the portable charger turned off in a few seconds when nothing was being charged.I then turned on the charger back again and this time m…

Using Raspberry Pi with a Digital Projector in a Teach For India classroom

I am a TeachForIndia fellow now and have been teaching at a low income school in Pune. The school is named Kilbil Public School (kilbil is Marathi for "chattering") and I teach Maths and Geography to 3 classes of 7th Graders. We are a team of 3 TFI Fellows, the other two teach English, Science and History/Civics. We have a facebook page here. The first thing I did is to ask all of my close friend to contribute money to help me buy a digital projector. The idea was that if we are  to use Inquiry-based learning for Geography, History/Civics and Science, we would need to hook the students attention by showing them images and youtube videos. So here's what I got for my setup:


BenQ MS521p DLP Projector with HDMI Input and Analog Stereo output. This cost Rs. 30,000 from Flipkart. My friends contributed hard cash (and Flipkart vouchers - which cannot be bought using international credit cards) for this. Recently I have ordered another projector, so now the two new BenQ…

Using USB car charger for powering your projects

Most car chargers available sport a MC34063 based DC-DC converter to step down 12 volts to 5 volts.

Such chargers can be used to derive 5 volts from 12 volt power supplies/lead acid batteries while constructing projects.

Using Netlink to post events from kernelspace to userspace

I have been working on an older version of Linux on which I wanted to use netlink as a way to post events from kernelspace to userspace. I wanted to avoid using Netlink Protocol Library Suite (libnl) so that I could delve deeper into netlink and have better control of what I am doing. I was already successful in using Generic Netlink Sockets to perform two way request-response communication between kernelspace and userspace. This time I referred ACPI daemon 1.0.10's source and used genlmsg_multicast() to post events from the kernel side. The implementation of netlink has evolved over time and the following code ought to work only on kernels versioned around 2.6.35 (I tested my code on Ubuntu 10.10)

Source Code Organization:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 …