Internet of Things and Hardware Hacking (Part 1) -A Web Controlled LED Digit Display

Posted by:


This was the very first project RLM, Limdo and I did about a few month ago – a very simple project which covers the whole nine yards of internet of things, from basic concept to final implementation. I have been so intrigued by the wonder of electronics and programming world ever since.

The task of this project is to: 1) use Arduino to control 13 LEDs for a digit display, 2) and remotely control it from web.

The Arduino Sketch Code and LED Digit Display Wiring

First the wiring and Fritzing Drawing:


We were using just one resistor for all 13 LEDs, ideally each LED should coupled with one discrete resistor.

and, the arduino sketch code is following:

At this point, you should be able to control the digit display from Serial Monitor or a python script as following:

The Python CGI Script to Control Arduino (Python Serial Needed!)

You will need to setup python CGI in Apache or Httpd webserver for this to work. This was tested in both cases. RLM did this via perl CGI intially , see his post here.

The Website

This is a over-kill for the proof of concept purpose. I got carried away by jQuery and ajax. Following is what it looks like.


As shown above, the radio button on top pick the 9 digit of choice, the selection was passed to Arduino via ( POST method) Python Script triggered by Set Display button click.

Up to this point, the purpose of this project is fully accomplished. I went a step further to add a visual display of the LED digit just for fun, which is shown in lower part of the web site.

The html body:

The jQuery javascript and ajax section. Note that ajax is needed in order to post html feedback back to parent page #p1 or it will be directed to a new page.

plus some css styling:

See the video recording from RLM post.

  Related Posts

Add a Comment