My first Arduino project…

Earlier this week, after a few months of experimenting, tinkering and blinking LED’s, I presented my first proper Arduino project to my colleagues at Fantastic Thinking.

Having noticed that the BS button has recently become more popular in the office, I thought it seemed appropriate to create my own version, though one which could potentially contain more than one action, and more to the point, express that action in a much more interesting and interactive way through the use of sound, light and some form of mechanical articulation. It’s a project that I’ve thought about doing for a while and I’ve come up with a few different actions that could be dispatched by the device but in the interest of a quick demo, I decided to concentrate on creating one action with a view to taking the project further in future.

I considered several possibilities for actions that could occur in response to everyday occurrences in the office of a digital agency: finally cracking a taxing code problem, celebrating a site going live and maybe even, in the style of the BS button, making light of stupid mistakes or bad jokes. With only a few evenings of free time in which to develop and build a prototype though, I decided to create a basic demo which, in response to a button press via an online interface, a box opens to reveal a yellow glow of light (think Marcellus Wallace’s briefcase) accompanied by the sound of an angelic choir, for the purpose of celebrating those eureka moments when you come up with a great solution to a problem that has been bugging for hours.

Image

The workings of the box would comprise of a lid which opens and closes by way of a servo, an array of LED’s to emit a yellow glow and, for the sake of speed and ease, a TinkerProxy interface between the Arduino and Flash to trigger the sequence and play back a sound clip. Whilst a physical button would have also been easy to do, a software based interface lends itself better to ideas that I have for the future development of the box, for example, if it were to be a device which is accessible by several people in a large office.

For the structural and mechanical aspect of this project, there seemed to be no better prototyping tool to work with than Technic. It allows for easy building and modification of a mechanical object and is extensible. I had a lot of it lying around from a long while ago and found that I was easily able to use it to create the mechanics that I needed. Whilst experimenting, I found that I was also able to make use of some of the existing components like pneumatics and motors and interface directly with them using the Arduino board as a controller, perfect for future projects.

For now though, I only actually needed to use a servo, with a slight modification to one of the stock servo arms to allow Technic axels to be connected and driven. From here, I created a basic series of gears and levers to open the lids of the box. I remember solving these sorts of mechanical problems as a kid with relatively little difficulty but in this instance, they proved to be some of the most challenging parts of the build. Nonetheless I managed to get the lids of the box opening by using a 90 degree turn of the servo and some levers on one side, and then reversing the direction of the 90 degree motion on the other side, whilst maintaining the same turn speed by using a sequence of four gears, creating enough space in between the two sets of levers so as not to have them getting in each others’ way.

This slideshow requires JavaScript.

I then created a simple array of LED’s on a breadboard, which turned on in sequence to increase the brightness of the glow gradually, as the lids opened. I realise this isn’t the best way of doing it as the use of PWM with LED’s allows for gradual brightness increase and decrease but I haven’t had too much experience with it yet, and in particular, with using PWM with multiple LED’s on one Arduino board. I was also running short of time so I opted to use the proven solution and use of PWM is on my ‘to learn’ list for the future. With everything wired up, I found areas inside the frame of the Technic model where both the Arduino and the breadboard could be mounted and the made a cardboard shell to surround it all.

The programming aspect of the project was fairly simple, and was essentially a case of writing short functions which perform individual actions that can be chained together as a whole with the odd delay here and there to create the final sequence. This sequence could then be triggered using the flash interface which also handled the playback of the soundfile, again, something which I could have built into the Arduino, just not at this stage. The final stage involved fashioning a fairly crude cardboard covering for the box to contain the structure and electronics. See the video below for a demo!

 

It was great to finally get a project together using the Arduino platform – there were some really good problem solving challenges and I learned a lot in the process of combining the planning, electronics, mechanics and programming to create an end product. It’s also worth noting that Mike Chambers article ‘Getting started with Arduino and Flash‘ was a massive help, so thanks for that. I’m hoping to take this project further alongside another Arduino project that I’m currently working on, so I’ll update as an when I make further developments.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s