tag:blogger.com,1999:blog-69940471802859449372024-03-14T00:50:05.870-07:00blimpBlimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6994047180285944937.post-63146465049361116852013-07-28T12:22:00.001-07:002013-07-28T12:22:23.408-07:00Okay.. So.. We failed. <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.lmaofun.com/uploadedpics/7028463695661failure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://www.lmaofun.com/uploadedpics/7028463695661failure.png" width="320" /></a></div>
<br />
It's been a while since we updated the blog, mostly because we were procrastinating like crazy.<br />
<br />
Why?<br />
<br />
Because we failed to complete the Quadcopter project. Or even begin to do it.<br />
<br />
Reasons why I think we failed:<br />
<br />
<ul style="text-align: left;">
<li>We got really excited by the project and did zero research on the topic, and the parts. We ordered some very cheap speed controllers, and later realized from the forums that that was a bad idea. </li>
<li>We hugely underestimated the amount of work we would have had to put in. HUGELY. </li>
<li>The course load of college caught up with us. </li>
<li>And we were lazy. </li>
</ul>
<div>
And like we told our mentors and the contest organizers, this was a good lesson learnt in under-promising and over-achieving. </div>
<div>
<br /></div>
<div>
BUT there is a silver lining here. </div>
<div>
We have a lot of stuff to build a quadcopter and we also plan to team up with a group in college that have been doing some really good work on the topic! More on that later.</div>
<div>
<br /></div>
<div>
And while we were procrastinating to update the blog, a few things happened:</div>
<div>
<br /></div>
<div>
1. We participated in the awesome <a href="http://mitdi.wikispaces.com/" target="_blank">Design and Innovation workshop</a> conducted by the awesome people from MIT Medial labs.</div>
<div>
We worked on a tiny project called Beat Feet with the awesome <a href="https://twitter.com/priyansm" target="_blank">Priyans M</a> and Rishemjit Kaur.</div>
<div>
It basically involved a pressure sensor on my shoe to detect a tempo and play a pre-programmed beat. </div>
<div>
The project was featured on the official <a href="http://blog.arduino.cc/2013/04/13/beat-feet-set-your-beats-and-effects-with-gestures-using-arduino/" target="_blank">Arduino blog!</a></div>
<div>
<br /></div>
<div>
2. Our college required us to submit a 'mini-project' for our 6th semester. </div>
<div>
Akshay and I decided to make a guitar tuner along with <a href="https://www.facebook.com/anjana.shekhar.1910" target="_blank">Anjana Shekhar</a>. </div>
<div>
We went with <a href="http://www.instructables.com/member/amandaghassaei/" target="_blank">Amanda Ghassaei</a>'s Instructable on <a href="http://www.instructables.com/id/Arduino-Frequency-Detection/" target="_blank">Arduino Frequency Detection</a>.<br />
We really wanted it to work on the autocorrelation concept, but that didn't work for some reason.<br />
Maybe we can fix it with an <a href="http://forum.arduino.cc/index.php?topic=144715.0" target="_blank">RTOS implementation</a>?<br />
But anyway, read about it on our <a href="http://www.scribd.com/doc/156578476/Guitar-Tuner-Project-Report-EE-6th-Sem" target="_blank">project report</a>!<br />
<br />
3. We participated in the <a href="http://www.dese.iisc.ernet.in/ese/index.php/newsevents/smart-car-race" target="_blank">Freescale Cup for 2013</a>! And lost.<br />
More on that when we have something useful to post. :(<br />
<span style="font-size: xx-small;">Control systems is evil.</span><br />
<span style="font-size: xx-small;"><br /></span>
<br />
And that's it for now.<br />
We are working on some crazy things for our college satellite project and I really hope we get some time off to work on more tiny yet awesome projects.<br />
<br />
Until next time!<br />
- Bhargav </div>
</div>
Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com2tag:blogger.com,1999:blog-6994047180285944937.post-50111096141099634972012-11-14T09:52:00.002-08:002012-11-14T09:54:53.916-08:00MSP430-ing for TI's Analog Design Contest <div dir="ltr" style="text-align: left;" trbidi="on">
Hey everyone! So in the previous blogpost, we showed you the Mastodon video and also promised you details about a quadcopter build.<br />
And guess what?<br />
WE HAVE BEGUN! :D<br />
Well, sort of.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://img.izismile.com/img/img5/20120417/640/i_have_no_idea_what_im_doing_meme_640_07.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="231" src="http://img.izismile.com/img/img5/20120417/640/i_have_no_idea_what_im_doing_meme_640_07.jpg" width="320" /></a></div>
<br />
<br />
The quadcopter is for <a href="http://uniti.in/adc" target="_blank">Texas Instruments' Analog Design Contest</a> that's being held in India. We've already finished Phase 1A, where we had to work on their Analog Lab Starter Kit and solve <a href="http://uniti.in/images/problem-statement-b.pdf" target="_blank">a problem statement</a>.<br />
You can find our answer <a href="http://www.scribd.com/doc/113243553/Solution-to-Problem-B-Phase-1A-PART-B-of-Texas-Instruments-ADC" target="_blank">here</a>. I'm sure that most of it is wrong, and if you know the right answer, please let us know.<br />
<br />
So moving on, for the quadcopter, we did a little bit of preliminary research. We have no idea about the physics and everything. We wanted to build one that can be used for surveillance, reconnaissance and search and rescue during disaster time and otherwise, simply because it will add more value to the project.<br />
Our first stop.<br />
<br />
<div style="text-align: center;">
<a href="http://hobbyking.com/">HobbyKing.com</a> </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
While looking for quadcopter parts online, we immediately found out that hobbyking was the place to acquire all our parts. </div>
<div style="text-align: left;">
So we ordered our BLDC motors, a frame, batteries, electronic speed controllers, the FPV gear and other knick-knacks. We'll get to those later when we actually start to build the thing. </div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://images.sodahead.com/profiles/0/0/3/3/7/3/9/5/9/what-cat-84679676763.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="http://images.sodahead.com/profiles/0/0/3/3/7/3/9/5/9/what-cat-84679676763.jpeg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Patience, my friend. </td></tr>
</tbody></table>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/1/0/5/5/11055-01a.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/1/0/5/5/11055-01a.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pretty shiny, right?</td></tr>
</tbody></table>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
And we also needed an Inertial Measurement Unit that contains the accelerometer, gyro and compass, so that we get the state of the quadcopter in flight and allow the algorithm to use the readings in order to stabilize and do other cool stuff. We used <a href="http://www.sparkfun.com/products/11055" target="_blank">DIYDrones ArduIMU+ V3</a>.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Texas Instruments was generous enough that they gave each team participating in the competition (and there are around 300 plus teams) 200USD worth TI components for free! </div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i1.kym-cdn.com/entries/icons/original/000/005/169/it's%20free.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="http://i1.kym-cdn.com/entries/icons/original/000/005/169/it's%20free.jpg" width="400" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So we asked for a couple of MSP430 Launchpads, an <a href="http://www.ti.com/tool/ez430-rf2500" target="_blank">EZ430-RF2500</a>, a <a href="http://www.ti.com/tool/cc2500emk" target="_blank">CC2500EMK</a>(it's just a RF module) some LED drivers, Li-Ion battery management chips(just to see if we can try to build a charger ourselves). </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So while we wait for the stuff from HobbyKing to arrive, we thought we should get started on learning about the MSP430 launchpad and all it's functions like PWM, I2C, SPI and OTHER THINGS THAT WILL BLOW YOUR MIND. </div>
<div style="text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://importgeek.files.wordpress.com/2012/06/launchpad-board11.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="http://importgeek.files.wordpress.com/2012/06/launchpad-board11.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">MSP430 Launchpad, just like an Arduino, except, well, redder. </td></tr>
</tbody></table>
The MSP430 launchpad is basically a really inexpensive target board for MSP430 microcontrollers. You place a MSP430G2xx microcontroller in the socket, select the right device and write all your code in <a href="http://processors.wiki.ti.com/index.php/CCS_for_LaunchPad" target="_blank">Code Composer Studio</a> (or any of the <a href="http://processors.wiki.ti.com/index.php/Other_MSP430_Software_Tools_for_LaunchPad" target="_blank">other software tools</a>), and you can flash program and debug your MSP430! :D<br />
<div>
It's pretty awesome, and in construction seems <a href="http://www.meanpc.com/2011/12/ti-launchpad-msp430-vs-arduino-uno.html" target="_blank">very similar to an Arduino</a>? But I wouldn't recommend it for the absolute beginner. If you have an idea and you want stuff blinking or moving within a matter of minutes, go for an Arduino. </div>
<div>
But if you want to take your time then you can buy around three Launchpads for the price of one Arduino.<br />
Or you can try <a href="http://youtu.be/-KKmkwHapSw" target="_blank">this</a>(Which is pretty awesome. I need to check it out).<br />
<div style="text-align: left;">
It actually took me quite some time to understand the code that blinks the on-board LED's. But as we're learning, we'll talk about everything and if you're as stumped as we are about learning about the Launchpad from the internet, then hopefully our blogpost/tutorial things will help you out.<br />
<br />
See you soon! </div>
</div>
</div>
Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com1tag:blogger.com,1999:blog-6994047180285944937.post-32520499984096691562012-07-29T11:20:00.002-07:002012-07-29T11:20:40.865-07:00Mastodon 1.0 - The Movie<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: left;">
Finally, the movie is done! </div>
<div class="separator" style="clear: both; text-align: left;">
There are a couple of things in the video that we left in intentionally, lets see if you get both of them! =P</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/Vj2g1rImDUQ?feature=player_embedded' frameborder='0'></iframe></div>
<br />
If you want to know anything about the build, do let us know. There were a few problems we faced with it, mostly because the platform was a rat's nest of wires on top of a breadboard which was held down by a rubber band and a whole lot of tape. And if you do that on a moving platform where almost nothing is held down with solder, stuff is bound to come flying out. <br />
<br />
Also, we're planning to post more regularly, and keep checking this spot, because a HUGE quadcopter build is on it's way!!<br />
<br />
So until next time, keep making!<br />
<br /></div>Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com1tag:blogger.com,1999:blog-6994047180285944937.post-23946260259447026662012-07-13T09:45:00.000-07:002012-07-27T07:13:58.146-07:00Mastodon 1.0 and DIY Dinner<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin-left: 1em; margin-right: 1em;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
About a week ago Bhargav started working on a bluetooth controlled car. It was inspired by <a href="http://www.instructables.com/id/Hercules-The-Motion-Controlled-Android-Robot/" target="_blank">this</a> instructable. It consisted of four motors connected to a mechanix frame. If you don't already know what mechanix is, it is a kids toy used for building structures using nuts and bolts. </div>
<div style="text-align: left;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-9KGFGV1g364/T_8ONb-9NNI/AAAAAAAAAGc/njd3tcpK1rM/s1600/Mechanix.jpeg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="150" src="http://2.bp.blogspot.com/-9KGFGV1g364/T_8ONb-9NNI/AAAAAAAAAGc/njd3tcpK1rM/s200/Mechanix.jpeg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mechanix. <br />
If you haven't used it as a child, <br />
you're probably nuts.</td></tr>
</tbody></table>
<br />
<br />
<br />
<div style="text-align: center;">
To this he attatched a 12V battery to power the motors and a L293 H-Bridge motor driver IC. And he used an Arduino Uno along with a bluetooth module for controlling it. He used a 9V battery to power the Arduino. It looked something like the picture below.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/603510_4167949159145_431651970_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/603510_4167949159145_431651970_n.jpg" width="320" /></a></div>
<br />
<div style="text-align: center;">
Now lets look into a few details before we proceed. First, the L293. The L293 is a motor driver used to control the direction of rotation of motor rotation using digital signals. That means that by using the digital output pins of the Arduino you can control the motor. It works with two digital inputs for each motor, and it can control 2 sets of motors independently. You can also have a separate power source for the motors (we used the 12V one).</div>
<div style="text-align: right;">
</div>
<div>
<div style="text-align: center;">
<br /></div>
The logic table is something like this.</div>
<div>
<a href="http://3.bp.blogspot.com/-svDjxmCYH9k/T_8UVW62HWI/AAAAAAAAAGo/7R0m5T4AF80/s1600/Hbridge.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="111" src="http://3.bp.blogspot.com/-svDjxmCYH9k/T_8UVW62HWI/AAAAAAAAAGo/7R0m5T4AF80/s400/Hbridge.jpeg" width="400" /></a><br />
<div style="text-align: center;">
A and B refer to the digital inputs.</div>
</div>
<div>
<div style="text-align: center;">
The basic idea that shines here is the you can change direction of the motor digitally.</div>
</div>
<div>
<br />
<br />
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
What we did was we tied up two motors together, both the left ones and both the right ones, so that they can be controlled simultaneously. So if we wanted to turn the vehicle to the right, we would turn only the left motors or vice versa. One limitation with this usage that we noticed was that we cannot move and turn simultaneously. It has to move, stop and only then turn. </div>
</div>
<div>
<br /></div>
<div style="text-align: left;">
<div style="text-align: center;">
Now lets look into the control. We used the bluetooth module, the same one we used in Ayana '12 along with this Android app called <a href="https://play.google.com/store/apps/details?id=com.gundel.bluecontrol&hl=en" target="_blank">Blue Control</a> available for free in Google's Play store. It is a very simple app which has direction buttons and a bunch of other buttons. </div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div style="text-align: left;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://lh3.ggpht.com/sMglbc5G1ED02sey6CB7kVKMIAZOmJRRZ2ni4ImSwdb2ul164v7K7J54EXRBM21yJSU" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://lh3.ggpht.com/sMglbc5G1ED02sey6CB7kVKMIAZOmJRRZ2ni4ImSwdb2ul164v7K7J54EXRBM21yJSU" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The center button actually opens a Blue portal.<br />
The orange one is in Narnia.</td></tr>
</tbody></table>
<div style="text-align: center;">
When you pair your phone with the bluetooth module, it sends certain ASCII characters to the bluetooth module which can be serially recieved by the Arduino. The ASCII character which is sent depends on the button which is pressed on the app.</div>
</div>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
So what our Arduino code should basically do is receive these serial signals and send appropriate signals to the motor drivers such that they activate the right motors.<br />
<br />
Its that time again, time for a block diagram.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-2elAE5CU4OE/T_8dXoB-PpI/AAAAAAAAAG0/XY2HO1bpiU8/s1600/Block.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="179" src="http://3.bp.blogspot.com/-2elAE5CU4OE/T_8dXoB-PpI/AAAAAAAAAG0/XY2HO1bpiU8/s640/Block.jpeg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A picture says a thousand words, this block diagram says sixteen.</td></tr>
</tbody></table>
<b>Problems, problems and then some</b>.<br />
<div style="text-align: center;">
One major problem we ran into was, after a couple of minutes of neck breaking speeds the motor driver would heat up. And this would cut off supply all motors due to its automatic thermal shutdown feature.</div>
<div style="text-align: center;">
<br />
We decided to pick up the L298 motor driver instead because it seemed to have better thermal stability and a heat sink as well. </div>
<div style="text-align: center;">
The only disadvantage with this was that it was only available in a Multiwatt-15 package as opposed to a dual-inline package. We took more than three hours trying to fit this thing onto a breadboard and trying to make it work without any loose connections but to no avail.</div>
<div style="text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://www.jameco.com/Jameco/Products/ProdImag/245403.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img alt="L298N: ST MICRO" border="0" src="http://www.jameco.com/Jameco/Products/ProdImag/245403.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The L298 Multiwatt package, breadboard's arch nemesis.</td></tr>
</tbody></table>
<br />
<b></b><br />
<b></b><br />
<b></b><br />
<b></b><br />
<b>DIY Dinner.</b><br />
<div style="text-align: center;">
We decided to take a break for dinner and went out shopping for instant noodles which we usually buy on all-night soldering parties like this one.</div>
<div style="text-align: center;">
But instead we decided to make something a little more interesting so we bought:</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-PSju-38oNfQ/T_8oFOctpSI/AAAAAAAAAHs/hKXIy1APzn0/s1600/IMAG0021-1.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="119" src="http://1.bp.blogspot.com/-PSju-38oNfQ/T_8oFOctpSI/AAAAAAAAAHs/hKXIy1APzn0/s200/IMAG0021-1.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">There is something magical about eggs.</td></tr>
</tbody></table>
<br /></div>
<ul style="text-align: left;"></ul>
<ul style="text-align: left;">
<li> Mozzarella cheese</li>
<li>One loaf of whole wheat bread</li>
<li>Mushrooms</li>
<li>Half a dozen of eggs</li>
<li>Maggi Pizza sauce</li>
</ul>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-GoZW3fQsBS0/T_8oDJmYKII/AAAAAAAAAHY/bahXvXlpCU8/s1600/IMAG0011.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="http://3.bp.blogspot.com/-GoZW3fQsBS0/T_8oDJmYKII/AAAAAAAAAHY/bahXvXlpCU8/s320/IMAG0011.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">That is a killer knife right there.</td></tr>
</tbody></table>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
What kind of a hideous dinner we made from these you ask? We made some ommlettes and bread pizzas. Its quite simple actually, you just pretend your bread slices are the pizza base and top it like you would a regular pizza. We bought whole wheat bread because we are health conscious. No, really. </div>
</div>
<div style="text-align: center;">
<br />
Anyways we sauted the mushrooms and some onions before putting them on the pizza. We put them in the oven for about 15 minutes and we had lovely bread pizza. </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-rjR0DdK5XBQ/T_8oD_zlF7I/AAAAAAAAAHg/-RxFfFVSLj8/s1600/IMAG0017.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="http://2.bp.blogspot.com/-rjR0DdK5XBQ/T_8oD_zlF7I/AAAAAAAAAHg/-RxFfFVSLj8/s320/IMAG0017.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Don't try this at home.</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-YPfKnHgtMlE/T_8oGv3ngFI/AAAAAAAAAHw/sWwg5fmhXRE/s1600/IMAG0023-1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="http://4.bp.blogspot.com/-YPfKnHgtMlE/T_8oGv3ngFI/AAAAAAAAAHw/sWwg5fmhXRE/s320/IMAG0023-1.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-K_xqCe7zfCY/T_8oHsgmqsI/AAAAAAAAAH4/P3S1Kdjkqxw/s1600/IMAG0034.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="http://3.bp.blogspot.com/-K_xqCe7zfCY/T_8oHsgmqsI/AAAAAAAAAH4/P3S1Kdjkqxw/s320/IMAG0034.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Artistic oven shot.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-w_MIMZpNnsA/T_8qiXPuVUI/AAAAAAAAAIE/M0Ug3VdFzf8/s1600/IMAG0037.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="http://3.bp.blogspot.com/-w_MIMZpNnsA/T_8qiXPuVUI/AAAAAAAAAIE/M0Ug3VdFzf8/s320/IMAG0037.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After.</td></tr>
</tbody></table>
<div style="text-align: center;">
We did a little experimenting with the omlettes too. We made cheese omlette with mushrooms and herbs. Check it out.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-YvErdSx0dBo/T_8oBxO6RWI/AAAAAAAAAHU/o7R6TZzQ6s0/s1600/IMAG0008.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://2.bp.blogspot.com/-YvErdSx0dBo/T_8oBxO6RWI/AAAAAAAAAHU/o7R6TZzQ6s0/s320/IMAG0008.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mushroom omlette. With Shyam's secret recipe<br />
that no one will know.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-i5SRLEbImqk/T_8qtQqOqSI/AAAAAAAAAIM/UsKaxtKktfI/s1600/IMAG0041.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://2.bp.blogspot.com/-i5SRLEbImqk/T_8qtQqOqSI/AAAAAAAAAIM/UsKaxtKktfI/s320/IMAG0041.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cheese omlette with herbs.</td></tr>
</tbody></table>
<div style="text-align: left;">
</div>
<div>
<div style="text-align: left;">
<b><br /></b><br />
<b>Revival.</b></div>
<div style="text-align: center;">
Well we spent a good three hours in the kitchen, and we were tired and full so we decided to turn in. But Bhargav decides to try the circuit out one last time before that. And as we listened to some Color Haze we suddenly hear the whirr of the motors, it finally works!</div>
<div style="text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-ovMBuk3u9rc/T_8tnpsDldI/AAAAAAAAAIg/Q4BhhOQcyzU/s1600/IMG_20120711_021733.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="271" src="http://2.bp.blogspot.com/-ovMBuk3u9rc/T_8tnpsDldI/AAAAAAAAAIg/Q4BhhOQcyzU/s320/IMG_20120711_021733.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">We are not superstitious. We really aren't.</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div style="text-align: center;">
Anyways this got us really excited so we decided to shoot some videos of it and do a couple of test runs on the street. We taped a camera onto it to get a first person's view.</div>
<div style="text-align: center;">
And who doesn't love blue LEDs? So we decided to include a blue LED into the circuit, for *ahem* better vision.</div>
<div style="text-align: right;">
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-3k0B8JYWt1Y/T_8uead_A6I/AAAAAAAAAIs/iH8xDHE6zgI/s1600/IMG_20120711_025534.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="150" src="http://2.bp.blogspot.com/-3k0B8JYWt1Y/T_8uead_A6I/AAAAAAAAAIs/iH8xDHE6zgI/s200/IMG_20120711_025534.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This is how it looked with the <br />
camera taped on it.</td></tr>
</tbody></table>
</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-VZU2ZNrX00k/T_8udV-KZQI/AAAAAAAAAIo/vIVBIN2qXcA/s1600/IMG_20120711_023446.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="150" src="http://3.bp.blogspot.com/-VZU2ZNrX00k/T_8udV-KZQI/AAAAAAAAAIo/vIVBIN2qXcA/s200/IMG_20120711_023446.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can never go <br />
wrong with a blue LED.</td></tr>
</tbody></table>
<br />
<div>
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
</div>
<div>
All of this leads up to the video we are making of it. We decided to call it Mastodon 1.0. (Why? Because <a href="http://www.youtube.com/watch?v=bACiwOwpHzM" target="_blank">Mastodon</a> is awesome). </div>
<div>
<br /></div>
<div>
You can see the trailer here.</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<iframe allowfullscreen="" frameborder="0" height="344" src="http://www.youtube.com/embed/YuWqWXggpYQ?fs=1" width="459"></iframe>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="background-color: black; text-align: center;"><br /></span><br />
Stay tuned for the actual video.</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
P.S. - The Arduino code we used is <a href="http://codetidy.com/3170/" target="_blank">here</a>.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-1OHb_O6eB9g/T_8wzWSAPeI/AAAAAAAAAJE/VyGsuTggIZM/s1600/mastodon.jpeg" imageanchor="1" style="background-color: black; margin-left: auto; margin-right: auto;"><img border="0" height="330" src="http://3.bp.blogspot.com/-1OHb_O6eB9g/T_8wzWSAPeI/AAAAAAAAAJE/VyGsuTggIZM/s400/mastodon.jpeg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">To a web browser near you.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
-Akshay</div>
</div>Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com0tag:blogger.com,1999:blog-6994047180285944937.post-63658321167869795332012-05-01T13:05:00.000-07:002012-05-01T13:27:20.005-07:00Ayana12 - Hackathon idea: Android-Arduino-Bluetooth-Twitter-thing<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
The open source group in our college hosted a 24 hour hackathon last week called <a href="http://www.facebook.com/pesayana?filter=2" target="_blank">Ayana 2012</a>. We'd heard that they were allowing hardware hacks too, we were totally excited about it and decided to check it out! </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/_m3zccoq7kKQ/TAO5sT9NBHI/AAAAAAAAAEM/c_uWAOfcfRw/s400/Cat+Happy+Smile.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="http://4.bp.blogspot.com/_m3zccoq7kKQ/TAO5sT9NBHI/AAAAAAAAAEM/c_uWAOfcfRw/s320/Cat+Happy+Smile.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<a href="http://img.alibaba.com/wsphoto/v0/453488389/Freeshipping-F73-Arduino-Bluetooth-Module-Slave-Wireless-Bluetooth-Serial-Port.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="http://img.alibaba.com/wsphoto/v0/453488389/Freeshipping-F73-Arduino-Bluetooth-Module-Slave-Wireless-Bluetooth-Serial-Port.jpg" width="200" /></a>After a couple of days of idea spit-balling at Akshay's place, we decided to go ahead with making an Android-controller thingy that lets us use a phone like a steering wheel or however you wanted to use it. After dabbling around with TCP, UDP, Telnet, SSH, and all those other wonderful wonderful networking protocols, we decided to go ahead with bluetooth. </div>
<div class="" style="clear: both; text-align: left;">
Now again, we just couldn't figure how to send sensor data directly from the phone to the computer we were using. Until Shyam found out that we could use a bluetooth module on the arduino to receive sensor data from the phone using <a href="http://www.amarino-toolkit.net/" target="_blank">The Amarino App</a> on Android. The arduino, once receiving, can send some serial message back to the computer and that in turn generates a keyboard event. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.instructables.com/image/FFBXATBGPVF2AO3/Amarino.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="http://www.instructables.com/image/FFBXATBGPVF2AO3/Amarino.jpg" width="192" /></a>Now this app is amazing simply because of it's amazingly simple interface that easily connects to our bluetooth module and send sensor values serially to the computer! It's amazing! </div>
<div>
</div>
<br />
So the next part we thought was pretty simple.<br />
<div>
<br /></div>
<div style="text-align: left;">
<ol style="text-align: left;">
<li>Read sensor values.</li>
<li>Setup a threshold to send a serial message.</li>
<li>Convert serial message into a keyboard event.</li>
</ol>
Not that simple. The code was still buggy even after working on it for several hours. We'll put it up once it's nice and all. But it's loosely based on <a href="http://www.instructables.com/id/Hercules-The-Motion-Controlled-Android-Robot/" target="_blank">This Instructable</a> (which I think is really cool and shall definitely try out as soon as I get the time)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
And after that part was kinda down, we needed to create keyboard events. Again, not so simple. But after Google searching for several hours looking at Java libraries and all that, we came across: </div>
<div style="text-align: left;">
<br /></div>
<h2 style="text-align: center;">
<i><a href="http://sourceforge.net/projects/serial2keyboard/" target="_blank">Serial2Keyboard</a></i></h2>
<div>
<a href="http://4.bp.blogspot.com/-BWX780LXNAE/T6A0gHtyZSI/AAAAAAAAAFU/mMfc0hEk0oM/s1600/Serial2Keyboard.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="210" src="http://4.bp.blogspot.com/-BWX780LXNAE/T6A0gHtyZSI/AAAAAAAAAFU/mMfc0hEk0oM/s320/Serial2Keyboard.png" width="320" /></a>Not many times does a google search lead you to jump around in a manic fashion cursing happily, but this did. And something about this software is kinda buggy too, or maybe we still don't know how to use it. But it's brilliant! </div>
<div>
<br /></div>
<div>
All we had to do was change the hex values in the protocol.txt file to ASCII values and we were good to go! </div>
<div>
<br /></div>
<div style="text-align: center;">
<span style="font-family: 'Courier New', Courier, monospace;">Serial.println('a');</span></div>
<div style="text-align: center;">
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div style="text-align: right;">
<span style="font-family: inherit;">would make the cursor go up, up, up! It was awesome. </span></div>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;">But the reason I keep saying it was buggy because when we tried it on a game, we'd go left, and then we'd go right and then, yeah, we'd be stuck there. It just wouldn't go the other way. But it worked fine on notepad! DAMN. </span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://fc02.deviantart.net/fs15/f/2007/037/2/0/Angry_Pikachu_by_BeebarbX.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="146" src="http://fc02.deviantart.net/fs15/f/2007/037/2/0/Angry_Pikachu_by_BeebarbX.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pissing off, man. </td></tr>
</tbody></table>
<div style="text-align: left;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: inherit;">Anyway, I went and bought a bulb from somewhere and thought we could use it to demonstrate how we can turn on and off appliances using the phone. We got it working after a while, using the proximity sensor on the phone.<br />It would just toggle on and off though, we couldn't get it to stay on or off. </span></div>
<div style="text-align: left;">
We'll post the code once we fix that. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
We also wrote a little python code that let us turn on and off the bulb using twitter! :D The time delay was terrible though, I'll write another post about it soon, as I have a lot more to say about it. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Overall, Ayana12 was a terrific experience. The atmosphere was humming with creativity and laptop fans. I managed to click a few pics too! </div>
<div style="text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-4mW92LLYU5A/T6A93VSPhmI/AAAAAAAAAFg/aZrJit5CwBc/s1600/P4280360.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://3.bp.blogspot.com/-4mW92LLYU5A/T6A93VSPhmI/AAAAAAAAAFg/aZrJit5CwBc/s320/P4280360.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shreya, Surabhi, and Aditi. Trying to look cool. </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-DgovLTc7qvo/T6A-PTHB70I/AAAAAAAAAFo/b9XegKude0o/s1600/P4280367.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://2.bp.blogspot.com/-DgovLTc7qvo/T6A-PTHB70I/AAAAAAAAAFo/b9XegKude0o/s320/P4280367.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">They had BEAN BAGS!!!!</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-qEJjFE1QXs4/T6A-mpKtBWI/AAAAAAAAAFw/1KwsMLZ1oqw/s1600/P4280368.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://4.bp.blogspot.com/-qEJjFE1QXs4/T6A-mpKtBWI/AAAAAAAAAFw/1KwsMLZ1oqw/s320/P4280368.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shyam hooking up the bluetooth module to the Arduino.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-14mrFZll6Ng/T6A-968nT1I/AAAAAAAAAF4/4IOOhJm0fjA/s1600/P4280370.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://1.bp.blogspot.com/-14mrFZll6Ng/T6A-968nT1I/AAAAAAAAAF4/4IOOhJm0fjA/s320/P4280370.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Anjana and her team, Vivek and Kiran. </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-qDyUEKZ3vXQ/T6A_Xo2KVYI/AAAAAAAAAGA/uRPc_PNnuu8/s1600/P4280375.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://3.bp.blogspot.com/-qDyUEKZ3vXQ/T6A_Xo2KVYI/AAAAAAAAAGA/uRPc_PNnuu8/s320/P4280375.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Vincent. Showing off. He single-handedly won the whole thing later anyway. :P</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-g0yxzPyyZsw/T6A_uFYlXwI/AAAAAAAAAGI/4pAMxjQVOn8/s1600/P4290377.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://1.bp.blogspot.com/-g0yxzPyyZsw/T6A_uFYlXwI/AAAAAAAAAGI/4pAMxjQVOn8/s320/P4290377.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Our station. </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-F8X3il0rmRU/T6BAFTUIN9I/AAAAAAAAAGQ/5pBBPuXXyq0/s1600/P4290382.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://2.bp.blogspot.com/-F8X3il0rmRU/T6BAFTUIN9I/AAAAAAAAAGQ/5pBBPuXXyq0/s320/P4290382.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This guy had wireless-ly interfaced a 3x3 array of LCD screens and was playing Die Hard 4 on them.<br />
It looked awesome!<br />
<br /></td></tr>
</tbody></table>
<div style="text-align: left;">
-Bhargav</div>
<div style="text-align: left;">
<br /></div>
</div>Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com0tag:blogger.com,1999:blog-6994047180285944937.post-44036679565087576152012-03-11T10:26:00.001-07:002012-03-13T06:31:13.309-07:00Computer Controlled Light Bulb<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="margin-left: 1em; margin-right: 1em; text-align: center;">
The first thing anyone ever does on the <a href="http://arduino.cc/">Arduino</a> board is to make an LED <a href="http://arduino.cc/en/Tutorial/blink" target="_blank">blink</a>. Some go
even so far as to call it the ‘Hello World’ of electronics. We took it a step
further and made a Light bulb blink.</div>
<br />
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
How is that different?<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
An LED works fine with a 2V DC supply voltage. <o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
</div>
<div class="MsoNormal" style="text-align: center;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-5-7Ke4zZL0c/T1ziUgCyqHI/AAAAAAAAAFA/Z4GFdSzPLNU/s1600/blueled.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="150" src="http://3.bp.blogspot.com/-5-7Ke4zZL0c/T1ziUgCyqHI/AAAAAAAAAFA/Z4GFdSzPLNU/s200/blueled.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Billions of blue blistering LEDs</td></tr>
</tbody></table>
<br />
A standard light bulb with a
tungsten filament </div>
<div class="MsoNormal" style="text-align: center;">
works with the household 220V AC supply. (or 110V, whatever the local power supply is)<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-0np9XQf3q-w/T1ziNdwdg5I/AAAAAAAAAE4/2DpafUqa4dk/s1600/bulb.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="150" src="http://1.bp.blogspot.com/-0np9XQf3q-w/T1ziNdwdg5I/AAAAAAAAAE4/2DpafUqa4dk/s200/bulb.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">How many DIY'ers does it take to screw in a lightbulb?</td></tr>
</tbody></table>
This means that an LED can be
directly connected to the Arduino board because the board’s digital pins are at 5V when they are in an ON state. There is no way the light bulb can be
powered by the Arduino board.</div>
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div style="text-align: right;">
</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-VopmkFOu_xo/T1zfOcY5HII/AAAAAAAAAEw/YboQaxP2jRw/s1600/PULPY.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="200" src="http://1.bp.blogspot.com/-VopmkFOu_xo/T1zfOcY5HII/AAAAAAAAAEw/YboQaxP2jRw/s200/PULPY.png" width="90" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Its not JUST orange juice.</td></tr>
</tbody></table>
<div class="MsoNormal" style="text-align: left;">
</div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div style="text-align: center;">
How we solved it? </div>
<div style="text-align: center;">
After some research, and a lot of Pulpy Orange, we came across these
magical little things called relays. No, not the one involving the baton, but
the basic philosophy still holds good.</div>
<br />
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
A relay is used when you need to control a circuit with a
higher voltage with a low voltage signal.<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
When you input a digital HIGH (that’s 5 Volts) it shorts the
other two leads with almost no physical connection between the two circuits.
Something like this. <o:p></o:p></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-EE45QPCTctg/T1zWFj3reNI/AAAAAAAAAEU/kqQ7t2Kr8X8/s1600/untitled2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="115" src="http://3.bp.blogspot.com/-EE45QPCTctg/T1zWFj3reNI/AAAAAAAAAEU/kqQ7t2Kr8X8/s400/untitled2.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The circle like thing is the light bulb and the rectangle is the relay.<br />
A digital HIGH connects the output circuit.</td></tr>
</tbody></table>
<br />
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
When you input a digital LOW (that’s 0 Volts) it leaves the
other two leads open. This is like disconnecting the other circuit. Like this.<o:p></o:p></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-4MxymzM2nTw/T1zVkzYxGGI/AAAAAAAAAEI/cZQjZecxhj8/s1600/Untitled2.png.bmp" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="120" src="http://1.bp.blogspot.com/-4MxymzM2nTw/T1zVkzYxGGI/AAAAAAAAAEI/cZQjZecxhj8/s400/Untitled2.png.bmp" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A digital LOW disconnects the output circuit.</td></tr>
</tbody></table>
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
So you can almost say the relay helps pass the baton
from one circuit to the other. (You saw this coming:-P)<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div style="text-align: center;">
The Arduino can
send and receive serial data via USB to the computer. We used a simple Physical pixel code from the Arduino
website available <a href="http://arduino.cc/en/Tutorial/PhysicalPixel">here</a>.
What it basically does is,</div>
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
if the Arduino receives
an ASCII letter ‘H’ through the serial port then it sets the output pin to a digital
HIGH. This eventually causes the light bulb to turn on because this HIGH is fed
into the relay as shown above. <o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
When the Arduino receives an ASCII letter ‘L’ through the
serial port it sets the output pin to a digital LOW, which in turn turns the
light bulb off. <o:p></o:p><br />
<br /></div>
<div class="MsoNormal" style="text-align: center;">
We wanted a way to control the light bulb with an app on the
computer. We basically built a simple GUI using the <a href="http://processing.org/" target="_blank">Processing</a> tool. What it
does is it basically uses a Java code to generate an application on the
computer through which it sends serial data to the Arduino. <o:p></o:p>Note that we didn't use the mouse-over program which <a href="http://arduino.cc/en/Tutorial/PhysicalPixel" target="_blank">Physical pixel</a> used. But they both work the same way and work equally well.</div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
So we used one of the example programs which creates a
button and added a few things which makes it do what we want it to do. The code
basically uses a <o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
port.write() command to send the ASCII characters to the
serial port a.k.a., the Arduino.</div>
<div class="MsoNormal" style="text-align: center;">
<o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
If you want the code we used its available <a href="http://codetidy.com/2171/">here</a>. It finally worked out in the end and
you can see it in this video.<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/4vMhnjxTcF8?feature=player_embedded' frameborder='0'></iframe></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="text-align: center;">
Well, the project isn’t all that high tech. We were just
experimenting with a concept, and it worked. We want to expand on this idea and
eventually have a completely automated room. There is a lot more to come. So
stay tuned.<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-14ilmMvEjS4/T1zXWeMRePI/AAAAAAAAAEo/mTdMpgwg_TE/s1600/tuner.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="286" src="http://1.bp.blogspot.com/-14ilmMvEjS4/T1zXWeMRePI/AAAAAAAAAEo/mTdMpgwg_TE/s320/tuner.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
- Akshay</div>
<div style="text-align: center;">
<br /></div>
</div>Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com0tag:blogger.com,1999:blog-6994047180285944937.post-76491652343950034752012-01-12T13:08:00.000-08:002014-05-06T00:57:36.570-07:00The Arduino Air Drums Part 2<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<blockquote class="tr_bq">
<i><span style="background-color: #edf1f7; color: #003399; font-family: Arial, sans-serif; font-size: 12px; text-align: -webkit-auto;">“</span>Doing things the way you see it, going by your own heart and soul, that is pure artistic integrity. Whatever the hair is six or sixty inches long, the eyes have make-up or not, the riffs are in 'E' or 'F' sharp, the amps are Marshall or not, all those things don't matter if you are doing it for the right reason, which to me means <b>doing it for yourself!</b><span style="background-color: #edf1f7; color: #003399; font-family: Arial, sans-serif; font-size: 12px; text-align: -webkit-auto;">”</span> </i></blockquote>
<div style="text-align: right;">
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://www.freedrumlessons.com/media/drummers/lars-ulrich-photo.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="http://www.freedrumlessons.com/media/drummers/lars-ulrich-photo.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">“What's the message in Metallica? There is no message,<br />
but if there was a message, it really should be look within yourself,<br />
don't listen to me,<br />
don't listen to James, don't listen to anybody, <br />
look within yourself for the answers.”<br />
Lars Ulrich</td></tr>
</tbody></table>
<div style="text-align: right;">
- this guy -</div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Although people hate Lars because he's not a great drummer and he sued Napster and can't play things right away and everything, you have to give it to the guy for being one of the most vocal drummer and speaking his mind out.<br />
Anyway, I wanted to start the post with a cool quote and it kinda blew out. Sorry. :P </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So BACK TO BUSINESS!<br />
The drums aren't complete without pedals, right? We need the bass pedal to play the bass and a hi-hat pedal to open and close the hi-hat. If you're unfamiliar with the awesome kit that is the drums, Google has THE picture. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.drumset.com/Pictures/drum%20set%20setup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.drumset.com/Pictures/drum%20set%20setup.jpg" height="234" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
We followed mmidgal on his concept and used two slippers, one with a ADXL335 accelerometer and one with the photocell. </div>
<div style="text-align: left;">
[UPDATE: The photocell that we got wasn't very effective in changing it's resistance fast, so we decided to remove this part of the kit completely] </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So what we did was, we made a slit in our first slipper almost 3/4th the way in the front so as to insert the accelerometer. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-Rp5DUPfFh98/Tw87T9M1SWI/AAAAAAAAADo/y1ltD2f6dic/s1600/P1090035.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-Rp5DUPfFh98/Tw87T9M1SWI/AAAAAAAAADo/y1ltD2f6dic/s320/P1090035.jpg" height="320" width="213" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The accelerometer was connected to the USB connector<br />
the same way that we had done for the sticks. </td></tr>
</tbody></table>
<br />
<div>
Now that we're done with all three of our elements, the easy part was hooking the circuit up. USB cables are awesome for the job, and pretty cheap as well! </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Now we move on to </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://fc07.deviantart.net/fs43/f/2009/063/b/b/Cartoon__Programmer_by_tenchimyo.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://fc07.deviantart.net/fs43/f/2009/063/b/b/Cartoon__Programmer_by_tenchimyo.jpg" height="200" width="152" /></a></div>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i>The Program </i></div>
<div style="text-align: left;">
<i><br /></i></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
For the impatient, you can find the code <a href="https://github.com/bhar92/AirDrums/blob/master/AirDrums.ino" target="_blank">Here</a>.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
But I'd like to take a while and explain what we tried to do with the code and the problems that we ran into:<br />
<br />
Firstly, a useful function to see how the Arduino is 'reporting' back changes given by the accelerometer is the analogRead(pinNum)</div>
<div style="text-align: left;">
along with the Serial.println(var) function, both of these when used in one program displays the reading received by the Arduino program as illustrated <a href="http://arduino.cc/en/Tutorial/AnalogReadSerial" target="_blank">here</a>. The results are then printed on the Arduino's serial monitor. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Using the above program we noticed that the value printed changes when the accelerometers are moved in their respective directions. So we figured our basic logic would be</div>
<div style="text-align: left;">
<br /></div>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">if(valueReadBySensor > someThreshold) then return (a MIDI message)</span></blockquote>
<br />
and that's just repeated for all the other accelerometers.<br />
<br />
One more <b><span style="font-family: Verdana, sans-serif;">important thing</span></b> is that we could never get our MIDI to USB converter to work with our program, after days of searching, we chanced upon a brilliant little piece of software, that reads MIDI messages directly from the USB port without the use of any DIN connectors or anything!!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://img.brothersoft.com/screenshots/softimage/s/s2midi-239437-1242362782.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://img.brothersoft.com/screenshots/softimage/s/s2midi-239437-1242362782.jpeg" height="108" width="320" /></a></div>
<div style="text-align: center;">
<a href="http://code.google.com/p/s2midi/" target="_blank">S2MIDI converter</a> </div>
<div style="text-align: center;">
<span style="text-align: left;">It's brilliant and so simple to use!! Just select the output port as Microsoft GS Wavesynth and you're good to go! We experimented with other softwares and virtual MIDI ports such as LoopBe and MIDIyoke but we could never get a sound out of Reaper or Audacity. </span></div>
<br />
Alright, so now you have your simple piece of code to play a note when the accelerometer moves an appropriate amount.<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">void loop()</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">{</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;"> int threshold = 375;</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;"> int reading = analogRead(A0);</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;"> if(reading > threshold)</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;"> noteOn(9, 35, 120);</span></blockquote>
</blockquote>
<span style="font-family: 'Courier New', Courier, monospace;"> } </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: inherit;">[You will find the definitions for noteOn and everything in <a href="https://github.com/bhar92/AirDrums/blob/master/AirDrums.ino" target="_blank">the code</a>.]</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">This is great now, but what was happening was since there were a bunch of readings above the threshold that appeared as the drumstick was flicked, the S2MIDI software gave us a '<i>trrrrrrrrrrrrrk</i>' sound. </span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">So, we thought <a href="http://arduino.cc/en/Reference/Delay" target="_blank">delay()</a> was a great function, which paused the function for a certain number of milliseconds. But this still was not good enough because we could never reach a compromise between a really low delay value and the '<i>trrrrrrk</i>' sound.</span><br />
<span style="font-family: inherit;"><br /></span>
After days and days of experimenting, we finally decided that the code mmidgal posted on his video was the best, although we made some modifications to make it better.<br />
<span style="font-family: inherit;"><br /></span>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://i.fanpix.net/images/orig/n/j/njndfqi4ppegnjfe.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="http://i.fanpix.net/images/orig/n/j/njndfqi4ppegnjfe.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Dave Lombardo style. Well, almost. :P </td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />
We used arrays along with the function <a href="http://arduino.cc/en/Reference/Millis" target="_blank">millis()</a> which really increased the response of the drum kit and allowed us to play Slayer songs. Almost.<br />
<br />
<blockquote class="tr_bq">
</blockquote>
<blockquote class="tr_bq">
</blockquote>
<br />
<br />
<br />
<div style="text-align: left;">
<br />
<br />
<br />
<br />
A few things that we wanted to add were: </div>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li>A button on one of the sticks that when pressed, would play a pre-recorded drum roll.</li>
<li>A crash cymbal sound when the hi-hat stick is swung a bit harder [the code was also written, but it was still a bit fickle and we could never get it right, so that one line is commented out].</li>
<li>A more responsive bass pedal.</li>
<li>A ride sound when the stick is swung in the X direction. This we could never get right because it was happening even when the stick was swung in the Z direction. </li>
</ul>
<br />
<br />
<div style="text-align: left;">
<br /></div>
<br />
And that's it, so try it out and if you have any questions about the code, about the concept, criticisms on the blog or any feedback, really, please leave a post or send us an e-mail at blimptech2012@gmail.com<br />
<br />
Sorry I couldn't post a demonstration video.. None of us are drummers, all of us are guitarists, actually, we'll make one as soon as we get our hands on a kickass drummer. :D<br />
Thanks for reading and happy drumming!!!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://cache.gawkerassets.com/assets/images/2010/10/custom_1286555358292_awesome.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://cache.gawkerassets.com/assets/images/2010/10/custom_1286555358292_awesome.jpg" height="256" width="320" /></a></div>
<br />
<br />
- Bhargav<br />
<br />
PS: If you have an interesting project or idea, or recommendations for our next project, do share it with us, we would love to hear it!</div>
Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com15tag:blogger.com,1999:blog-6994047180285944937.post-19169889747519445232012-01-11T14:04:00.000-08:002012-01-11T14:14:36.913-08:00The Arduino Air Drums Part 1<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
The summer before, as all of us were getting excited to start our specific engineering courses, Vincent got us all excited about a prototyping board called the Arduino,<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-eLWJc0IEDWA/Tw3fMMKirjI/AAAAAAAAABM/czGSUalBAw8/s1600/arduino_uno_test.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="http://1.bp.blogspot.com/-eLWJc0IEDWA/Tw3fMMKirjI/AAAAAAAAABM/czGSUalBAw8/s200/arduino_uno_test.jpg" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
using which, microprocessor programming is made really easy! They have their own simplified coding language based on C and the editing platform is up for free download. Read it all up on their website: <a href="http://www.arduino.cc/" target="_blank">http://www.arduino.cc/</a><br />
<br />
And one of the videos that caught our eye was <a href="http://www.youtube.com/watch?v=jjvy_jzGlAQ" target="_blank">mmidgal's Arduino Air Drums</a>.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-53BYXTMxc7o/Tw3jSHwbERI/AAAAAAAAABU/aXAx59tDyw8/s1600/Air+Drums.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="180" src="http://4.bp.blogspot.com/-53BYXTMxc7o/Tw3jSHwbERI/AAAAAAAAABU/aXAx59tDyw8/s320/Air+Drums.JPG" width="320" /></a></div>
<br />
He had constructed a 3 piece drum kit with 4 sounds using a MIDI interface, 3 accelerometers, a Photocell, some USB ports, two garden rakes and a couple of slippers. All in an afternoon, according to <a href="http://gizmodo.com/5826298/this-guy-can-play-drums-on-thin-air" target="_blank">Gizmodo</a>. [which we SERIOUSLY doubt because it took us a little over a week]<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-aEftqXXvTX8/Tw3mFSxk8TI/AAAAAAAAABc/dzvPYuV1myY/s1600/Bart-is-playing-on-drums-coloring-page.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://2.bp.blogspot.com/-aEftqXXvTX8/Tw3mFSxk8TI/AAAAAAAAABc/dzvPYuV1myY/s1600/Bart-is-playing-on-drums-coloring-page.gif" /></a></div>
Shyam came up with the idea a couple of weeks before our semester end exams, and I was a little skeptical at first, but then I remembered my dream of always wanting to play kickass drums. Because, lets face it, drums are cool. Maybe not as cool as guitars, but still, pretty cool. <br />
<br />
<br />
So, on day 1, Shyam and I make our way to Malleshwaram, to meet at Akshay's house. We decided everything that we needed to get, and set our budget at around 4k and left to<br />
<div style="text-align: center;">
<i>SP Road. </i></div>
<div style="text-align: left;">
<i><br /></i></div>
<div style="text-align: left;">
So, here comes the slightly technical bits: </div>
<div style="text-align: left;">
Stuff we bought were: </div>
<div style="text-align: left;">
1. The Arduino Uno</div>
<div style="text-align: left;">
2. ADXL335 accelerometers [x3]</div>
<div style="text-align: left;">
3. USB cables [x4] </div>
<div style="text-align: left;">
4. USB females [x8]</div>
<div style="text-align: left;">
5. 5 pin DIN connector </div>
<div style="text-align: left;">
6. A no-company-comes-without-a-box MIDI to USB converter for Rs. 8oo, because the M-Audio Uno that the mmidgal recommends is 2.7k. lol. </div>
<div style="text-align: left;">
7. A bunch of Photocells (they cost about Rs. 5 a piece, so we thought we'd build a keyboard later with them)<br />
<br /></div>
<div style="text-align: left;">
All these items we bought, solely on the recommendation of the video and we didn't realize that some of them might be not necessary. Like the DIN connector and the MIDI to USB converter cable. :|</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Okay, before we continue, a little introduction into MIDI: </div>
<div style="text-align: left;">
<br /></div>
<blockquote class="tr_bq">
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i>MIDI (Musical Instrument Digital Interface) uses a form of serial to communicate at a data rate of 31250 bps with each byte made of 8 bits plus a stop and start bit. MIDI commands are most often three bytes in length but sometimes more or less. The Serial-MIDI converter currently only handles three byte MIDI commands.</i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i><br /></i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i>The first byte is called the Status byte and contains both the type of MIDI command and the channel number. The high nibble of this byte tells the MIDI device what it is doing, such as Note Off, Note ON, Control change etc... The low nibble is the channel, it is used to differentiate between devices that are on the same MIDI bus and varies from 0 to 15.</i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i><br /></i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i>The second byte is the Pitch byte and is simply the note being played, stopped, altered etc... This byte is in the range of zero to 127.</i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0px; padding-top: 0px; text-decoration: none;">
<i><br /></i></div>
<div class="paragraph_style_2" style="-webkit-text-size-adjust: none; background-color: #f5f4f4; color: #484848; font-family: HelveticaNeue-Bold, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 20px; opacity: 1; padding-bottom: 0pt; padding-top: 0px; text-decoration: none;">
<i>The third byte (when used with Note-On or Note-Off) is the velocity, which is a form of volume for the note being played. Imagine that you hit a drum softly, then the velocity would be a low number, but if you really whaled on it then the velocity would be higher. This byte is also in the range of zero to 127.</i></div>
</blockquote>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
-<a href="http://spikenzielabs.com/SpikenzieLabs/Serial_MIDI.html" target="_blank">Spikenzie Labs</a> </div>
<div style="text-align: left;">
<i><br /></i></div>
<div style="text-align: left;">
And a little bit about the ADXL335 accelerometers: </div>
<blockquote class="tr_bq">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-NRcxKNlt1gQ/Tw3xIrwJ7UI/AAAAAAAAABk/wtuQh8WBkyY/s1600/ADXL335-sensor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="http://3.bp.blogspot.com/-NRcxKNlt1gQ/Tw3xIrwJ7UI/AAAAAAAAABk/wtuQh8WBkyY/s320/ADXL335-sensor.jpg" width="320" /></a></div>
<div style="background-color: white; color: #4a4a44; font-family: Georgia, Palatino, Times, 'MS Serif', serif; font-size: 12px; line-height: 22px;">
<i>Breakout board for the 3 axis ADXL335 from Analog Devices. This is the latest in a long, proven line of analog sensors - the holy grail of accelerometers. The ADXL335 is a triple axis accelerometer with extremely low noise and power consumption - only 320uA! The sensor has a full sensing range of +/-3g.</i></div>
<div style="background-color: white; color: #4a4a44; font-family: Georgia, Palatino, Times, 'MS Serif', serif; font-size: 12px; line-height: 22px;">
<i>There is no on-board regulation, provided power should be between 1.8 and 3.6VDC.</i></div>
<div style="background-color: white; color: #4a4a44; font-family: Georgia, Palatino, Times, 'MS Serif', serif; font-size: 12px; line-height: 22px;">
<i>Board comes fully assembled and tested with external components installed. The included 0.1uF capacitors set the bandwidth of each axis to 50Hz.</i></div>
</blockquote>
<div style="text-align: right;">
-<a href="http://www.sparkfun.com/products/9269" target="_blank">Sparkfun</a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
So all that it is is a little chip with an IC and a few capacitors on it. There are 6 terminals;</div>
<div style="text-align: left;">
VCC</div>
<div style="text-align: left;">
GND</div>
<div style="text-align: left;">
X OUT</div>
<div style="text-align: left;">
Y OUT </div>
<div style="text-align: left;">
Z OUT</div>
<div style="text-align: left;">
Self Test (ST)</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Which are pretty self explanatory, basically the value of the at the three output pins change when motion in their respective axis is carried out. And about the Self Test pin, the data sheet had this to say: </div>
<br />
<br />
<blockquote class="tr_bq">
<i>The ST pin controls the self-test feature. When this pin is set to VS, an electrostatic force is exerted on the accelerometer beam. The resulting movement of the beam allows the user to test if the accelerometer is functional.</i><i>The typical change in output </i><i>is −1.08 g (corresponding to −325 mV) in the X-axis, +1.08 g </i><i>(or +325 mV) on the Y-axis, and +1.83 g (or +550 mV) on the </i><i>Z-axis. This ST pin can be left open-circuit or connected to </i><i>common (COM) in normal use. </i></blockquote>
<blockquote class="tr_bq">
</blockquote>
er.. WE CAN LEAVE IT OPEN!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-OmwKe4CmhQQ/Tw32YWL-YDI/AAAAAAAAABs/ugz45kd_Gtg/s1600/serious_cat_yay.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="http://1.bp.blogspot.com/-OmwKe4CmhQQ/Tw32YWL-YDI/AAAAAAAAABs/ugz45kd_Gtg/s200/serious_cat_yay.jpg" width="200" /></a></div>
<br />
<br />
<blockquote class="tr_bq">
The acclerometer that we used were built by <a href="http://www.nskelectronics.in/" target="_blank">NSK Electronics</a>, and the board said that that the supply voltage should be 5V. We rarely experienced any overheating problems and pretty faithful responses to movement. One gripe that we did have was when we moved the accelerometer in the Z direction, there was a change in signal coming from the YOUT pin which made it hard for us to program the ride sound. </blockquote>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i><br /></i></div>
<div style="text-align: center;">
<i>Okay that's all cool, but how the hell are we going to connect them to the Arduino?!?</i> </div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The cool thing about the Arduino Uno is that it has a set of analog and digital pins that can be used for either outputs or reading inputs! A very simple example is illustrated in the Arduino website: <a href="http://arduino.cc/en/Tutorial/AnalogInput" target="_blank">Analog Input Digital Output</a>.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
All we had to do was hook up the 5V pin and GND pin on the Arduino to two lines on our breadboard and use those to feed our Accelerometers. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-0CbhG7Z4vEs/Tw35dhcLmcI/AAAAAAAAAB0/2OeFqxbJMKE/s1600/Untitled+Sketch+2_bb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="http://2.bp.blogspot.com/-0CbhG7Z4vEs/Tw35dhcLmcI/AAAAAAAAAB0/2OeFqxbJMKE/s400/Untitled+Sketch+2_bb.jpg" width="400" /></a></div>
<div style="text-align: left;">
The readings from our Accelerometers have to be fed into the analog inputs on the Arduino to be read, so, we chose the Z axis as the one we're going to use for everything and hooked those up to the bread board and the Arduino. </div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-cMU42BxAQbE/Tw36RRx4E2I/AAAAAAAAAB8/ygmPo2Lr9nw/s1600/Arduino+Air+Drums_bb2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="http://4.bp.blogspot.com/-cMU42BxAQbE/Tw36RRx4E2I/AAAAAAAAAB8/ygmPo2Lr9nw/s400/Arduino+Air+Drums_bb2.jpg" width="400" /></a></div>
<div style="text-align: left;">
<br /></div>
[Sorry about the messy diagrams, we're still learning how to use <a href="http://fritzing.org/" target="_blank">Fritzing</a>.]<br />
<br />
So now we have our inputs for the snare sound, the bass drum sound and the hi-hat sound.<br />
Lets add a photocell in a voltage divider configuration with a 47k resistor to help us decide whether the hi-hat accelerometer is going to play closed hi-hat or open hi-hat.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-50dO0b2dElY/Tw37emYeI6I/AAAAAAAAACE/E-mMA8lRMug/s1600/Arduino+Air+Drums_bb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="227" src="http://2.bp.blogspot.com/-50dO0b2dElY/Tw37emYeI6I/AAAAAAAAACE/E-mMA8lRMug/s400/Arduino+Air+Drums_bb.jpg" width="400" /></a></div>
<a href="http://www.instructables.com/id/Arduino-Expermentation-Kit-How-to-get-Started-wi/step11/Light-Photo-Resistors-CIRC09/" target="_blank">Here</a> is a neat instructable explaining how the voltage divider works.<br />
<br />
So that's, basically our circuit. We made use of USB cables and connectors to help manage all the wires, otherwise it would have been a HUGE mess!<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-LxsarxF6suY/Tw4ASgkuAjI/AAAAAAAAACM/MvTGhg_CBOE/s1600/P1090023.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://1.bp.blogspot.com/-LxsarxF6suY/Tw4ASgkuAjI/AAAAAAAAACM/MvTGhg_CBOE/s320/P1090023.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Be sure to remember the colours!<br />
<br />
<br /></td></tr>
</tbody></table>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-12rfXzooWHk/Tw4BmKfU1EI/AAAAAAAAACU/LIeVN9_IU-k/s1600/P1090037.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="212" src="http://4.bp.blogspot.com/-12rfXzooWHk/Tw4BmKfU1EI/AAAAAAAAACU/LIeVN9_IU-k/s320/P1090037.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And be sure to label them too!</td></tr>
</tbody></table>
<br />
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-svau0lPfCuU/Tw4B4IYyb9I/AAAAAAAAACk/kRNqn2DR2qA/s1600/P1090024.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="127" src="http://4.bp.blogspot.com/-svau0lPfCuU/Tw4B4IYyb9I/AAAAAAAAACk/kRNqn2DR2qA/s320/P1090024.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Secured the accelerometer to the drum sticks using lots<br />
and lots of sticky tape. Lots. </td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-Oly4YTCXAl0/Tw4BxqpewII/AAAAAAAAACc/Lp6lmFwL7DA/s1600/P1090025.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://2.bp.blogspot.com/-Oly4YTCXAl0/Tw4BxqpewII/AAAAAAAAACc/Lp6lmFwL7DA/s320/P1090025.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And buy plenty of different coloured wires, trust me, they<br />
are super useful. </td></tr>
</tbody></table>
<br />
<div style="text-align: center;">
Once you're done with the sticks, your circuit will look more or less like this: </div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-hDggc8c5hPQ/Tw4FB0l3UxI/AAAAAAAAACs/wO68IfZ6YS4/s1600/P1060009.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://3.bp.blogspot.com/-hDggc8c5hPQ/Tw4FB0l3UxI/AAAAAAAAACs/wO68IfZ6YS4/s320/P1060009.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The sticks we used were Tama Rhythmic Fire size 7A sticks.<br />
-_-</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://elliefreeman.files.wordpress.com/2011/05/hate-cat.jpg?w=300&h=242" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://elliefreeman.files.wordpress.com/2011/05/hate-cat.jpg?w=300&h=242" /></a>And hopefully you wouldn't look like: </div>
<div>
<br />
<div>
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
All that's left are the 'pedals' and programming, which I will be covering in the next blog post and we will hopefully be done with the demonstration video!! </div>
<div>
<br /></div>
<div>
-Bhargav</div>
</div>Blimphttp://www.blogger.com/profile/09679445584050962871noreply@blogger.com15