Toddler-proofing an Android tablet – wireless charging (inductive) and ruggedisation

Ruggedising a Generic Android Tablet

This project looks at ruggedising (the act of making something more rugged, resistant to shocks and resistant to liquids) an Android tablet so that it can be safely left with a toddler (3 years +). This gives you a fully functioning Android ruggedised/toddler-proof tablet for around €100 as opposed the specialised ones you can buy for that price and up and are usually limited in terms of the software and media you can put on it (also games and other software can be in the region of €30 for each application on top of the original hardware cost). This makes this hack both a cost saving and provides a more flexible software platform that can adapt to your child’s needs as they grow.

Read more

Adding web connectivity (via USB ) to remote controlled sockets – Part 2 (software)

This project page provides a guide to adding both USB and a Web based User Interface (UI) to remote control socket set. Through the process we will unlock even more capabilities than are available when you use the socket set as they were originally intended. Part 1 deals with the hardware, Part 2 (this post) deals with programming the chip and Web UI.

The main components are:

  • Arduino (or other AVR-MK2 programmer)
  • Web-server (I used a Raspberry pi, but any computer will work if it’s running Apache and PHP)
  • Lego (if you want to make a Raspberry pi case)


Okay, first step is to program the AT Mega 8 chip.

I don’t have a AVR-MK2 programmer like [befinitiv], but I do have a number of Arduino boards. There are a number of ways to program an AT Mega 8 with an Arduino, but the most successful method I have found is to  use mega-isp code for Arduino.  A very good tutorial can be found at [].  Upload mega-isp onto your Arduino.

programming an atmega8 with arduino mega-isp

mega-isp: programming an atmega8 with arduino from [web archive –]

If you would like to program the chip before you have soldered it all together, follow the instructions above. If you have the hardware already assembled use the programming cable (purple, grey, white, black)  that sticks out the of the remote control at the end of the first tutorial (see image below).

In this case the purple is reset (Arduino pin 10), grey  (Arduino pin 13), white  (Arduino pin 12), black  (Arduino pin 11).

Using a Linux machine with avrdude installed run the following command in the terminal

$ avrdude -p atmega8 -c avrisp -P /dev/ttyUSB0 -b 19200 -U lfuse:w:0xe4:m -U hfuse:w:0xda:m

This is a combination of the standard setup for mega-isp and setting the fuses as done by [befinitiv]. The ttyUSB0 in the code above is the Arduino, so this may need to be changed, but if you unplug all USB peripherals and plug in the Arduino first it should be ttyUSB0.

  • Plug in the remote control and hook up to the Arduino as mentioned above.
  • Now download the code from my gitHub repository.
  • Navigate to the folder “remote_controlled_socket” in the terminal.
  • Run make.
  • Now run make program

The code above largely builds on the code provided by [befinitiv], but adds extra support for up to 15 devices and adds channel selection to the mix.

Okay, now we have the remote all set up it’s time to set up the web based control. Essentially what we need here is a basic web server running PHP. Place the files from the “SerialPowerControl-web” folder on the server. As I’m running a Linux server so I have to alter the dialout group settings to allow the PHP script to communicate over the USB.

$ sudo pico /etc/group

-> add “,www-data” to end of dialout:x:***  (without quotes)

Now I’m using a Raspberry Pi as my server (as it’s a really cheap, low power and tiny computer) and I encountered a slight problem as the Apache server isn’t configured properly, to resolve the issue you need to do the following:

$ sudo groupadd www-data

$ sudo usermod -a -G www-data www-data

$ apt-get install php5-common libapache2-mod-php5 php5-cli
after installation, then restart Apache:
$ sudo service apache2 restart

If eveything is successful you should end up with the interface as shown below (point the browser to the server location of the power scripts) and once the remote is plugged into the servers USB port (make sure it’s the first USB device plugged in, so that it becomes ttyUSB0). This was easily thrown together using PHP and the jQtouch library meaning it will work in any Webkit Browser (Chrome, Safari, iOS and Android), it still works in Firefox, but loses it’s visual appeal.

Power User Interface

Feel free to edit the scripts on the server so that the text reflects your own set up. You can add more devices (up to 15 per channel), events or change the default channel (the check boxes at the bottom of the image above, there are 32 possible channels). Check out the README file that comes with the scripts for the mapping of device numbers and the settings on the sockets (4-bit code). Let me know in the comments how you get along, the changes you make, or the issues you encounter.

I think one of the next steps is to try and add manual control to the sockets, there is no switch on the socket itself. You can of course use the wall socket switch if available, but this completely disables the remote feature. I also have one socket circuit embedded in the light switch for the main room lights, again the actual switch will turn off the lights but also disables the remote feature. So the new feature will have to allow for manual control without disabling the remote feature.


Read more

Adding web connectivity (via USB) to remote controlled sockets – Part 1 (hardware)

This project page provides a guide to adding both USB and a Web based User Interface (UI) to remote control socket set. In the process we will unlock even more capabilities than are available when you use the socket set as they were originally intended. Part 1 (this post) deals with the hardware, Part 2 deals with programming the chip and Web UI.

It essentially builds upon this blog  by [befinitiv]

Radio controlled sockets are a great way to save power in your home. Devices consuming more power on standby than the sockets do can easily be switched off with a remote. For example my desk lamp from a swedish furniture store consumes 10x more power (in the off state) than a radio controlled socket.

Even if the sockets consume more power in standby than the attached electronic device, they offer the luxury of turning stuff off and on without even moving. In short: They are really handy.

However, if you’ve installed the sockets, one sentence will often reoccur: Where the f*** is my remote?

The goal of this post is to show you a way of adding USB support to remote controlled sockets. This opens up a whole new world to remote controlled sockets. Plug this kind of remote into a computer and you can do amazing things.

This gives a pretty good justification for doing this, plus I wanted a worthwhile project to learn a little about programming standalone AT Megas (most of my experience has been with Arduino and PicAxe  to date). The main difference here is that I thought I could improve on the system by adding a Web UI to the mix (now I can control it from any device that has a web browser) and that I use a slightly different model of remote.

The main components are:

remote opened

remote circuit

So you may (or not) have noticed that I have ordered different sockets to those used by [befinitiv] in his guide, the reason for this is that I live in Ireland and the sockets he was using have a European connection. When I opened the remote I noticed that the encoder used was different to the one in  [befinitiv]’s  guide (SC5262 chip datasheet), my heart sank a little. Thankfully I found the datasheet for the HX2262 (datasheet) and it turns out to be identical, so crisis averted!

As [befinitiv] mentions the CA-42 Cable is used because it contains a serial to USB chip. I was happy to pick a few of these cables cheap from Meritline, but after opening them up I found that they were missing the power line (3 core rather than 4), so I swapped out that cable for a 4 core cable, I then found that the voltage on the on the other end was not as high as would be expected (about 3.2v rather than closer to 5v), this low voltage wouldn’t keep the atmega8 powered.  I figured it might be the traces on the PCB were so small they were creating extra resistance. Once I bypassed the PCB traces and went directly from the cable to the USB plug all was fine (see below). You can also see that the TX is hooked up to the green cable and the RX (not really used in this guide) is hooked up to the white cable.

Once that’s sorted it’s time to start wiring things up. There are differences in which pins are used on[befinitiv]’s remote and the ones that I acquired , but after some testing, the relevant pins were identified. It’s handy to have the ATMEGA8 datasheet. So starting with the  ATMEGA8 start wiring it up as you see below (I decided to go with some vero board rather than ‘dead bug’ it like [befinitiv]). Don’t solder  the USB up just yet, we will wait until last as you will want to feed the cable through a whole in the casing before you solder it to the chip.  Note the purple, grey, white and black cable coming from the bottom, this is the cable we will use to program the chip.

ATMEGA8 wiring diagram

Then on the front of the remote board (see below) remove the 5 SMD (surface mount device) components highlighted red and connect up teh wires as shown (the green highlights show no connection on this side).

Remote Control Board , Front

Similarly on the back of the remote board remove the DIP switch (the big red block in the first images) and wire it up as shown.


Now to fit it all back into the case. Using a pliers snap away the casing that surrounds the buttons (see below). It seemed to come off rather cleanly for me.remove part of the casing


Then make a  hole (drill or melt) in the casing to pass the USB cable through, make a small knot in the USB cable to put around the small post in the casing (see below) in order to stop any tension on the cable damaging any of your connection, then solder up the USB connection to the ATMEGA8. You can see here the complete assembly before we put it back in the casing (again note the programming cable at the bottom).

So now close it up and it should look something like this…

Now we are ready to start programming… See Part 2

Read more

New Site

Under Construction…

"Under Construction", "Railway Construction"

 Making Tracks