July 2014

Physical Buttons For iOS Simulator

When testing iPhone/iPad apps in iOS Simulator, you will sometimes need to press the ‘Home’ button, lock button & screen shots etc… This is quite easy with the drop down menu or keyboard shortcuts. But thats still to hard for me having to learn a keyboard shortcuts with three buttons, thats absurd!

So I created this quick and dirty solution, using spare parts and a Adafruit Trinket

The Trinket makes it really easy to create a simple keyboard, (using V-USB) However this only leaves you with 3 IO but this is enough for my project.

June 2014

I needed a new lock for my tool cupboards, but I don’t like keys. How about the finger print reader on my phone?

Using the Adafruit Bluetooth LE breakout I was able to build a simple to use keyless locking system for two tool cupboards.

I used lock-style solenoid for securing the doors, and also added a capacitive sensor to each door handle, when you touch the door handle the lock is driven ‘open’, this way the solenoid does not run all day (if I leave it unlocked all day)

External image

After connecting to the lock you can lock or enter 'touch’ mode, in 'touch’ mode if you touch any of the door handles the solenoid will turn on for one second allowing you to open the door. I have also added manual control buttons for each lock.

On the Software end it quite simple security through obscurity, each button just sends a single character over serial to the Arduino. To save writing an iPhone app from scratch I simply 'skinned’ the Adafruit app, replacing the terminal window with buttons that send corresponding characters.

February 2013

I need the ability to wirelessly take photos, however my camera did not have a conventional shutter release, it has the old fashioned "cable" release.

External image

After playing around and buying some cheap cable releases off Ebay I was able to build a working wireless shutter using an Arduino, Servo, and a cheap wireless shutter for a Canon DSLR.

External image

I had thought of using an IR remote however I am planing on using this outside and im not sure how well IR works in direct sunlight. So I went for an RF option.

External image

These remotes have the half press focus option, but as I would not be needing this, and when you bend the wire cable it changes the length of the “press” meaning that it would not always work. To make it more reliable it only takes photos without focusing but as I am going to be using manual focus its not a problem.

External image

I mounted a servo in a small enclosure and pushes on the cable firing the camera shutter.

External image

The servo is controlled by and Arduino that triggers the servo when it gets the command from the wireless remote.

Pin 13 of the Arduino was wired via a transistor to the power button of the wireless shutter receiver, this way when the power was turned on the Arduino would power on the receiver automatically.

The wireless shutter has a “double press” button, a half press would focus a normal camera and a full press would take a photo. There are three wires coming from the receiver, “Ground” “Focus” “Shoot”.

Ground is connected to the Arduino ground, “Focus” connected to pin 12, and Shoot Connected to pin 11 and the servo is connected to pin 10.

The cell phones at my work are so bad, that when I was given an old 1992 “Brick” Mobile Phone, I thought that using a 20 year old phone might be the best way to get them upgraded. It needed to be useable, to make and receive calls, also send and receive text messages and use the phone book. They were so bad the bench mark wasn't very high.

I thought about imbedding a cheap cell phone inside (like with my rotary phone project) but it was more elegant and easier to start from scratch, build my own PCB and program.

Old phones are analog so they obviously dont work on the new digital GSM networks. After doing some investigations I found the small breakout for sim900 gsm module it was small enough to fit inside the cellphone, and easy to work with, using “AT commands" over serial.

There was an old 7 digit, 7 segment display but using that would have made it too difficult to send and receive texts. So I replaced it with a modern OLED Screen (Adafruit 128x32 OLED) that would fit in the small display window provided. (unfortunately I could not get good photo of the screen working)

External image

The only other DIY cellphone I found was from High-Low Tech, I used there code as a starting point, however there code could not do texting etc or work with any of my hardware, it was very basic and only displayed and dialed the numbers, so a a lot of work needed to make a usable phone.

External image

The next problem was using serial to comunicate with the Sim900 chip, Arduino (atmega 328) chips only have 2k of ram making it very difficult for a noobie programer. I had so meny serial read/writes it would fill up the ram and crash the phone.

This problem was solved by using two 328 chips, the main chip handles keypad input, graphics, coms to GSM chip, and the second chip handles all sounds (ring tones/ text tones/ buttons pushes) and would detect when the phone is ringing/incoming text and alert the master chip.

External image

Communication between the two chips was done with outputs/inputs that would be driven low or high as needed. The Sim900 also has outputs that are driven low for 1200ms upon incoming text, or low while the phone is ringing. The second chip would decipher if its a text or call and tell the master, it would then make the appropriate sound.

The hardest part was trying to get text message input (eg if you press "2” three times the letter “c” would be displayed) I could not find any good solutions for this online, that worked with a matrix number pad, so I wrote my own.

External image

I wanted the phone to look “stock” so I designed a PCB that matched the original PCB in Eagle. I also had to design a custom resistive push button for the keypad and painted restive ink onto the original rubber buttons.

External image

To get everything to fit I had to use surface mount Arduino chips, however I could not find surface mount 328 chips that had the Arduino boot-loader. This was solved by designing an Arduino Shield that programed surface mount chips, you simply hold or clap the surface mount chip down and use the built-in Arduino ISP to program.

External image

Finally the battery, I had to cut open and remove the old battery from its case, easier said than done. I then mounted a 7.2v lipo battery inside and drilled a hole for the charging cable (on the inside so it cant be seen when the battery is on)

External image

The old phone also had the wrong analog antena, it was replaced with a new 900mhz GSM antena, I made sure it was nice and large to fit with the retro look.

External image

It actually works, beter than our phones at work. I have been using it for some time now, the only hard part is trying to find a pocket big enough to put it in.

In version 2.0 I would use all surface mount components including the sim900, and improve the battery design. I would also replace the 328 chips with bigger more powerful one, so I could add features like Tweeting.

November 2012

I really liked the idea of controlling my “Home Theatre” lights with a remote (TV or other), this would save me the exhausting task of heaving myself off the couch to turn the lights on or off.

I found one of my remotes has a spare power button, its one of those stupid “universal” remotes that comes with DVD players or TVs but only work if you have all the same brand equipment, I don’t so this made a good option for a light switch.

External image

Next was receiving the command and switching the lights on/off, again this was made very simple using the Adafruitcode and instructions on IR commands, I recorded the IR command and modified the Adafruit code to suit. I also needed the wall switch to work as well, this was done using the spare interrupt pin and the attachInterrupt() function.

External image

lastly was to build the board and install it in the light switch, I took apart an old 5v USB wall wart and mounted it to the board, this converted the 230v~ to 5v for my Arduino.

Warning: do NOT try this at home unless you KNOW what you are doing as this is 230v AC!!

Next I used a solid state relay that could switch 230v ~ at 2A it could also be controlled from 5v this meant there was no extra wiring needed from the Arduino. The best part of using a solid state relay is there is no sound when switching the lights on/off.

External image

I then mounted it all inside a mounting block to give me extra room, and I drilled a hole for the IR sensor. After some testing and debugging it was all working.

September 2012

So I came up with the Xbox traffic lights, now at a glance you can see when the best time to play Xbox. An Arduino with Ethernet shield checks every five minuets to see if anyone is online.

The biggest problem I had was getting the user data off Xbox Live, as it is a frustratingly closed system, but eventually I found a usable api from xboxleaders.com, the only problem is that it only has public information, so it wont work with your friends that have hidden online status. ( Hidden status will always show a “1” in the api call, giving you a false green light).

The Arduino then loads the API for each player, then using the text finder library it finds the online status( a “1” or “0”), if the player is online it incenses the online status variable by one. At the end of the loop the Arduino will turn on one of the lights using that veriable: Zero players online = RED light, One player online = ORANGE light, Green = two or more players online = GREEN light. obviously this can be changed to suit.

External image

Once it was all working on my EtherTen I build a more permanent solution using WIZnet W5100, it has the same chip as the official Ethernet shield but ½ the cost. So I don’t fell so bad putting it in permanent projects.

I wanted to use my Kinect sensor as a input for my Arduino for some up coming projects, I think its one of the best sensors out there, its a pity there isn't a Arduino Shield available for Kinect. So for now I have to use my computer, however I could not find easy/good ways of doing it. I wanted something very simple and Arduino user friendly and no windows involved. After much searching and frustration I came across the simplest way for the Arduino and Kinect to be friends.

External image

Kinect output of X,Y and Z left and right hands displaying on 20x4 Arduino powered LCD.

Using Processing, OpenKinect, and this tutorial and library it was very easy for a Arduino novice. The Arduino IDE is based off Processing, so it’s very easy to go from one to the other. Geting Processing and the Arduino to talk was easier than expected using this tutorial and a line of code in Processing like this:

myPort.write(“/¼/”+ handX +“/”);

With similar lines on the Arduino end:

case 4:

{

getSerial();

int X= serialdata;

break;

}

External image

Now that the Arduino has the X, Y and Z values you can control any real world elements, such as a your lights, or a servo etc. You can even get Processing to calculate the angle between your hands, so when your turn your hands (like when driving a car) it will send a 0-360º value to the Arduino for added control.

After coming across some of my old rotary phones I wanted to get them working again, but one of the biggest problems with the old phones is they take so long to dial a number that the phone line will go dead or dials the number before you have finshed entering the number.

I needed the ability to dial the number only when the full number hand been entered. This was solved by using a cordless phone, as they usually only dial the number once you press send, this also made it posible to easily make the phone cordless. Using an Arduino for the rotary decoding and my old cordless phone for the rest solved the problem.

External image

First things first was decoding a rotary number, rotary phones send a number of pulses out depending on the number selected, this was done very easy by using this code found on instructables, I then edited the code to turn on the corresponding digital output of the Arduino every time it detected a number input.

External image

The hardware side was a bit tricky, but the easiest way of doing this was geting the Arduino to “press” the cordless phones buttons. This was solved by using an optocoupler for each button I wanted to press on the cordless phone. This isolated the Arduino from the phone, and the output of the optocoupler would act like a switch.

External image

By soldering wires to the buttons on the phone and then to the output pins of the optocoupler, the Arduino could simulate pressing the buttons by turning on the optocoupler.

External image

I mounted the old hanger micro switch onto my new control board and used it to send/start a call when lifted and hang up when down, this way you can input the numbers slowly on the rotary pad, and not have the phone disconnect because you are taking too long.

External image

External image

All together it works very well, how ever I still need to make the bells work, and install a battery for full portability.