<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3046200768771576429</id><updated>2024-09-05T21:49:24.847-07:00</updated><title type='text'>My name is Yong Keong and I am an engineer.</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://engineeringisfun.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046200768771576429/posts/default'/><link rel='alternate' type='text/html' href='http://engineeringisfun.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3046200768771576429.post-8525394266063472084</id><published>2013-01-28T02:16:00.001-08:00</published><updated>2013-01-28T02:50:24.762-08:00</updated><title type='text'>Flying a syma helicopter from your keyboard, WASD style</title><content type='html'>Last December, I bought a &lt;a href=&quot;http://www.amazon.com/Rescue-Helicopter-Infrared-Controlled-S111G/dp/B004QZR4LI/ref=pd_bxgy_t_img_y&quot;&gt;SYMA S111G&lt;/a&gt; helicopter but quickly got bored of it. 

After I stopped playing with it, my girlfriend decided to give a shot at flying it but crashed it so often that the blades broke within 10 minutes. I thought her flying skills were really poor and decided to make flight control much easier to manage for her. I decided to make a control from a keyboard so that it was easier to fly the helicopter.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Summary of project:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Sending keystroke commands to an arduino, and using a LED set up to send infrared signals to the helicopter, instead of controlling it by the remote that came with it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Parts you need:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
SYMA S111G Helicopter ($25)&lt;br /&gt;
Arduino Microcontroller and cable to connect to PC ($30) &lt;br /&gt;
Infrared LEDs (Preferably bright ones)&lt;br /&gt;
Bipolar Junction Transistors (I used a 2N3904 NPN transistor)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Main idea:&lt;/b&gt;&lt;br /&gt;
I had to figure out how the remote communicates with the helicopter. After taking apart the remote, I measured the signal that was emitted through the infrared LEDs. The signal turned out to be a 38kHz signal. A quick search online showed that someone has decoded the signal protocol for syma helicopters already. The site is &lt;a href=&quot;http://www.mikekohn.net/micro/syma_s107_no_fly_zone.php&quot;&gt;http://www.mikekohn.net/micro/syma_s107_no_fly_zone.php&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Basically, I just have to interpret the keystroke commands to the keyboard, translate it into the remote&#39;s protocol (into bits and bytes), and have the arduino make the LED flash at 38kHz to transmit the message to the helicopter.&lt;br /&gt;
&lt;br /&gt;
Having played battlefield 3, counterstrike and other 1st person shooters, I decided to use WASD to control the directions of the helicopter. I used K to increase the throttle speed, L to decrease it, and M to turn the motor on or off suddenly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;For the electronics geeks:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;b&gt;1. &lt;/b&gt;The protocol is carried on a 38kHz square wave. Each period is about 26 microseconds, with a duty cycle of 50%.&lt;br /&gt;
&lt;b&gt;2. &lt;/b&gt;A 0 is transmitted by 0.3ms on, 0.3ms off. &lt;br /&gt;
&lt;b&gt;3. &lt;/b&gt;A 1 is transmitted by a 0.3ms on, 0.6ms off.&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; Each message consists of a 2ms on, 2ms off header, followed by 4 bytes of data and a 0.36ms on footer.&lt;br /&gt;
&lt;b&gt;5.&lt;/b&gt; Byte 0 is the yaw data. 00111111 or 63 in decimal is the neutral yaw point. A higher number is to turn left, a lower number is to turn right. The MSB should be transmitted first, LSB last.&lt;br /&gt;
&lt;b&gt;6.&lt;/b&gt; Byte 1 is the pitch data. 00111111 or 63 in decimal is the neutral pitch point. A lower number is to pitch down (move forward) and a higher number is to pitch up (move backwards). Same as before, MSB transmitted first. Same goes for 7. and 8.&lt;br /&gt;
&lt;b&gt;7.&lt;/b&gt; Byte 2 is the throttle data. At full battery, a throttle speed of around 200 is hovering and slowly climbing up. You can see how your helicopter works with different battery levels and weights attached.&lt;br /&gt;
&lt;b&gt;8.&lt;/b&gt; Byte 3 is the trim data. Since my helicopter was working perfectly with 0 trim, I didn&#39;t have to try any number for this. You should experiment with yours to see what works best.&lt;br /&gt;
&lt;b&gt;9.&lt;/b&gt; The time between the start of two messages is 120ms.&lt;br /&gt;
&lt;b&gt;10.&lt;/b&gt; The schematic is shown here&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtb-R9-UifEyxNy11DcsHgr5TVZmoChML2G3BYy26KmEQ7DsCkLqvLr7RPIG_z5Sg1wDTphc_5CCT41tc5LyYFTcJJyGzMHSCBPgKSlm7bMq3okwdVv0_XBVK2Yo3wEjsjnzb9x6E88C0/s1600/Untitled.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtb-R9-UifEyxNy11DcsHgr5TVZmoChML2G3BYy26KmEQ7DsCkLqvLr7RPIG_z5Sg1wDTphc_5CCT41tc5LyYFTcJJyGzMHSCBPgKSlm7bMq3okwdVv0_XBVK2Yo3wEjsjnzb9x6E88C0/s320/Untitled.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
9V is quite high for the operation of this circuit, but given that pin 12 of the arduino gives 5V when high, I wanted to be on the safe side of having the transistor in forward active mode. If you have trouble and burn out the LED, maybe consider adding a 100 ohm resistor in series with the LED. &lt;br /&gt;
&lt;br /&gt;
If you want to take a look at my code, feel free to contact me and I will get back to you in a few days.&lt;br /&gt;
&lt;br /&gt;
I will add pictures over the next few days.&lt;br /&gt;
&lt;br /&gt;
Note: Somebody has actually created a similar project before me, and I 
tried to use his code. However, I couldn&#39;t understand some segments of 
how his code flows, so I changed the way the code controlled the 
helicopter. Other than that, I used the skeleton of his code. You can 
view his project at &lt;a href=&quot;http://www.avergottini.com/2011/05/arduino-helicopter-infrared-controller.html&quot;&gt;http://www.avergottini.com/2011/05/arduino-helicopter-infrared-controller.html&lt;/a&gt; </content><link rel='replies' type='application/atom+xml' href='http://engineeringisfun.blogspot.com/feeds/8525394266063472084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://engineeringisfun.blogspot.com/2013/01/flying-syma-helicopter-from-your.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3046200768771576429/posts/default/8525394266063472084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046200768771576429/posts/default/8525394266063472084'/><link rel='alternate' type='text/html' href='http://engineeringisfun.blogspot.com/2013/01/flying-syma-helicopter-from-your.html' title='Flying a syma helicopter from your keyboard, WASD style'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtb-R9-UifEyxNy11DcsHgr5TVZmoChML2G3BYy26KmEQ7DsCkLqvLr7RPIG_z5Sg1wDTphc_5CCT41tc5LyYFTcJJyGzMHSCBPgKSlm7bMq3okwdVv0_XBVK2Yo3wEjsjnzb9x6E88C0/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>2</thr:total></entry></feed>