ATMega Uploader with an LCD – Objective and Progress (Part 1)

An exciting use case for Arduino is to upload a program from an SD card to a chip using another Arduino . This would be useful for quickly updating many microcontrollers in a field, or in places where a computer is not accessible. Nick Gammon came up with a solution to this problem with his ATMega Uploader. To paraphrase from the website,

This project is intended to allow you to program your Atmega chips without having to buy a dedicated ICSP programmer. Instead, it uses a Uno (or similar) board to act as a programmer.

However, a drawback of the uploader is that it works over a serial monitor. This immediately removes the advantage of not having to carry a computer around as you update a microcontroller. I decided to try and solve this by integrating an LCD, and building a navigation interface to easily use the awesome project that Nick Gammon built over a GUI.

Now Gammon’s file uploader project includes a few different types of utilities including a board detector, a hex uploader etc. It would be convenient if there was a way to switch between these different utilities to test different things on the field. However, all the sketches don’t fit inside a single file, so there would be a need to actively switch between different sketches. I decided to try and boot different files from the SD Card for this purpose. To do this, I’m using AVR Boot.

The Objectives

  1. Create a rough interface to navigate through the ATMega File Uploader and other ATMega Utilities. Errors don’t need to be complete explanations and extensive debugging can still be done better with a computer.
  2. Use the SDFat library to move around the right files when you want to change the program being used.

Current Progress

As of writing this article, I’ve completed a rough integration of the LCD with the ATMega Hex Uploader, and begun the integration with the ATMega Board Programmer. Real-time updates can be viewed at the Github page.


The unKnocki – DIY Kickstarter Clones Part 1

The Knocki is a device that released on Kickstarter a while back and has (as of writing this article) received over half a million dollars in funding. The premise behind the Knocki is that it allows us to access different functions around the house using knocks on different surfaces. The Knocki is meant to be something that uses the context of the location to enable intuitive functions, for example knocking on your bedside table in the morning should turn off your alarm, or knocking on your kitchen counter should turn the microwave on. The idea is to reengage ourselves with technology in a more tactile way. Everything sounds good, right?

Not so much. While the idea is terrific, each Knocki costs $69 (at the Kickstarted super-early bird price) and will probably cost almost $100 at retail. The biggest issue with this is it limits someone who doesn’t have $300-$400 of spare cash to a single Knocki (atmost). But a single Knocki cannot deliver the full experience of connecting with technology around the house in a tactile manner. So my friend and I decided to create a DIY version of the Knocki that works just as well, but costs much less. The end product of our design (with miniaturization taken into account) cost approximately $70 for 3 “unKnocki’s” all costs taken into account. Adding each unKnocki only requires $8-$10 because we only add a transmitter module and use a common command center. For those of you interested in building your own, view the full instructable here.

We faced a number of challenges in the week or so that it took us to build the unKnocki. The first aspect we had to design was the detection of the knock. It seemed simple enough to detect one knock using a Piezo Buzzer and the Arduino, using the tutorial on the Arduino website itself! However detecting multiple knocks was slightly harder. Our first approach was to send all the serial data to python and then log the time difference between consecutive peaks. However due to serial connection issues (and other problems we simply didn’t understand) we ditched that idea. In the end, it was a simple “while loop” that ended up working, although it took us nearly 4 hours of work before this (obvious) fact dawned on us.

The second problem we ran into was the transmission of data. Our first idea was to use the 433 MHz radio to send the number of knocks from each transmitter directly to the Raspberry Pi. We tried this at first and were able to get the RFSniffer code from the 433Utils detecting the radio signals, albeit on the Linux terminal. No matter what we tried (which included VirtualWire, pi-switch-python, wrappers for RFSniffer, external libraries), we weren’t able to output this data to a python file for further processing. While this is something I would still love to do, we decided to move on to a simpler solution of having an Arduino connected to the Pi deliver data through the Serial port. This worked like a charm, and ticked another box off our list.

We also made a slight coding mishap in our initial code. We were using the Arduino millis() function to get the current time and store it as an integer to determine the time between knocks. However the program often stopped working after 2 to 3 minutes, because of an integer overflow issue i.e. the integer was no longer able to hold the value of the millis() function. We switched the variable over to an unsigned long which gives us approximately 50 days of runtime before any errors pop up.

The next issue was relatively minor – finding the right IFTTT channel to use for triggering events. We started off with Twitter, which had a 30 second delay between the knock and the event on the phone. We then used the Pi to send a Telegram message which was delivered almost as soon as the table was knocked. However Telegram was not compatible with IFTTT. We finally saw the solution in the form of the Maker Channel for IFTTT, which lets you make PHP requests to trigger actions. This was exactly what we needed!

And that’s it. A weeks work, summarized in four paragraphs and one instructable.

We are not saying a DIY solution is necessarily better than the Knocki. For the average person who may not be interested in electronics, the Knocki is a convenient easy way to get started. We simply offer a much cheaper solution with immense applicability due to our integration with IFTTT. All hail the unKnocki!

The Sunrise Alarm Clock

Ever woken up in the morning, looked at your alarm clock, and wished you’d woken up about 5 hours earlier? I know I have. As one of the dreamiest sleepers in the world, I have not found a single alarm clock (or a combination of them) that has ever been loud enough to wake me up permanently. Thus, this project. This project started with an article I read about how “dawn-simulating” clocks are far more effective at waking people up than just regular alarm clocks. So I thought, why not build one? And then I got started.

Its finally done. Undoubtedly one of my most gruesome and excruciating builds, this clock put all my skills to the test and forced me to learn a lot about electronics. But at the end of it all, I think I have a decent alarm clock, that is for me, the first time I have been able to wake up on time. Check out the complete instructable here!

Update: While the alarm clock did work well, I had received some criticism that said that the project did not look very nice. A few people rightly said that the way I had painted my wood had made all the imperfections stand out in it. While experimenting with different finishes, I came across a sheet of card stock. I used this to finish my project by printing a large sheet of card stock black, and then using it as a laminate to cover all sides of my project. Unexpectedly, the LEDs turned out looking quite nice inside the card stock, and I think the entire project has an improved look. Let me know what you think!


For the extra code that I promised on my instructable, here it is!

Continue reading “The Sunrise Alarm Clock”

LEDing the way to A Better Future

With an energy crisis looming over the world, we tried to make the situation better by improving the efficiency of something as basic as lighting.  This project harnesses the fact that the human sees light blinking rapidly enough as a still light. This principle was applied to 10Watt LEDs used for room lighting.

A microcontroller was used to switch LEDs on and off very quickly. Power consumption of the LEDs was predicted for different combinations of on-off times for the LEDs. We hypothesised that perceived brightness wouldn’t change because the LEDs were off for a short time-period. Experiments were conducted with the LED for 1 millisecond(ms) on, 1ms off; until 1ms on, 12ms off. This was repeated for on times from 2-8ms. The power consumption and brightness of the LEDs were measured for all combinations. Power consumption of the LEDs reduced drastically. Contrary to the hypothesis, the brightness also reduced in combinations with longer LED off times (Click on graphs for clear images)


3 efficient on-off combinations were identified in 3 categories – low, medium and high brightness.  They produced 42%, 20% and 18% respectively greater brightness per watt consumed than non-blinking LEDs.

Incandescent lamps account for 25% of power consumption in lighting. They consume 6563 terawatt-hours annually. Replacing these with non-blinking LEDs results in a saving of 4923 terawatt-hours! If blinking LEDs are used, there would be an additional 328 terawatt-hours of power saved (assuming minimum efficiency), more than Germany’s annual power consumption!

As always, to view the entire project, click here. Cheers!




A project by – Raghav Anand, Rahul GS and Aniroodh Ravikumar

Descending Dreams

Air Conditioners (A/C) use roughly 1 trillion kWh of power annually. The project seeks to reduce power consumption of A/Cs. The proposal is a movable false ceiling. It will be lowered when the occupant is sleeping to reduce the volume of the room allowing the A/Cs to cool faster. The question which had to be addressed was ‘How much will reducing the volume of the room at night using a movable false roof, reduce power consumed by air conditioners?’ The hypothesis was that there was a relation between the time taken to cool the room and its volume.

The experiment tested energy savings by using a high power A/C to cool a smaller volume. Two boxes of thermocol were built, simulating a room. The first box represented the original volume of the room. The second box’s volume was adjustable. 4 tests were conducted, changing the output temperature on the A/C and the volume of the second box in each test.

All the tests pointed to two important results:

  1. The lower the volume, the greater the energy savingThere was an average power saving of 0.14 kWh/hour translating into a 14% reduction in power consumption.
  2. The lower the A/C output temperature the greater the energy saving.

Large scale implementation of such a device will result in massive energy savings worldwide. In an escalating electricity cost scenario, this device can help households to reduce power costs without compromising on comfort.

To view the entire project report, please click here. Cheers!

A Project by – Raghav Anand and Rahul GS

The Steporama (A working title)

This project evolved out of an old weak stepper motor that I had laying around. I first tried to create a robotic arm with the stepper motor. The motor was barely able to lift the arm, let alone an external load.Then I tried to build a 3d printer with the stepper. Clearly I wasn’t thinking straight – the stepper couldn’t lift thermocol and I wanted it to print objects in 3D. Not too smart.

The end of this project was to attach the stepper to an ATMega328 with a ULN2003 darlington array and just keep making it spin around. I used the stock stepper code on the arduino website and used my Leonardo to program the ATMega. The only use I found for it was to create a panaroma capture device. However, as whimsical as it might sound, it genuinely does take better photos than a handheld device. Enjoy!


The Name Lamp

My first woodworking post here! And its actually something I made quite a while back, but never really got around posting plans for. This is a really simple custom table lamp you can make in very little time and also one which doubles up as a USB charger. The only power tool you’ll need is a drill!

Parts Required

  1. Drill
  2. 1/2″ wood – 30″ x 5″ (You won’t get wood this size, but this is all the half inch ply you need for this project)
  3. 1/4″ wood – 10″ x 5″ (The same for this as well, you can use scrap wood if you have some laying around)
  4. A USB charger
  5.  Wire
  6. A bulb holder
  7. A small LED bulb
  8. Glue
  9. Female and male AC plug


  • Cut 3 pieces of 10″ x 5″ wood (two from the half inch and one from the quarter inch)
  • Like the template below, draw up a scaled version of of the text and place holes in roughly the positions of the text. The holes shouldn’t be too close, otherwise the drill bit will keep slipping into the adjacent hole (unless you have a drill press, which I don’t). It doesn’t matter if the text doesn’t look readable, it was the same for me, but it takes shape better in the wood.
The front of the box. The holes signify drill points
The front of the box. The holes signify drill points
  • On the piece of 1/4″ plywood, make a hole roughly the size of a usb port. Use a cable to measure it out.
The top of the box
The top of the box
  •  For the side pieces, cut out 5″x5″ pieces of 1/2″ plywood.
  • Now, mount the bulb holder on one of the side pieces. Make sure you mount it at the centre of the piece so that the top piece can fit on well.
  • Now, mount the usb device so that it is aligned with the hole made previously. In case your charger has a curved edge (like mine did), find a corner to mount the usb charger. Then use a USB female connector to extend the charging port.
  • Finally, wire up the AC plug to the bulb and use the female AC plug to the USB charger.
  • Glue the entire thing in place! This is the boring part – waiting for that glue to dry so that you can look at your beautiful creation.
  • After its dried, I suggest you use a stain to make the plywood look nice. I used paint, and it just hides the grain of the wood completely.

Here’s the one I made for my sister!

IMG_0092 IMG_0092 IMG_0094