tag:blogger.com,1999:blog-39754192638423091382024-03-19T05:12:38.437-07:00Arduino blog by Niki AhlskogThis page is a random collection of notes addressed to myself. Nothing here is intended as a guide per say, however i have posted them hoping that it may help someone.
Blog about Arduino
http://arduino.cc/
Everything in this blog can be copied or edited GNU General Public License (version 2 or newer) http://www.gnu.org/licenses/gpl.htmlUnknownnoreply@blogger.comBlogger18125tag:blogger.com,1999:blog-3975419263842309138.post-88598287510998646632018-02-05T11:42:00.001-08:002018-02-06T12:49:32.774-08:00Arduino Nano Powered Space rocketIt's been a while since I last time played with Arduino. I got nice idea before Christmas that I would like to create a space rocket which is powered with Arduino for a kid. Original idea was to make it inside kitchen roll, but eventually I decided to do it inside 1,5 liter Coca-Cola bottle. The project started about getting all the equipment I would need.<br />
<br />
1. Arduino Nano (small enough)<br />
2. Wires<br />
3. LCD Matrix<br />
4. Buttons<br />
5. Power (9v battery case)<br />
6. Led lights<br />
7. Buzzer<br />
8. Resistors<br />
<br />
I wanted the spaceship to have cool blinking led lights, play some audio and also something to "toggle". I decided to do the toggle with button and LCD matrix. Project started by trying the Tone library on my Arduino Uno as it is easier to connect cables in it. I found some cool star wars songs for the tone library and decided to use "the cantina song" as my space ship sound. I have explained how to use the tone library in the previous post, but basically it is just like this:<br />
<span style="background-color: #f7f9f9; font-family: "typonine mono regular" , "lucida grande" , "lucida" , "verdana" , sans-serif; font-size: 14px; letter-spacing: 0.5px;"><br /></span>
<span style="background-color: #f7f9f9; font-family: "typonine mono regular" , "lucida grande" , "lucida" , "verdana" , sans-serif; font-size: 14px; letter-spacing: 0.5px;">tone(pin, frequency, duration)</span><br />
<span style="background-color: #f7f9f9; font-family: "typonine mono regular" , "lucida grande" , "lucida" , "verdana" , sans-serif; font-size: 14px; letter-spacing: 0.5px;"><br /></span>
I found Star Wars Cantina song from Google Docs file someone had uploaded so I decided to upload it to GitHub, find the song here: https://github.com/shnigi/arduino-space-ship/blob/master/Star_wars_cantina_song.ino<br />
<br />
After checking with Arduino Uno that my program works I started to assemble everything. First I had to solder those small pins on the Arduino Nano board. I had to be very careful not to overheat the pins as it can break the whole board.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJHjlLyUzq180tflS-Oj15yDSinb94-vrqyPAVnrj7mqzQE71M4hyphenhypheneCLhH7wlagcKjnU72pbjxkeYD-F1p1d4MmWzqN7csgpWUJvYb2WdiYOamtq_Y3msxIpVUT4gVSh9O5I4aXQuWY-w/s1600/IMG_20171220_212844.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJHjlLyUzq180tflS-Oj15yDSinb94-vrqyPAVnrj7mqzQE71M4hyphenhypheneCLhH7wlagcKjnU72pbjxkeYD-F1p1d4MmWzqN7csgpWUJvYb2WdiYOamtq_Y3msxIpVUT4gVSh9O5I4aXQuWY-w/s640/IMG_20171220_212844.jpg" width="640" /></a></div>
<br />
Then I connected LCD matrix<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ffDNv_xUuiY8b_st8kDQUd84y10mBWxtdKNee_wMQbGt8gkjXSeS2YwqbMjxlJ2R1DrRDgcXmTbBUKck1h8_18120E1sDYaT6-eC1hDr7Wz0E_gVt1bhGP_Dqxqq5VulM4avN6SG3LE/s1600/IMG_20171223_144236.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ffDNv_xUuiY8b_st8kDQUd84y10mBWxtdKNee_wMQbGt8gkjXSeS2YwqbMjxlJ2R1DrRDgcXmTbBUKck1h8_18120E1sDYaT6-eC1hDr7Wz0E_gVt1bhGP_Dqxqq5VulM4avN6SG3LE/s640/IMG_20171223_144236.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisjWTr9PjU6Ze5QlntwJjz_RZ3g7g6UuP1aQRzrdePGHKCFMXSz8qTfcRAam9grbObYkdiKfDhdO3uHY9rjO2vxR1dQoT1Dk68cST1Ky9fmkFGVf-odnmAFews7tZb9KaK9XZ4MyowdZc/s1600/IMG_20171223_144238.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisjWTr9PjU6Ze5QlntwJjz_RZ3g7g6UuP1aQRzrdePGHKCFMXSz8qTfcRAam9grbObYkdiKfDhdO3uHY9rjO2vxR1dQoT1Dk68cST1Ky9fmkFGVf-odnmAFews7tZb9KaK9XZ4MyowdZc/s640/IMG_20171223_144238.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx18tvGbQ2vypf5-hgHjXZ0aqGkFROd7brXd1lU9uGWKq0jw2Bdm545jsnJJhFHBDP8p3yhItd88IcZplLHN3Q7n61azH9UfcDk4T8uq8dJ4xNfqbMPLt4q3HL23bsKSHKcxWzTkquIEg/s1600/IMG_20171223_144705.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx18tvGbQ2vypf5-hgHjXZ0aqGkFROd7brXd1lU9uGWKq0jw2Bdm545jsnJJhFHBDP8p3yhItd88IcZplLHN3Q7n61azH9UfcDk4T8uq8dJ4xNfqbMPLt4q3HL23bsKSHKcxWzTkquIEg/s640/IMG_20171223_144705.jpg" width="640" /></a></div>
<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="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji3paUXbG_KX2FP0g3bzRCzzAO2Lx1FPiOQypAhwZFpB4gXGmie7TyXEm_ixeNmP-CKFi-44feBEt-jxXPcE7dfGfBCufUR9t2AkCkJ_H_Q6NdhjlxTZyFmqRaN520o6rwqnK5y-1DM98/s1600/IMG_20171223_145723.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji3paUXbG_KX2FP0g3bzRCzzAO2Lx1FPiOQypAhwZFpB4gXGmie7TyXEm_ixeNmP-CKFi-44feBEt-jxXPcE7dfGfBCufUR9t2AkCkJ_H_Q6NdhjlxTZyFmqRaN520o6rwqnK5y-1DM98/s640/IMG_20171223_145723.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Soldering station.</td></tr>
</tbody></table>
Connecting the LCD module was pretty easy with 5 different pins. To operate the module you will need LedControl library: https://github.com/wayoda/LedControl led matrix patterns can be generated online: http://robojax.com/learn/arduino/8x8LED/ Basically it is just a 1 for ON and 0 OFF. And then it can be written to the LCD as an array.<br />
<br />
<br />
byte ALL[8]={B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111};<br />
<br />
void writeMatrixAll() {<br />
for(int i=0; i<8; i++){<br />
lc.setRow(0,i,0);// this is for blank<br />
}<br />
<br />
for (int i=0; i<8; i++){<br />
lc.setRow(0,i,ALL[i]);<br />
}<br />
}<br />
<div>
<br /></div>
<div>
You define which leds on each row should be turned on, then clear the display first and after that just loop through all the rows and turn on lights. </div>
<div>
<br /></div>
<div>
I wanted the space rocket to have 9V battery as its power source since its pretty easy to find such batteries. I also happened to own a 9v battery case with proper wiring and a button to turn on or off.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOd5hpC0aaZjK7ysi1ypsFc38XgsX45NZgHmVtbtVitfOudBzfSbGoS5a4Wg5qzfnNzRZhW1KP_NEhUpcigaxk12mEAKItgWjVfWXz-fHsJKiMVPspQlp3wmSBvQ6tEHv24lF6rU2NP-U/s1600/IMG_20171223_153323.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOd5hpC0aaZjK7ysi1ypsFc38XgsX45NZgHmVtbtVitfOudBzfSbGoS5a4Wg5qzfnNzRZhW1KP_NEhUpcigaxk12mEAKItgWjVfWXz-fHsJKiMVPspQlp3wmSBvQ6tEHv24lF6rU2NP-U/s640/IMG_20171223_153323.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiszAUhaNPt2lbTBC_Y7NXy8Ef_WSJY_hRApEsi6kRbvYpAojtXwZE-zP6cUmbC-EYoJ-APpmTcyiTgRpzkb4EXZaufxLl0nc2Akbu0mDGkVu4KodOofutagdVet0lZHGztSHIH_8f5dgM/s1600/IMG_20171223_153328.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiszAUhaNPt2lbTBC_Y7NXy8Ef_WSJY_hRApEsi6kRbvYpAojtXwZE-zP6cUmbC-EYoJ-APpmTcyiTgRpzkb4EXZaufxLl0nc2Akbu0mDGkVu4KodOofutagdVet0lZHGztSHIH_8f5dgM/s640/IMG_20171223_153328.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Arduino Nano can be powered with 9V battery by connecting the cables to Ground and VIN = Voltage In. I also added a button to control the led matrix. Because Arduino is only a stupid circuit controller and can basically do only one thing at a time, I created the code so that between the notes I will check if the button variable has changed. Whole code is available on GitHub: https://github.com/shnigi/arduino-space-ship/blob/master/Avaruusraketti.ino</div>
<div>
<br /></div>
<div>
After soldering everything together I added some hot glue to parts which needed more strength. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdFzP1GMpIdhUL8RMhB0RiWFvLcsHvhjyZOwCPvPGHvvgK1JS4UByjmu_4mWqhjt0vuGw_DX4zYwfE5G34h4DoyiL-HEgE3JxdUNHcgmwhfFxg47MoslYWYRfGd9Yq8qA4gSsmaXjFh2s/s1600/IMG_20171223_154745.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdFzP1GMpIdhUL8RMhB0RiWFvLcsHvhjyZOwCPvPGHvvgK1JS4UByjmu_4mWqhjt0vuGw_DX4zYwfE5G34h4DoyiL-HEgE3JxdUNHcgmwhfFxg47MoslYWYRfGd9Yq8qA4gSsmaXjFh2s/s640/IMG_20171223_154745.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjXu7ECnbFsGGXed43ZWLiXQiU_eP3rMRzMYDucWBQ7OAXfN3SaWWtT-pMV3If-QiLQ94POZTSBc2ohrQ4Aq3XEspEnHACsSJ05uDb3nifndgC9RRuhNguhdn4GPA8D3lJ8CjzeiLqGU/s1600/IMG_20171223_161125.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTjXu7ECnbFsGGXed43ZWLiXQiU_eP3rMRzMYDucWBQ7OAXfN3SaWWtT-pMV3If-QiLQ94POZTSBc2ohrQ4Aq3XEspEnHACsSJ05uDb3nifndgC9RRuhNguhdn4GPA8D3lJ8CjzeiLqGU/s640/IMG_20171223_161125.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNe87unex36lYxz2sMADG0O7UVEfXHfs80ReCZ0_SPnNrLgR-7XjQ5EnD-28f_ACYcW6GJeWaq8lDGRmlEiCSCvjX5NLF0rFGElMGx8Ft16ZHdwt0JOxfKoRBUtxfDzXMun3-XY1YiC2Y/s1600/IMG_20171223_161129.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNe87unex36lYxz2sMADG0O7UVEfXHfs80ReCZ0_SPnNrLgR-7XjQ5EnD-28f_ACYcW6GJeWaq8lDGRmlEiCSCvjX5NLF0rFGElMGx8Ft16ZHdwt0JOxfKoRBUtxfDzXMun3-XY1YiC2Y/s640/IMG_20171223_161129.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Also a red led light was put on the top of the soda bottle. After everything was glued and soldered I started to put everything inside the bottle and strenghtened it with a styrofoam support structure. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB2PkaWgopQWYGePaFfxPQ6ip0h54glFbgze0YdxpTIOlY5gajwbLsCXm2WDW2DkrjcZQ1zOaq1hFnEOm5qADsgD-lk2QUfPsYE7q5_Po0Soxhedsjs4AT3auDT4ofP_ZJUT8wpD4stSQ/s1600/IMG_20171223_163312.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB2PkaWgopQWYGePaFfxPQ6ip0h54glFbgze0YdxpTIOlY5gajwbLsCXm2WDW2DkrjcZQ1zOaq1hFnEOm5qADsgD-lk2QUfPsYE7q5_Po0Soxhedsjs4AT3auDT4ofP_ZJUT8wpD4stSQ/s640/IMG_20171223_163312.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg__er0-PYkbb3TEWpwTVlDRvZkqtaQvDeNQR0oTOaXG3bNDDLquDwcbs30-jRm6F9_H_D3ZrWYj_vsJbmcZ53pSIdPyosx2gvDIdfkWxH5Rf3MLaixKzkWrnDH8l_bZ5NkrZPzzeEx8AY/s1600/IMG_20171223_163314.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg__er0-PYkbb3TEWpwTVlDRvZkqtaQvDeNQR0oTOaXG3bNDDLquDwcbs30-jRm6F9_H_D3ZrWYj_vsJbmcZ53pSIdPyosx2gvDIdfkWxH5Rf3MLaixKzkWrnDH8l_bZ5NkrZPzzeEx8AY/s640/IMG_20171223_163314.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnQ6gwUMOAX282BaZxd66wuzn5jELb7H5b5fn258o2FfcMr60vXzTfbTzTqUMX25AYx-rrejUzaOE7QqXx5MM70y67wP_T21Cqyo4-m3xwT8VGfabdUaZyD_QBn7vrbnQFkbZ6cuwBBns/s1600/IMG_20171223_170619.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="800" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnQ6gwUMOAX282BaZxd66wuzn5jELb7H5b5fn258o2FfcMr60vXzTfbTzTqUMX25AYx-rrejUzaOE7QqXx5MM70y67wP_T21Cqyo4-m3xwT8VGfabdUaZyD_QBn7vrbnQFkbZ6cuwBBns/s640/IMG_20171223_170619.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9DmjFw1FD3peQ6GaBMuY102kSRG4gu3nc19_W7EWLJNTAaGdryz32iQ-4Q5T0aD35AI6JlaxcsY2mO02JMRPqFRF7o_L7ZqAceq3sYvXTxY-ukE162Xrbsbu_iOwO6tJVMzFbkeelkws/s1600/IMG_20171223_175120.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="800" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9DmjFw1FD3peQ6GaBMuY102kSRG4gu3nc19_W7EWLJNTAaGdryz32iQ-4Q5T0aD35AI6JlaxcsY2mO02JMRPqFRF7o_L7ZqAceq3sYvXTxY-ukE162Xrbsbu_iOwO6tJVMzFbkeelkws/s640/IMG_20171223_175120.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
Buzzer, LCD matrix, button, 9V battery, led light and Arduino Uno inside 1,5 liter plastic bottle. Finally I just taped to bottom back to its place and decided to add some cardboard wings to make it super cool.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivs2J62Adv0L6yDuQHpHCCHyEEKOhmwzG8Br1k4IgxvWaGs9FkhQhSwbdDTClff77-dIIfiqoFtLWuk5UcPNjn-k0rAUbWAqTMrqjKUqNRPoyx_hfnMhn59JBj5p76Jx2yo_O4SBrAbg4/s1600/IMG_20171223_180255.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivs2J62Adv0L6yDuQHpHCCHyEEKOhmwzG8Br1k4IgxvWaGs9FkhQhSwbdDTClff77-dIIfiqoFtLWuk5UcPNjn-k0rAUbWAqTMrqjKUqNRPoyx_hfnMhn59JBj5p76Jx2yo_O4SBrAbg4/s640/IMG_20171223_180255.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1vWaMEyeJPgncYHvHWCzTwOtsdckbQnUXI4VSPm7fB_9YYEYfTB6rMGemc-NgNc-6vH7jZ6k-3CCnv4GZq8emb19CfeNahGPxrckawS6fdLHUuc7qX8mcmgsiXEiWN49R7OwwAuHEcZU/s1600/IMG_20171223_180310.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1vWaMEyeJPgncYHvHWCzTwOtsdckbQnUXI4VSPm7fB_9YYEYfTB6rMGemc-NgNc-6vH7jZ6k-3CCnv4GZq8emb19CfeNahGPxrckawS6fdLHUuc7qX8mcmgsiXEiWN49R7OwwAuHEcZU/s640/IMG_20171223_180310.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
The rocket is now assembled and decorated, ready for painting. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpftiF5OvJUX_PUhWngJiFKiJiSzGsKx4KWbdlV9vlKCZ13BfJ7dklg9JuN_slLeD2oeFSs7D5Vdp1ZM5pur6PsNhzC2CQsWaDpg8AcFd1PtyWYuN8Y9S5rTnV6duNTKAcLgK3RYHFNUI/s1600/IMG_20171224_184336.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="800" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpftiF5OvJUX_PUhWngJiFKiJiSzGsKx4KWbdlV9vlKCZ13BfJ7dklg9JuN_slLeD2oeFSs7D5Vdp1ZM5pur6PsNhzC2CQsWaDpg8AcFd1PtyWYuN8Y9S5rTnV6duNTKAcLgK3RYHFNUI/s640/IMG_20171224_184336.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVez0Al-1O4CwofBDJ-i6W9XMu8sNB5dDmnGkSXA_uGtjY0REHyKLW7lGHJimULfa7IQ2TFe59IPzTvNP2QbpGxRr0C7zryxcHudEHSAyNEqStlDX6JC1ICIqev61SiZYzALQ6I7h1Hbk/s1600/IMG_20171225_113639.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVez0Al-1O4CwofBDJ-i6W9XMu8sNB5dDmnGkSXA_uGtjY0REHyKLW7lGHJimULfa7IQ2TFe59IPzTvNP2QbpGxRr0C7zryxcHudEHSAyNEqStlDX6JC1ICIqev61SiZYzALQ6I7h1Hbk/s640/IMG_20171225_113639.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
And after painting its a nice silver rocket which makes Star Wars sound and has LCD led display!</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/UfHFjUaNg6Q/0.jpg" src="https://www.youtube.com/embed/UfHFjUaNg6Q?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
As you can see the button doesn't work all the time as the variable checking is done between the notes. It is anyway good for a kid =)</div>
<div>
<br /></div>
<div>
<b>Parts:</b> about 20$</div>
<div>
<b>Programming:</b> 2-3 hours</div>
<div>
<b>Finding tutorials: </b>button and LCD matrix, 6 hours</div>
<div>
<b>Source code: </b>https://github.com/shnigi/arduino-space-ship/blob/master/Avaruusraketti.ino</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-18391570696598411022013-03-31T13:15:00.002-07:002013-03-31T13:15:52.283-07:00Course finished - all kind of projectsArduino course is now finished and I hope that I will write here again some day. Here are some projects our course did.<br />
<br />
First on is push-up counter. It uses ultrasonic sensor to detect how close the doer is. Then it counts the amount of push-ups to the digital screen. It can be restarted with button. Simple, but works. No idea if someone needs this or not ?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOePYxptsUfo8GkCJTToXb1cwo7gSC60O-tqRJ7WfyfTo9v6X2sI-HVQnf4aLkRt2a_zx1Vl9Y4dK5_up1RPUN_37nfcQJOVaQXE5CNjlq0paI4w-7RbmUCbO48VktzonQGOwKa0X2cak/s1600/DSC_0001.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOePYxptsUfo8GkCJTToXb1cwo7gSC60O-tqRJ7WfyfTo9v6X2sI-HVQnf4aLkRt2a_zx1Vl9Y4dK5_up1RPUN_37nfcQJOVaQXE5CNjlq0paI4w-7RbmUCbO48VktzonQGOwKa0X2cak/s640/DSC_0001.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Second one is some kind of watch tower or big brother tower. It turns 180 degrees and scans the area. If it detects movement, it stops and turns a led light on. The original idea was to make kitchen lights turn on and off automatically.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOhfDEuV524Bm1ncMelDEMuet0wNmHUF0WtMvMA4yHTalm9GWs5BXZH4kfHPe1JspfkJ-mqJpLq5oeGwXpMxcH8e1mCo1IEmHtwW4Dr_mLCDzaVPndeqjPdBgTSqWA-GGp8W5W-2k8FwI/s1600/DSC_0002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOhfDEuV524Bm1ncMelDEMuet0wNmHUF0WtMvMA4yHTalm9GWs5BXZH4kfHPe1JspfkJ-mqJpLq5oeGwXpMxcH8e1mCo1IEmHtwW4Dr_mLCDzaVPndeqjPdBgTSqWA-GGp8W5W-2k8FwI/s640/DSC_0002.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Third one was interesting. A robot hand. It is made of plastic bottle and cardboard. Every finger is connected to one servo motor with a thread and when it moves the hand "grabs". The hand-guy first tried to make a 3D print of hand but it failed because software incompatibilities. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCuGAI4XctpkoB-Ufpeycx8sjENWLdXgPcJ5VS9cgMMVrc3X858-MxpyTdnQ1RrPMqaeHBkhuyeHTio4ueVOGpgTX-kn2WavW8onVAVl3LkmvIjKlY29G14SXShz_QVnCN4ieI6eGSW24/s1600/DSC_0003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCuGAI4XctpkoB-Ufpeycx8sjENWLdXgPcJ5VS9cgMMVrc3X858-MxpyTdnQ1RrPMqaeHBkhuyeHTio4ueVOGpgTX-kn2WavW8onVAVl3LkmvIjKlY29G14SXShz_QVnCN4ieI6eGSW24/s640/DSC_0003.jpg" width="640" /></a></div>
<br />
Last one was a flashlight button tester. It can be set to push forever the flashlight button, it tests if the light turns on and if not it calculates it as error. It didn't save any log file yet but it was under work. Very useful tool for flashlight producers i'd say.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXDpu7zkZokyNh5efGr3Wo90JCBvyNlLGEBveIoqdqil3CmKUo8QnEKUiZdrKTMJTny9ZjhdSEmUi80b9BHjZR1iHUkHlD5iNZiUXfqM5m1towKq9k7lwbqtRzQ03ed2468xSmsSXZZYw/s1600/DSC_0004.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXDpu7zkZokyNh5efGr3Wo90JCBvyNlLGEBveIoqdqil3CmKUo8QnEKUiZdrKTMJTny9ZjhdSEmUi80b9BHjZR1iHUkHlD5iNZiUXfqM5m1towKq9k7lwbqtRzQ03ed2468xSmsSXZZYw/s640/DSC_0004.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And my robot hat, teacher liked it. I got 4,5/5 points. That was very nice.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-37866963294104920052013-03-08T03:10:00.002-08:002013-03-10T13:13:29.331-07:00Final project, hat with ultrasonic sensor and sound warningAs my final project I got an idea about a hat which can talk to the user and guide example a blind guy to the right way and not to crash anything. Or one could solve a maze in complete darkness because the ultrasonic sensor. I first tried to make Arduino say something but it didn't succeed. Then I eased my project and thought maybe same kind of noise what car rear-view cameras make. I found Arduino Tone library. With that I managed to make Arduino Beep! Then I found a broken headset. I ripped the speaker elements out of it and soldered two wires to it. Then I connected the ultrasonic sensor which I got earlier hc-sr04 to Arduino, tested if it works and can measure the distance. I coded it to check if the distance is between three ranges. If the range is shorter than 30 centimeters it will beep very fast and warn the user that you are going to crash. If the distance is between 31 and 60 centimeters it will beep normal speed and it tells that it is safe to turn. If the distance is between 61 and 90 it beeps very slow to warn that you are approaching an obstacle. If the distance is bigger than 90 it stays silent. I think this was very fun project and of course interesting. Thanks to Tero Karvinen i'm now very excited about the Arduino and its possibilities. And then about the project.<br />
<br />
I first started to code the project by one piece at a time. First the ultrasonic sensor, then the beep sound and then connected those together. Here i'm currently in test environment.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBGsnUqN9rF3-eHf6QoRq9Aau9pTuP5t1uoTnD1uEsH30KdsnQYvM0ZIu_RUr2wG3JfdRF51qWcj-XY2LH2yC32W9OePFtdfCAJxb_9KS68OFfKvpuV1vTcxQT8rdXdrnBi90BFClyhC0/s1600/ohjelmointi.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBGsnUqN9rF3-eHf6QoRq9Aau9pTuP5t1uoTnD1uEsH30KdsnQYvM0ZIu_RUr2wG3JfdRF51qWcj-XY2LH2yC32W9OePFtdfCAJxb_9KS68OFfKvpuV1vTcxQT8rdXdrnBi90BFClyhC0/s640/ohjelmointi.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2tpAPcu8yR6cgXjgGQS78xH9bL9jiOetotym6Tn613FomnF1RHOw1YDSE7x7MXEuFzR-9BWXMIYAsqN6QSoNguW47NgXisWNn_xLTk8r6QEMlRREYw_yMWIdkIx0YgIjPVplidxVwqPQ/s1600/DSC_0002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2tpAPcu8yR6cgXjgGQS78xH9bL9jiOetotym6Tn613FomnF1RHOw1YDSE7x7MXEuFzR-9BWXMIYAsqN6QSoNguW47NgXisWNn_xLTk8r6QEMlRREYw_yMWIdkIx0YgIjPVplidxVwqPQ/s640/DSC_0002.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
Next I had to hot glue all the parts to an old peaked cap and solder few wires together.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXliurUzXRTrZ8eS7IIGLs3IOd8Y_Qa6y0Ed-xaBNRP4qy0jbtuFCN1d8UbOFiZLLgMCyDOd7d6UTu-YhvOVxbSF1GLZaViKEGNzdZTRslsrC_BQLYHRtg-cLYRslk4vy3fd-wEA9VnZQ/s1600/kolvaus.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXliurUzXRTrZ8eS7IIGLs3IOd8Y_Qa6y0Ed-xaBNRP4qy0jbtuFCN1d8UbOFiZLLgMCyDOd7d6UTu-YhvOVxbSF1GLZaViKEGNzdZTRslsrC_BQLYHRtg-cLYRslk4vy3fd-wEA9VnZQ/s640/kolvaus.jpg" width="640" /></a></div>
<br />
Then I tested if the parts still work without computer test environment and it didn't. I had to change the speaker connection a little bit and then it worked. Here is the final ultrasonic hat. The battery plus wire was too short but it is just long enough to work.<br />
<br />
Testing phase for distance and beep to function correctly together.<br />
<br />
<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/m7bbfzZ2UNo?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And here it is. The final version of my prototype hat for the blind people or drunk people or what ever.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKNWdzqBtyS4hZe_ndZhYLwqrHJwnxpGcjcrnkH_6jmtIFqirhkPq9a5xlp4pqCgPmKWMCtQqriEDrvHTJ4T_epr5frnUODEBLkLUiIRH3LgGKsHOA1CJD0yXK0Cy22fFbzPRczwOt1uI/s1600/final.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKNWdzqBtyS4hZe_ndZhYLwqrHJwnxpGcjcrnkH_6jmtIFqirhkPq9a5xlp4pqCgPmKWMCtQqriEDrvHTJ4T_epr5frnUODEBLkLUiIRH3LgGKsHOA1CJD0yXK0Cy22fFbzPRczwOt1uI/s640/final.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA5SjnSzrn0J4REK2XMcgHij50v9542s1lhMHHNtXhb8H91rsouyiyN_xm4r_IBt5dBFGXHjWeLzcjOqANRVsTGUZSVWsWivhJkzJIPtBpc6l4qoIR5VfgUG7IbwN62hAAZM_wna0dprY/s1600/final2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="596" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA5SjnSzrn0J4REK2XMcgHij50v9542s1lhMHHNtXhb8H91rsouyiyN_xm4r_IBt5dBFGXHjWeLzcjOqANRVsTGUZSVWsWivhJkzJIPtBpc6l4qoIR5VfgUG7IbwN62hAAZM_wna0dprY/s640/final2.jpg" width="640" /></a></div>
<br />
<br />
And how I coded it ? Here is the whole code.<br />
<br />
Connection like in ultrasonic sensor post and tone post. hc-sr04 vcc to +5v, gnd to gnd, trig to pin 12, echo to pin 13. Speaker element goes to ground and digital pin 8.<br />
<br />
//define the pins for ultrasonic sensor here<br />
#define trigPin 12<br />
#define echoPin 13<br />
<br />
//setup trig is output and echo is input for the sound. Read serial fastest possible speed<br />
void setup() {<br />
Serial.begin (115200);<br />
pinMode(trigPin, OUTPUT);<br />
pinMode(echoPin, INPUT);<br />
}<br />
<br />
//below methods for beep speed<br />
void beepFast(){<br />
// play a note on pin 8 for 200 ms:<br />
tone(8, 440, 200);<br />
delay(50);<br />
// turn off tone function for pin 8:<br />
noTone(8);<br />
delay(300);<br />
}<br />
<br />
void beepSlow(){<br />
tone(8, 440, 200);<br />
delay(500);<br />
noTone(8);<br />
delay(300);<br />
}<br />
<br />
void beepMedium(){<br />
tone(8, 440, 200);<br />
delay(200);<br />
noTone(8);<br />
delay(300);<br />
}<br />
<br />
//no beep here<br />
void beepNo(){<br />
noTone(8);<br />
delay(300);<br />
}<br />
<br />
//send a pulse and calculate how long it took to travel<br />
void loop() { <br />
int duration, distance;<br />
digitalWrite(trigPin, HIGH);<br />
delayMicroseconds(1000);<br />
digitalWrite(trigPin, LOW);<br />
duration = pulseIn(echoPin, HIGH);<br />
distance = (duration/2) / 29.1;<br />
<br />
//then check the distance and beep if it is in the range<br />
if (distance >= 200 || distance <= 0){<br />
Serial.println("Out of range");<br />
}<br />
else if (distance >=0 && distance <=30){<br />
beepFast();<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
}<br />
else if (distance >=31 && distance <=60) {<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
beepMedium();<br />
}<br />
else if (distance >=61 && distance <= 90){<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
beepSlow();<br />
}<br />
else {<br />
beepNo();<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
}<br />
<br />
} <br />
<br />
And the guy behind this blog and random hat project...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiahsNkcjsfMFGKNLhvAv_WDfjQ8pmV20M7Wuq-y2qnbTiKSqrPbP_6dfR10hWoOrS4DlBRuMCKqFxXFPu47J6nQ5uQ3rnmHCLQhsfKsloZFcA0DPY-SNe8VTMwYYVFp2-E2QUA8h_PtGw/s1600/omistaja.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="524" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiahsNkcjsfMFGKNLhvAv_WDfjQ8pmV20M7Wuq-y2qnbTiKSqrPbP_6dfR10hWoOrS4DlBRuMCKqFxXFPu47J6nQ5uQ3rnmHCLQhsfKsloZFcA0DPY-SNe8VTMwYYVFp2-E2QUA8h_PtGw/s640/omistaja.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Testing phase. She managed to walk to the door from kitchen and back. Succeed.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/VgKhh2tub7g?feature=player_embedded' frameborder='0'></iframe></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
The project was fun to do and i'm proud that I managed to complete it. One thing more to add my portfolio.</div>
<br />Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-3975419263842309138.post-15195199805159902742013-03-07T11:13:00.002-08:002013-03-07T11:29:26.473-08:00Arduino DC motor car, total failBecause I got the dc motor work with Arduino I thought maybe I should build a car. The idea was good but the actual car was bad. DO NOT build a car with weak dc motor. It runs very slow because the DC motors are so weak and the controlling of motors is also bad. Anyway here is a picture and a video to demonstrate it. I'm not even using Arduino because I just wanted to know if the motors are good for this kind of project. And the answer is definitely no.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpTxVA8C_ZFqgSYWF_BUiRhI5JIhUFDWUNLqNhvq7J1wULpKPzaxcGwS_o6dESXnRkUqOBDfe-R29cKO3OckVtYb0F38HZtFsShXCd_k8Ls4QfZ5Cm9a3han6mBa3zOrhljpqru92teiU/s1600/auto.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="536" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpTxVA8C_ZFqgSYWF_BUiRhI5JIhUFDWUNLqNhvq7J1wULpKPzaxcGwS_o6dESXnRkUqOBDfe-R29cKO3OckVtYb0F38HZtFsShXCd_k8Ls4QfZ5Cm9a3han6mBa3zOrhljpqru92teiU/s640/auto.jpg" width="640" /></a></div>
<br />
<br />
<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/2Jlw28AhNtU?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As you can see it didn't even have enough power to run on carpet...</div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-4393983896750561012013-03-07T10:39:00.000-08:002013-03-07T11:27:58.021-08:00Arduino ToneI discovered that Arduino can play simple beep sounds without anything special. I ripped the speaker element from old headphones, soldered two wires to it and connected to arduino GND and digital 8 through 100ohm resistor. It played continuous beep sound... was pretty fun.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiovvt0nU8YnZ-wrIBkYKgDeTV1NaYfY2nJ_GP4NfTDyWb0CVKhzFVI7FPZzkwM323EO0o1qNYCs5BiwD-heBY1L2DFYwwKKnp-uRpF-ybUfjO1Ylx3cnmgY4527Vx7F4tTQ1ZCxdlUtxA/s1600/tone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="398" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiovvt0nU8YnZ-wrIBkYKgDeTV1NaYfY2nJ_GP4NfTDyWb0CVKhzFVI7FPZzkwM323EO0o1qNYCs5BiwD-heBY1L2DFYwwKKnp-uRpF-ybUfjO1Ylx3cnmgY4527Vx7F4tTQ1ZCxdlUtxA/s640/tone.jpg" width="640" /></a></div>
<br />
<br />
Found the code from here: http://arduino.cc/en/Tutorial/Tone4 <br />
<br />
bEEp! bEEp! bEEp! bEEp! bEEp! bEEp!<br />
<br />
<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/HBKxCO-XCgo?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
void setup() {<br />
<br />
}<br />
<br />
void loop() {<br />
// turn off tone function for pin 11:<br />
noTone(11); <br />
// play a note on pin 6 for 200 ms:<br />
tone(8, 440, 200);<br />
delay(200);<br />
<br />
// turn off tone function for pin 6:<br />
noTone(8);<br />
delay(300);<br />
<br />
}Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-21384592035373097022013-03-07T08:36:00.006-08:002013-03-07T11:27:12.003-08:00Voice Record Module – ISD1820Today I tested voice recording module ISD1820, which can record up to 20 seconds sound and then play it through speaker.<br />
<br />
Connection setup was pretty easy. Microphone to + and -, and others can be looked from the code.<br />
<br />
This code is for PIR sensor. It should work as and alarm system, despite the fact that I don't have PIR I used this code and it worked out of the box.<b> </b><br />
<br />
Just press record button and say something, then push playe to hear the sound.<b> </b><br />
<br />
Original project: http://www.elecfreaks.com/2215.html<b> </b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbF1puMciUBgbCYwK9fMiAthXoN59eTymU3x014jBCCdlj9A_PNqyCGFMEYjEMjSMN0u8ki662DkPZTuobhK2UOvKuOXkElleq79eLxYUA7FNWCL_LUmQ601oR2xC0tIch6uxL7d8bTWQ/s1600/soundmodule.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="394" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbF1puMciUBgbCYwK9fMiAthXoN59eTymU3x014jBCCdlj9A_PNqyCGFMEYjEMjSMN0u8ki662DkPZTuobhK2UOvKuOXkElleq79eLxYUA7FNWCL_LUmQ601oR2xC0tIch6uxL7d8bTWQ/s640/soundmodule.jpg" width="640" /></a></div>
<b><br /></b>
<br />
And video to demonstrate that it works.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/2gy5u_sacIc/0.jpg"><param name="movie" value="http://www.youtube.com/v/2gy5u_sacIc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/2gy5u_sacIc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
<br />
#define SOUT 12<br />
#define REC 8<br />
#define PLAYE 9<br />
#define PLAYL 10<br />
<br />
void setup(){<br />
pinMode(SOUT, INPUT);<br />
Serial.begin(9600);<br />
}<br />
<br />
void loop(){<br />
int ret = digitalRead(SOUT);<br />
if(ret == 1)<br />
{<br />
Serial.println("--------------> PIR");<br />
digitalWrite(PLAYE, 1);<br />
delay(5000);<br />
digitalWrite(PLAYE, 0);<br />
}<br />
}<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-33187398110714868542013-03-07T05:57:00.001-08:002013-03-07T11:09:12.683-08:00Controlling 5v DC motorTo control small DC motor you will need:<br />
motor, max 5v<br />
PN2222 Transistor<br />
1N4001 diode<br />
270 Ω Resistor (red,
purple, brown stripes)<br />
<br />
Connection scheme: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm3rocOB3EUIHiWBdrt6GhMOeG9UR6L6kBhNJ4rOEgLwupuuAiwkvTK-iD6JmaIFCdQ0rW-TADB0A622YTHnOci69PSAkJxudGvuGfwSzvcNqkC5H0K_U7eCS3ibxAjk1oZpeylVWhv1A/s1600/breadboard.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="556" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm3rocOB3EUIHiWBdrt6GhMOeG9UR6L6kBhNJ4rOEgLwupuuAiwkvTK-iD6JmaIFCdQ0rW-TADB0A622YTHnOci69PSAkJxudGvuGfwSzvcNqkC5H0K_U7eCS3ibxAjk1oZpeylVWhv1A/s640/breadboard.jpg" width="640" /></a></div>
<br />
Add this code to arduino. You can control the speed of motor by sending values between 0 - 255 from serial monitor. However i noticed my DC motor doesnt work if the speed isn't between 150 - 255.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwbWPc3arBCDssvveQXch5J7f1p_pMLx5hYlTCNch5CeTspldYknQZ8rYhXj3hQUDSXB9tM1j3UwJBE-c1_DcrU1v-OCxYnKQAh8zdpeceMStm-Euy8AAqWnP4VnzLfLFsej3RRhoZzFc/s1600/dcmotor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwbWPc3arBCDssvveQXch5J7f1p_pMLx5hYlTCNch5CeTspldYknQZ8rYhXj3hQUDSXB9tM1j3UwJBE-c1_DcrU1v-OCxYnKQAh8zdpeceMStm-Euy8AAqWnP4VnzLfLFsej3RRhoZzFc/s640/dcmotor.jpg" width="640" /></a></div>
<br />
<br />
int motorPin = 3;<br />
void setup()<br />
{<br />
pinMode(motorPin, OUTPUT);<br />
Serial.begin(9600);<br />
while (! Serial);<br />
Serial.println("Speed 0 to 255");<br />
}<br />
void loop()<br />
{<br />
if (Serial.available())<br />
{<br />
int speed = Serial.parseInt();<br />
if (speed >= 0 && speed <= 255)<br />
{<br />
analogWrite(motorPin, speed);<br />
}<br />
}<br />
} <br />
<br />
Project found from: http://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/overviewUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-1527670998223616362013-03-01T05:15:00.001-08:002013-03-11T09:19:21.512-07:00Arduino insectI started to do the second project from Arduino book because I have limited parts to use and it seemed really interesting. So I started by gluing two servos together and disassembling two rc helicopters.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkFumRBVRdYtt8eKq9WYcyaS51q_d6ql9kI8RXxOub3DscCgJJ2WIu_TnCT9_xs2m5EVlEU8mImmO2WLCGtwTj27_7DRiiO_xkvA1wfh_SRUcNz-YJ7uRWtnq0k1SeGAKONM00BKultDM/s1600/servo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkFumRBVRdYtt8eKq9WYcyaS51q_d6ql9kI8RXxOub3DscCgJJ2WIu_TnCT9_xs2m5EVlEU8mImmO2WLCGtwTj27_7DRiiO_xkvA1wfh_SRUcNz-YJ7uRWtnq0k1SeGAKONM00BKultDM/s320/servo.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRgd0QlmZZFCMsCZoqHJLs2N_1xC0cgaE0I6pDeCQOFEaB8d0XCU4hpPlaVLGi8fNnnjymP0ymzFxp4Ivg40O0dMj6Eu-QZvxXW750tU1bcgNn_h6SdHFOQtB8jUYMZcX2BFKa_ULr6M/s1600/helikopterit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRgd0QlmZZFCMsCZoqHJLs2N_1xC0cgaE0I6pDeCQOFEaB8d0XCU4hpPlaVLGi8fNnnjymP0ymzFxp4Ivg40O0dMj6Eu-QZvxXW750tU1bcgNn_h6SdHFOQtB8jUYMZcX2BFKa_ULr6M/s320/helikopterit.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This is the first version of the Arduino insect:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcsnigDBzQ_yMa8nbGOFcaEMlVpQvNSBUJmotEAu0J66nAJMMszHrr55iY_jqnVmxOdD4TagAiXK2M7IHpd5T_pmog5Gya1QNHNN4FX8QcAUBwNrtkG8606OEWmv6HdbGR8tnLZXNNx1k/s1600/hyonteinen1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="550" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcsnigDBzQ_yMa8nbGOFcaEMlVpQvNSBUJmotEAu0J66nAJMMszHrr55iY_jqnVmxOdD4TagAiXK2M7IHpd5T_pmog5Gya1QNHNN4FX8QcAUBwNrtkG8606OEWmv6HdbGR8tnLZXNNx1k/s640/hyonteinen1.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
The legs were really bad and it didn't move an inch. Then i followed the book and got two wire hangers. The legs were far more better and the insect even moved very slow. This is the second version or third version because I added the PING sensor to be the eyes. It doesn't work yet but i'm working on it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfPlmmBv9EWubJ-Ze5yMGoNMJp3NdmX90oA26O0CaBkYbd-Fz8Sh0D_Qpm017YgehCcRdq3v6gt-MnzZj9XifIRM-V0mFPLqZYq2QIZdB2vwUk4XCk0w0Q-lzmYzy3x56eLVe3R6O8QQ/s1600/hyonteinen2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="626" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfPlmmBv9EWubJ-Ze5yMGoNMJp3NdmX90oA26O0CaBkYbd-Fz8Sh0D_Qpm017YgehCcRdq3v6gt-MnzZj9XifIRM-V0mFPLqZYq2QIZdB2vwUk4XCk0w0Q-lzmYzy3x56eLVe3R6O8QQ/s640/hyonteinen2.jpg" width="640" /></a></div>
<br />
<br />
Version 1 video:<br />
<br />
<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/jN3o4Hq8cW0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
And the actual code how it moves. The idea is to move servos at different time.<br />
<br />
------------------------------------------------------------------------- <br />
The insect can move by calling the method<br />
------------------------------------------------------------------------- <br />
<br />
<br />
#include <Servo.h><br />
<br />
Servo frontServo;<br />
Servo rearServo;<br />
<br />
int centerPos = 90;<br />
int frontRightUp = 72;<br />
int frontLeftUp = 108;<br />
int backRightForward = 75;<br />
int backLeftForward = 105;<br />
<br />
void moveBackRight() {<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backRightForward-6);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos-6);<br />
delay(65);<br />
frontServo.write(frontLeftUp+9);<br />
rearServo.write(backLeftForward-6);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
<br />
void moveBackward() {<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backRightForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
frontServo.write(frontLeftUp);<br />
rearServo.write(backLeftForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
void moveForward()<br />
{<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backLeftForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
frontServo.write(frontLeftUp);<br />
rearServo.write(backRightForward);<br />
delay(125);<br />
<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
void setup()<br />
{<br />
frontServo.attach(2);<br />
rearServo.attach(3);<br />
}<br />
<br />
void loop()<br />
{<br />
moveBackRight();<br />
delay(150);<br />
}<br />
<br />
<br />
------------------------------------------------------------------------- <br />
Move turn left<br />
------------------------------------------------------------------------- <br />
<br />
<br />
#include <Servo.h><br />
<br />
Servo frontServo;<br />
Servo rearServo;<br />
<br />
int centerTurnPos = 81;<br />
int frontTurnRightUp = 63;<br />
int frontTurnLeftUp = 117;<br />
int backTurnRightForward = 66;<br />
int backTurnLeftForward = 96;<br />
<br />
void moveTurnLeft()<br />
{<br />
frontServo.write(frontTurnRightUp);<br />
rearServo.write(backTurnLeftForward);<br />
delay(125);<br />
frontServo.write(centerTurnPos);<br />
rearServo.write(centerTurnPos);<br />
delay(65);<br />
frontServo.write(frontTurnLeftUp);<br />
rearServo.write(backTurnRightForward);<br />
delay(125);<br />
frontServo.write(centerTurnPos);<br />
rearServo.write(centerTurnPos);<br />
delay(65);<br />
}<br />
<br />
void setup()<br />
{<br />
frontServo.attach(2);<br />
rearServo.attach(3);<br />
}<br />
<br />
void loop()<br />
{<br />
moveTurnLeft();<br />
delay(150);<br />
}<br />
<br />
------------------------------------------------------------------------- <br />
Ping and moving (not tested yet)<br />
-------------------------------------------------------------------------<br />
<br />
#include <Servo.h><br />
#define trigPin 12<br />
#define echoPin 13<br />
<br />
Servo frontServo;<br />
Servo rearServo;<br />
<br />
/*Servo motors global variables */<br />
int centerPos = 90;<br />
int frontRightUp = 72;<br />
int frontLeftUp = 108;<br />
int backRightForward = 75;<br />
int backLeftForward = 105;<br />
int walkSpeed = 150;<br />
int centerTurnPos = 81;<br />
int frontTurnRightUp = 63;<br />
int frontTurnLeftUp = 117;<br />
int backTurnRightForward = 66;<br />
int backTurnLeftForward = 96;<br />
<br />
/*Ping distance measurement*/<br />
long distanceCm() {<br />
int duration, distance;<br />
digitalWrite(trigPin, HIGH);<br />
delayMicroseconds(1000);<br />
digitalWrite(trigPin, LOW);<br />
duration = pulseIn(echoPin, HIGH);<br />
distance = (duration/2) / 29.1;<br />
}<br />
<br />
<br />
void center() {<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos); <br />
}<br />
<br />
<br />
<br />
void moveTurnLeft()<br />
{<br />
frontServo.write(frontTurnRightUp);<br />
rearServo.write(backTurnLeftForward);<br />
delay(125);<br />
frontServo.write(centerTurnPos);<br />
rearServo.write(centerTurnPos);<br />
delay(65);<br />
frontServo.write(frontTurnLeftUp);<br />
rearServo.write(backTurnRightForward);<br />
delay(125);<br />
frontServo.write(centerTurnPos);<br />
rearServo.write(centerTurnPos);<br />
delay(65);<br />
}<br />
<br />
<br />
void moveBackRight() {<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backRightForward-6);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos-6);<br />
delay(65);<br />
frontServo.write(frontLeftUp+9);<br />
rearServo.write(backLeftForward-6);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
void moveBackward() {<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backRightForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
frontServo.write(frontLeftUp);<br />
rearServo.write(backLeftForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
void moveForward()<br />
{<br />
frontServo.write(frontRightUp);<br />
rearServo.write(backLeftForward);<br />
delay(125);<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
frontServo.write(frontLeftUp);<br />
rearServo.write(backRightForward);<br />
delay(125);<br />
<br />
frontServo.write(centerPos);<br />
rearServo.write(centerPos);<br />
delay(65);<br />
}<br />
<br />
void setup()<br />
{<br />
frontServo.attach(2);<br />
rearServo.attach(3);<br />
Serial.begin (9600);<br />
pinMode(trigPin, OUTPUT);<br />
pinMode(echoPin, INPUT);<br />
}<br />
<br />
void loop()<br />
{<br />
Serial.print(distance);<br />
delay(150);<br />
}<br />
<br />
This is the current version of insect with better legs. Now it can move forward a little bit better. It also has a place for PING sensor but I didn't add it yet.<br />
<br />
<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/rXgU3HwcPOg?feature=player_embedded' frameborder='0'></iframe></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-61353324642792987952013-02-26T06:19:00.000-08:002013-02-26T06:19:00.762-08:00Powering arduinoI decided to write shortly about powering arduino UNO. There are few ways to power it. I don't know if these voltage rates are the same for every board but these goes for UNO. <br />
<br />
1. From usb cable with computer or 230v usb adapter<br />
2. Any kind of battery with 7-12 volts, example AA batteries, 9v battery, car battery, rc-car battery etc.<br />
<br />
More detailed info can be found on arduino.cc<br />
<br />
Connection, either + (red wire) to VIM port, or GND (black wire) to GND of course.<br />
<br />
I am using this for my UNO: (ordered from www.dx.com)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaBdOYBpDLaXRNRDC92Qe4u8L3Iq-skhDaqYIKBddazlqNnNlU9RNIIZa2L50VcOvwNRTNN6Kuym4bSX013pYh2aGRt58M8lWpSval-KHuByL9jjqmNuR-I4H8fN-IBY_wymZKu0F95Ng/s1600/sku_142698_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaBdOYBpDLaXRNRDC92Qe4u8L3Iq-skhDaqYIKBddazlqNnNlU9RNIIZa2L50VcOvwNRTNN6Kuym4bSX013pYh2aGRt58M8lWpSval-KHuByL9jjqmNuR-I4H8fN-IBY_wymZKu0F95Ng/s320/sku_142698_1.jpg" width="320" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-24182979441933828062013-02-25T10:31:00.001-08:002013-02-26T06:13:19.133-08:00Reading from serial port part 2 <div class="separator" style="clear: both; text-align: left;">
This is the same method as described 2 posts below. I am just reading PING from terminal. My program is the same as in the post below. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgndgCs9INrQnGbEiCSRzStvVm9bFT2EV0Ucj7KRDIDB0KNFxIXm1vhkr_ZJmq1hIKOnjfjNZtzbzN2iHx2WYa1GsRFaNToUmMivp2tziq7veo5vp_UtGReVDX9tI9VysydUcTnUXUL2zg/s1600/Screenshot+-+02252013+-+06:22:02+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgndgCs9INrQnGbEiCSRzStvVm9bFT2EV0Ucj7KRDIDB0KNFxIXm1vhkr_ZJmq1hIKOnjfjNZtzbzN2iHx2WYa1GsRFaNToUmMivp2tziq7veo5vp_UtGReVDX9tI9VysydUcTnUXUL2zg/s640/Screenshot+-+02252013+-+06:22:02+PM.png" width="640" /></a></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;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUJub0BIKeP-BHXN_vXYHx4IwD93CIfdilAtv_Wq1GlnmN0qwsLQJjDEppBq4As7KZrArjF5dXrggbJ6QsxViHBLpGlnvrtibNDedzQL6oAMWaMumCD4rbgXc6pPkWG-pgU8U_ObGSOlE/s1600/IMG_5537.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUJub0BIKeP-BHXN_vXYHx4IwD93CIfdilAtv_Wq1GlnmN0qwsLQJjDEppBq4As7KZrArjF5dXrggbJ6QsxViHBLpGlnvrtibNDedzQL6oAMWaMumCD4rbgXc6pPkWG-pgU8U_ObGSOlE/s640/IMG_5537.JPG" width="640" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-6093793534998835452013-02-20T05:14:00.000-08:002013-03-08T04:10:42.830-08:00 hc-sr04 ultrasonic sensor, with 4 legs + servoI got new hc-sr04 sensor with 4 legs. GND, ECHO, TRIG, VCC.<br />
<br />
Connection setup: GND to GND of course, VCC goes +5V, echo to pin 13, trig to pin 12<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWbI68lv-Hq8-G6UkUEflCrKAlb95zNEfsDmRXsHFbCDX_o5uP5XXMG1zLTjn6OKHd52X5mSD1rEQag6ZMYKCs06cBQFwTuU3-XZH5Xs_TNq1T-M19M00InhHH79ZBh_FAR-Ehtj-m1gQ/s1600/IMG_5517.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWbI68lv-Hq8-G6UkUEflCrKAlb95zNEfsDmRXsHFbCDX_o5uP5XXMG1zLTjn6OKHd52X5mSD1rEQag6ZMYKCs06cBQFwTuU3-XZH5Xs_TNq1T-M19M00InhHH79ZBh_FAR-Ehtj-m1gQ/s640/IMG_5517.JPG" width="640" /></a></div>
<br />
<br />
This code prints distance to serial monitor:<br />
<br />
<br />
#define trigPin 12<br />
#define echoPin 13<br />
<br />
void setup() {<br />
Serial.begin (9600);<br />
pinMode(trigPin, OUTPUT);<br />
pinMode(echoPin, INPUT);<br />
}<br />
<br />
void loop() {<br />
int duration, distance;<br />
digitalWrite(trigPin, HIGH);<br />
delayMicroseconds(1000);<br />
digitalWrite(trigPin, LOW);<br />
duration = pulseIn(echoPin, HIGH);<br />
distance = (duration/2) / 29.1;<br />
if (distance >= 200 || distance <= 0){<br />
Serial.println("Out of range");<br />
}<br />
else {<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
}<br />
delay(500);<br />
}<br />
<br />
Then i added a servo which moves if its between the wanted range:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrmskLoQCl23nln-TcVbFAPI82kBW_ehXisY5Jezk6_WMKCBzGigAu4xRGLPt-uafeaONoPx8an8REp-p72dScuJDlunxMyP5HS3Ioar7MH4n0Gy69ZDJf7hO_DtMs-Aq31_1oQ2Hgmqo/s1600/IMG_5520.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrmskLoQCl23nln-TcVbFAPI82kBW_ehXisY5Jezk6_WMKCBzGigAu4xRGLPt-uafeaONoPx8an8REp-p72dScuJDlunxMyP5HS3Ioar7MH4n0Gy69ZDJf7hO_DtMs-Aq31_1oQ2Hgmqo/s640/IMG_5520.JPG" width="640" /></a></div>
<br />
<br />
Connection: servo to analog 0, PING to 12 and 13 as described in the actual code:<br />
<br />
<br />
#define trigPin 12<br />
#define echoPin 13<br />
#include <Servo.h><br />
Servo servoMain; // Define our Servo<br />
<br />
void setup() {<br />
Serial.begin (115200);<br />
pinMode(trigPin, OUTPUT);<br />
pinMode(echoPin, INPUT);<br />
servoMain.attach(A0); // servo on analog pin 0<br />
}<br />
<br />
void loop() {<br />
servoMain.write(90); // Turn Servo back to center position (90 degrees)<br />
<br />
int duration, distance;<br />
digitalWrite(trigPin, HIGH);<br />
delayMicroseconds(1000);<br />
digitalWrite(trigPin, LOW);<br />
duration = pulseIn(echoPin, HIGH);<br />
distance = (duration/2) / 29.1;<br />
<br />
Serial.print(distance);<br />
Serial.println(" cm");<br />
<br />
if (distance >=10 && distance <= 30){<br />
servoMain.write(135); // Turn Servo Right to 135 degrees<br />
delay(1000); // Wait 1 second<br />
servoMain.write(25); // Turn Servo Left to 45 degrees<br />
}<br />
else {<br />
servoMain.write(90); // Turn Servo back to center position (90 degrees)<br />
}<br />
delay(500);<br />
}<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/S4_1BLOV1Uk/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/S4_1BLOV1Uk?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/S4_1BLOV1Uk?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
<br />
Then i wanted to test with the new battery case i got. I soldered jumper wires to the case so its easier to connect power to arduino.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP8lDeCRIsJcRS9xdW68_6QaZ6GTs4Lg08DK7H5OmceozelFFslrL_1U-K3Qpd2LgRt2MK5sy20PV-zBmvAGKTdeKdnviKvihyphenhyphen696V7X-V6svoArzwda_BTT7aMzhIJDfac_kykz3Tzsc/s1600/IMG_5513.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP8lDeCRIsJcRS9xdW68_6QaZ6GTs4Lg08DK7H5OmceozelFFslrL_1U-K3Qpd2LgRt2MK5sy20PV-zBmvAGKTdeKdnviKvihyphenhyphen696V7X-V6svoArzwda_BTT7aMzhIJDfac_kykz3Tzsc/s640/IMG_5513.JPG" width="640" /></a></div>
<br />
<br />
Just put plus (red wire) to VIM port and black one to GND = ground. I am using arduino UNO which works with these voltages:<br />
<table border="0" style="background-color: white; color: #555555; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px; line-height: 23px;"><tbody>
<tr><td align="left">Input Voltage (recommended)</td><td align="left">7-12V</td></tr>
<tr><td align="left">Input Voltage (limits)</td><td align="left">6-20V</td></tr>
</tbody></table>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWw7oRiCpuIL4LiiFRCX79JUj9euxvDNsT2gnY7yLHfvSRaGZsy_QH6X_Erd8yiqX7n67Bc-hoi89IeTstLrSIKDg3krrjmpI1utLCIvE5uDLoCC4WyIvWp64CsmUufLzGeYeq7LFkBDA/s1600/IMG_5523.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWw7oRiCpuIL4LiiFRCX79JUj9euxvDNsT2gnY7yLHfvSRaGZsy_QH6X_Erd8yiqX7n67Bc-hoi89IeTstLrSIKDg3krrjmpI1utLCIvE5uDLoCC4WyIvWp64CsmUufLzGeYeq7LFkBDA/s640/IMG_5523.JPG" width="640" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-63869858471228105072013-02-15T05:16:00.001-08:002013-02-25T10:27:40.221-08:00Reading and writing serial ports with python Today we had to find information how to read information from serialport with computer. First we write a simple program for arduino which prints something for serial monitor:<br />
<br />
<br />
void setup()<br />
{<br />
Serial.begin(115200);<br />
Serial.println("Foo bar"); <br />
}<br />
<br />
void loop()<br />
{<br />
Serial.println("Moi");<br />
delay(500); //ms<br />
}<br />
<br />
This prints to arduino serial monitor, first "Foo bar" only once, and then "Moi" always after 0,5 seconds.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdtqzBF-0oYK40VhRhWm4cXzDXRINOdAzofZ5MTp4IJ9UUB3CoLrpgIdSLjwj8PYC3EFoxh9HSuyDdBZe8VsKV_DbkIUTL4Obn0KBglYzKijuAOmd2Se36B0zoepd3cgsV3q3gPbRVAGk/s1600/arduino.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="518" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdtqzBF-0oYK40VhRhWm4cXzDXRINOdAzofZ5MTp4IJ9UUB3CoLrpgIdSLjwj8PYC3EFoxh9HSuyDdBZe8VsKV_DbkIUTL4Obn0KBglYzKijuAOmd2Se36B0zoepd3cgsV3q3gPbRVAGk/s640/arduino.png" width="640" /></a></div>
<br />
Then we want to read that from usb port. You must have permissions to read from serial port. Example sudo chmod 777 /dev/ttyACM0 (see the right port from arduino ide.<br />
<br />
Create a new file in linux: cat > read.py<br />
open it with text-editor, i used nano: nano read.py<br />
<br />
Then we write a simple python program to read that from usb port (copy this code and also remember to indent the code for if and while parts.):<br />
<br />
<br />
import serial, sys<br />
<br />
ser = serial.Serial("/dev/ttyACM0", 115200)<br />
<br />
if (ser):<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>print("Serial port " + ser.portstr+ " opened.")<br />
<br />
while True:<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>sys.stdout.write(ser.read(1) )<br />
sys.stdout.flush()<br />
<br />
Then open the file in terminal: python read.py<br />
And we can see it prints that program written for arduino.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBmnpG_lIgZylZMMjO3_pe38LI8DaHa_iiq3wqRWGEBU3jTKrsXDOomhw5byGmMQPcWS_OEkQDvomdunOleiL3ekVXKTn9w1CNH2_zpthAYRWynpLfef_Vwn9zEvT1rtnFmW8MFniXY70/s1600/xubuntu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="422" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBmnpG_lIgZylZMMjO3_pe38LI8DaHa_iiq3wqRWGEBU3jTKrsXDOomhw5byGmMQPcWS_OEkQDvomdunOleiL3ekVXKTn9w1CNH2_zpthAYRWynpLfef_Vwn9zEvT1rtnFmW8MFniXY70/s640/xubuntu.png" width="640" /></a></div>
<br />
And if you want to write something, just add this line<br />
ser.write ('5')Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-79248204781257974532013-02-06T03:33:00.000-08:002013-02-06T13:11:36.427-08:00Arduino Flame Detection Sensor ModuleOur home task was to find out what the sensor does. I got flame detection sensor module which detects infrared rays. We connected one led to the sensor, so it would set on if the sensor detects infrared. We had a remote control which of course works with infrared. Always when we pushed a button the led turned on. It worked pretty well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGObTVjrqilx_hy5ojT1LwQ3VwDvPjWziovf93_j97DdeBeck-5ORWV-ZVhinjaJbPt9ZXXXdhSIO1HO15ci0B1vOzmwWIxkCprq6L2PEi4lkJJB9MJRq85t8fECq0sI8KxOxLi-BH1wc/s1600/DSC_0087.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGObTVjrqilx_hy5ojT1LwQ3VwDvPjWziovf93_j97DdeBeck-5ORWV-ZVhinjaJbPt9ZXXXdhSIO1HO15ci0B1vOzmwWIxkCprq6L2PEi4lkJJB9MJRq85t8fECq0sI8KxOxLi-BH1wc/s640/DSC_0087.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7t2pMlpTCFoP58nBzBSjwuB_S-gQ3SvYi3RUM5EofW7vdHecj_r6Bzs_JPg1w1VclbA-SQxbhLwHbxY-ggdf0rE3o0UIRT_iVTPqr097im9UVIPL2Oill-y7jg5CKoT28ZfsmtRWJvC4/s1600/DSC_0088.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7t2pMlpTCFoP58nBzBSjwuB_S-gQ3SvYi3RUM5EofW7vdHecj_r6Bzs_JPg1w1VclbA-SQxbhLwHbxY-ggdf0rE3o0UIRT_iVTPqr097im9UVIPL2Oill-y7jg5CKoT28ZfsmtRWJvC4/s640/DSC_0088.jpg" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjtpnRpPnjM8y2pZ4tteDTfjNoY_FvVqPvxyvj9IzGsTax7FhwxwikD0eJwgpT562ZAC2-tBFx70H7N6tBykbXqOl_IPc7R_yjUwnnms0z784E7jaoJKehl9NnTmiLX3AAkcD4NQW5I14/s1600/sku_135038_1_small.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjtpnRpPnjM8y2pZ4tteDTfjNoY_FvVqPvxyvj9IzGsTax7FhwxwikD0eJwgpT562ZAC2-tBFx70H7N6tBykbXqOl_IPc7R_yjUwnnms0z784E7jaoJKehl9NnTmiLX3AAkcD4NQW5I14/s200/sku_135038_1_small.jpg" width="200" /></a></div>
<br />
<br />
The code:<br />
<br />
/*SENSOR PINOUT:<br />
<br />
PIN 1: Analogue out<br />
PIN 2: Ground<br />
PIN 3: +5V<br />
PIN 4: Digital out<br />
<br />
You may copy, alter and reuse this code in any way you like but please leave <br />
reference to HobbyComponents.com in your comments if you redistribute this code.<br />
<div>
<br /></div>
<div>
Modified by Niki Ahlskog & Anders Borgström */<br />
<br />
<br />
/* Select the input pin for the flame detectors analogue output. */<br />
#define FLAME_DETECT_ANA A0 <br />
<br />
/* Select the input pin for the flame detectors digital output. */<br />
#define FLAME_DETC_DIO 2 <br />
int led = 8; <br />
<br />
<br />
/* Initialise serial and DIO */<br />
void setup()<br />
{<br />
/* Setup the serial port for displaying the status of the sensor */<br />
Serial.begin(9600);<br />
pinMode(led, OUTPUT);<br />
/* Configure the DIO pin the sensors digital output will be connected to */<br />
pinMode(FLAME_DETC_DIO, INPUT); <br />
}<br />
<br />
<br />
/* Main program loop */<br />
void loop()<br />
{<br />
/* Read the sensors analogue output and send it to the serial port */<br />
Serial.print("Sensor Value: ");<br />
Serial.print(analogRead(FLAME_DETECT_ANA));<br />
<br />
/* Read the status of the sensors digital output and if it is high <br />
then send an alert to the UART */<br />
if (digitalRead(FLAME_DETC_DIO))<br />
{<br />
Serial.println(" FLAME DETECTED!");<br />
digitalWrite(led, HIGH);<br />
delay(1000);<br />
digitalWrite(led, LOW);<br />
<br />
}else<br />
{<br />
Serial.println(); <br />
digitalWrite(led, LOW);<br />
<br />
}<br />
<br />
}<br />
<br />
The sensor: <a href="http://dx.com/p/arduino-flame-detection-sensor-module-135038">http://dx.com/</a><br />
Original code: <a href="http://www.hobbycomponents.com/index.php?route=product/product&filter_name=Flame%20Detection%20Sensor%20Module&product_id=144">http://www.hobbycomponents.com/</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/4W5m-PBoWJg?feature=player_embedded' frameborder='0'></iframe></div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-88668574201057266682013-02-06T03:12:00.002-08:002013-02-06T13:06:33.631-08:00Arduino servo motorIt moves! This time i got black servo motor version s3003. I just wanted to see if I can control it somehow and yes, I can. "Radio Control Servos are great pieces of kit. They are essential in pretty much every robot build, from controlling arms and legs to driving wheels and tracks. Servos normally rotate up 180 degrees with the 90 degree mid-point being the center position, and can be positioned at any point in-between. "<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig0FSswWJ_f2QLJ8TZTe_2YmnC9uXEBwqYPU6qNKJ0P7ZzVZXNq-LDEkuUwhrDdjhvoiQy2S3MTSZjCHwon5bNs5IvW9Xf-fFHRCCAA0BSJQ36kLMbNhVtEYK5G2ZbXMopTWaZaFs-VBM/s1600/servo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig0FSswWJ_f2QLJ8TZTe_2YmnC9uXEBwqYPU6qNKJ0P7ZzVZXNq-LDEkuUwhrDdjhvoiQy2S3MTSZjCHwon5bNs5IvW9Xf-fFHRCCAA0BSJQ36kLMbNhVtEYK5G2ZbXMopTWaZaFs-VBM/s320/servo.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT9aEwKPHLc0QRC3n_Bi80UNaZ3gW0Y6wq0nGqQWlmUzPlKIop8Zq_8XFErevashm6oplHw61wqZ8VlgWnCIvTVBFv1n4fQ2VHrqcAioElO2cjaaYuo2bSrPm2SIwjQWeJrVWpng-jjZo/s1600/DSC_0085.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT9aEwKPHLc0QRC3n_Bi80UNaZ3gW0Y6wq0nGqQWlmUzPlKIop8Zq_8XFErevashm6oplHw61wqZ8VlgWnCIvTVBFv1n4fQ2VHrqcAioElO2cjaaYuo2bSrPm2SIwjQWeJrVWpng-jjZo/s640/DSC_0085.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibU-POmIBZX90OgQ0GjXfgPGPNdXPKOTM2GZReUngqtlEzKyc7vuMKpMVHPsvRm1ckzVknKz4eilb7vidmHmmvLCbvzle2NCTQ2NHxFU1RY4hyphenhyphenAF3epp9eor72y0XFiR8YCOUG8MpaBJ0/s1600/DSC_0086.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibU-POmIBZX90OgQ0GjXfgPGPNdXPKOTM2GZReUngqtlEzKyc7vuMKpMVHPsvRm1ckzVknKz4eilb7vidmHmmvLCbvzle2NCTQ2NHxFU1RY4hyphenhyphenAF3epp9eor72y0XFiR8YCOUG8MpaBJ0/s640/DSC_0086.jpg" width="640" /></a></div>
<br />
<br />
<br />
#include <Servo.h><br />
Servo servoMain; // Define our Servo<br />
<br />
void setup()<br />
{<br />
servoMain.attach(A0); // servo on analog pin 0<br />
}<br />
<br />
void loop()<br />
{<br />
servoMain.write(45); // Turn Servo Left to 45 degrees<br />
delay(1000); // Wait 1 second<br />
servoMain.write(0); // Turn Servo Left to 0 degrees<br />
delay(1000); // Wait 1 second<br />
servoMain.write(90); // Turn Servo back to center position (90 degrees)<br />
delay(1000); // Wait 1 second<br />
servoMain.write(135); // Turn Servo Right to 135 degrees<br />
delay(1000); // Wait 1 second<br />
servoMain.write(180); // Turn Servo Right to 180 degrees<br />
delay(1000); // Wait 1 second<br />
servoMain.write(90); // Turn Servo back to center position (90 degrees)<br />
delay(1000); // Wait 1 second <br />
}<br />
<br />
Very simple code how to control servo.<br />
<br />
<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/P7Rq3MQlE4c?feature=player_embedded' frameborder='0'></iframe></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-30099337009171364682013-02-01T04:22:00.003-08:002013-10-19T03:05:56.113-07:00Arduino Piezo Sensor - LDT1-028KThis time i got Piezo sensor LDT1-028K which is some kind of paper slip which can detect touching or twisting and as in description is said, vibration and impact. My setup is the slip and led. If the slip is touched the led should set on and if it's not touched the led should be off. The only problem is that the slip is throwing random numbers and I can't see any logic there... But anyway it's working somehow.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi431J9YtwQMNGel9LeG1gm1CZbMZyose5cxQCVrUZRskZWZ3eP_vDsSUqz5AH0AiHY7cVc1UE0WwAnJZ-uNs9Y-92wgVfuj4iaeVFtUj0XWB3DY5SIzzK7EyJ9KnRBQIuvcThw1VuQc3A/s1600/DSC_0081.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi431J9YtwQMNGel9LeG1gm1CZbMZyose5cxQCVrUZRskZWZ3eP_vDsSUqz5AH0AiHY7cVc1UE0WwAnJZ-uNs9Y-92wgVfuj4iaeVFtUj0XWB3DY5SIzzK7EyJ9KnRBQIuvcThw1VuQc3A/s640/DSC_0081.jpg" width="640" /></a></div>
<br />---------------------------------------------------------------------------------------------------------<br />Description: The LDT1-028K is a multi-purpose, piezoelectric sensor for detecting physical phenomena such as vibration or impact. The piezo film element is laminate to a sheet of polyester (Mylar), and produces a useable electrical signal output when forces are applied to the sensing area. The dual wire lead attached to the sensor allows a circuit or monitoring device to process the signal.<br /><br /><br />Features:<br /><br />• Piezoelectric polymer<br /><br />• Multi-purpose<br /><br />• Vibration sensing<br /><br />• Impact sensing<br /><br />• Laminated<br /><br />• Dual wire lead attached<br /><br />• Minimum impedance: 1 MΩ<br /><br />• Preferred impedance: 10 MΩ and higher<br /><br />• Output voltage: 10mV-100V depending on force and circuit impedance<br /><br />• Storage temperature: -40°C to +70°C [-40°F to 160°F]<br /><br />• Operating temperature: 0°C to +70°C [32°F to 160°F]<br /><br />---------------------------------------------------------------------------------------------------------<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnlgOzkQguBunalloxLam3xqQ-rkUbRYD1egAGTTpS6POV2aW4LmfQb2M8H2Mlin55LrjF-dmfgtKrPVx2tNEBPERAr-8zJjSgf1GC7Vqxsu3_JG_7Boi8HYYf7glvO6SZPT39Tk2zShc/s1600/DSC_0083.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnlgOzkQguBunalloxLam3xqQ-rkUbRYD1egAGTTpS6POV2aW4LmfQb2M8H2Mlin55LrjF-dmfgtKrPVx2tNEBPERAr-8zJjSgf1GC7Vqxsu3_JG_7Boi8HYYf7glvO6SZPT39Tk2zShc/s640/DSC_0083.jpg" width="640" /></a></div>
<br />
<br />
The actual code goes like this:<br />
<br />
int sensorPin = A0; // sensor must be in analog input<br />
int ledPin = 7; // led is connected to port 7<br />
int sensorValue = 0; // here is defined the value for sensor<br />
<br />
void setup() {<br />
pinMode(ledPin, OUTPUT); // led is in output which means it sends information to outside world<br />
Serial.begin(115200); // set reading to the fastest speed possible<br />
}<br />
<br />
void loop() {<br />
<br />
sensorValue = analogRead(sensorPin); // here we read the numbers from sensor<br />
<br />
// from device monitor we can see values are between 0 - 1023<br />
<br />
if (sensorValue < 500 && sensorValue > 50) // if value is smaller than 500 but bigger than 50<br />
{<br />
digitalWrite(ledPin, HIGH); // led will be on<br />
}<br />
<br />
else<br />
{<br />
digitalWrite(ledPin, LOW); // if the value is something else led is off<br />
}<br />
<br />
<br />
// sensorValue = 0; // not sure if the sensor value should be resetted somehow<br />
<br />
// printing to the serial monitor<br />
Serial.print(sensorValue);<br />
Serial.print("\t");<br />
Serial.print(sensorValue);<br />
Serial.println();<br />
}<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/2_QtJBKqARc/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/2_QtJBKqARc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/2_QtJBKqARc?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
<br />
Links to the sensor:<br />
<br />
<a href="http://www.meas-spec.com/product/t_product.aspx?id=5435">http://www.meas-spec.com/product/t_product.aspx?id=5435</a><br />
<a href="http://www.seeedstudio.com/wiki/index.php?title=Piezo_Sensor_-_LDT1-028K_Lead_Attachments">http://www.seeedstudio.com/wiki/index.php?title=Piezo_Sensor_-_LDT1-028K_Lead_Attachments</a><br />
<br />
Like this the serial monitor shows random numbers and there is no logic I think. Normally this sensor is used to measure jolts i heard. Anyway I got it to work somehow.Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-3975419263842309138.post-37243019750810203672013-01-29T05:46:00.001-08:002013-01-29T09:24:27.703-08:00Accelerometer Memsic MX2125<br />
This time i got Memsic accelerometer. The task was to find out what this sensor is and what it does.<br />
The first thing what I did was that I opened arduino.cc and searched that sensor. There was a clear picture how to connect the sensor and in the development environment we found under sensors the basic code for this sensor. Link to the sensor:<br />
<a href="http://arduino.cc/en/Tutorial/Memsic2125?from=Tutorial.AccelerometerMemsic2125">http://arduino.cc/en/Tutorial/Memsic2125?from=Tutorial.AccelerometerMemsic2125</a><br />
Then we just opened device monitor to see which axis where which and then added two leds which start to blink slower when the angle is growing. Picture of the setup:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7kOp107Sh9AXtqYMDz89_8Rp6HI9EcEDFr6BzKwjoDlRtgFKVTk0gI2DsLq_a9gslqypj13uQn_HMEzkxBh-ok3akrpzr2uAi6qiidzh_xVSMnzYn4xTxmHoZcOUIPlTRICjL9YLXUo/s1600/DSC_0077.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7kOp107Sh9AXtqYMDz89_8Rp6HI9EcEDFr6BzKwjoDlRtgFKVTk0gI2DsLq_a9gslqypj13uQn_HMEzkxBh-ok3akrpzr2uAi6qiidzh_xVSMnzYn4xTxmHoZcOUIPlTRICjL9YLXUo/s640/DSC_0077.jpg" width="640" /></a></div>
<br />
The actual code, we added if-else statement that if the angle is growing the led should blink slower. Few videos here about the testing:<br />
<br />
<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/GEWvffknI5s?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<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/Q50jUlRSNkI?feature=player_embedded' frameborder='0'></iframe></div>
<br />
The code:<br />
<br />
// these constants won't change:<br />
const int xPin = 2;<span class="Apple-tab-span" style="white-space: pre;"> </span>// X output of the accelerometer<br />
const int yPin = 3;<span class="Apple-tab-span" style="white-space: pre;"> </span>// Y output of the accelerometer<br />
<br />
void setup() {<br />
// initialize serial communications:<br />
Serial.begin(9600);<br />
// initialize the pins connected to the accelerometer<br />
// as inputs:<br />
pinMode(xPin, INPUT);<br />
pinMode(yPin, INPUT);<br />
pinMode(4, OUTPUT);<br />
pinMode(5, OUTPUT);<br />
}<br />
<br />
void loop() {<br />
// variables to read the pulse widths:<br />
int pulseX, pulseY;<br />
// variables to contain the resulting accelerations<br />
int accelerationX, accelerationY;<br />
<br />
// read pulse from x- and y-axes:<br />
pulseX = pulseIn(xPin,HIGH); <br />
pulseY = pulseIn(yPin,HIGH);<br />
<br />
// convert the pulse width into acceleration<br />
// accelerationX and accelerationY are in milli-g's:<br />
// earth's gravity is 1000 milli-g's, or 1g.<br />
accelerationX = ((pulseX / 10) - 500) * 8;<br />
accelerationY = ((pulseY / 10) - 500) * 8;<br />
<br />
if (accelerationX > 100 && accelerationX < 200){<br />
digitalWrite(4, HIGH);<br />
delay(50);<br />
digitalWrite(4, LOW);<br />
delay(50);<br />
}<br />
else if (accelerationX > 200 && accelerationX < 300)<br />
{<br />
digitalWrite(4, HIGH);<br />
delay(200);<br />
digitalWrite(4, LOW);<br />
delay(200);<br />
}<br />
<br />
else if (accelerationX > 300 && accelerationX < 400)<br />
{<br />
digitalWrite(4, HIGH);<br />
delay(500);<br />
digitalWrite(4, LOW);<br />
delay(500);<br />
}<br />
else if (accelerationX > 400 && accelerationX < 500)<br />
{<br />
digitalWrite(4, HIGH);<br />
delay(600);<br />
digitalWrite(4, LOW);<br />
delay(600);<br />
}<br />
<br />
else {<br />
digitalWrite(4, LOW);<br />
}<br />
<br />
//--------------------------------------------------------------------------------<br />
<br />
if (accelerationY > 100 && accelerationY < 200){<br />
digitalWrite(5, HIGH);<br />
delay(50);<br />
digitalWrite(5, LOW);<br />
delay(50);<br />
}<br />
else if (accelerationY > 200 && accelerationY < 300)<br />
{<br />
digitalWrite(5, HIGH);<br />
delay(200);<br />
digitalWrite(5, LOW);<br />
delay(200);<br />
}<br />
<br />
else if (accelerationY > 300 && accelerationY < 400)<br />
{<br />
digitalWrite(5, HIGH);<br />
delay(500);<br />
digitalWrite(5, LOW);<br />
delay(500);<br />
}<br />
else if (accelerationY > 400 && accelerationY < 500)<br />
{<br />
digitalWrite(5, HIGH);<br />
delay(600);<br />
digitalWrite(5, LOW);<br />
delay(600);<br />
}<br />
<br />
else {<br />
digitalWrite(5, LOW);<br />
}<br />
<br />
// print the acceleration<br />
Serial.print(accelerationX);<br />
// print a tab character:<br />
Serial.print("\t");<br />
Serial.print(accelerationY);<br />
Serial.println();<br />
<br />
delay(100);<br />
<br />
}Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-48435971673713827272013-01-25T05:11:00.000-08:002013-02-20T05:03:09.044-08:00Arduino ping sensor<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Me and Anders got a PING ultrasonic sensor. Our task was to find out what it does and how. Here is the sensor:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjleH8JwB6J0GXO63D_PE7FnFto47BO8LLPE_8uc0LNGoNpgAR9wwMr5rIpQ743G-VZx9O419ETZ7llMP4sdN0P2otxQM9XE3cbSbDDMRhKaKHZZZpmdMx1h7Mbv9H0GiK0WE_2IhyphenhyphenwuJc/s1600/DSC_0076.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjleH8JwB6J0GXO63D_PE7FnFto47BO8LLPE_8uc0LNGoNpgAR9wwMr5rIpQ743G-VZx9O419ETZ7llMP4sdN0P2otxQM9XE3cbSbDDMRhKaKHZZZpmdMx1h7Mbv9H0GiK0WE_2IhyphenhyphenwuJc/s640/DSC_0076.jpg" width="640" /></a></div>
<br />
It sends ultrasonic sound from the other tube and then the other one is microphone which caches the sound. Then the actual code calculates how long it took for the sound to travel to the obstacle and back. Here is some basic code which sets the led in socket 13 on IF the distance is bigger than 10. If it's smaller than ten the led will turn off. <br />
<br />
Connect PING signal to pin 7, GND to GND and power to +5v<br />
<br />
<pre style="display: inline; margin-top: 0;">#define fP 7 //Pin the ping sensor is connected to
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
if (ping() > 10) // set distance
{
digitalWrite(13, HIGH); // set the LED on
}
else
{
digitalWrite(13, LOW); // set the LED off
}
}
int ping() //Get CM to obstacle in front of the sensor
{
long duration;
pinMode(fP, OUTPUT);
digitalWrite(fP, LOW);
delayMicroseconds(2);
digitalWrite(fP, HIGH);
delayMicroseconds(15);
digitalWrite(fP, LOW);
delayMicroseconds(20);
pinMode(fP, INPUT);
duration = pulseIn(fP, HIGH);
return duration / 29.0 / 2.0;
}</pre>
<br />
<br />
<pre style="display: inline; margin-top: 0pt;">Then we just added more leds and added distances when the led's should be active:</pre>
<div>
<span style="font-family: monospace;"><span style="white-space: pre;"><br /></span></span></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/Ogcx3uJBnPo?feature=player_embedded' frameborder='0'></iframe></div>
<div>
<span style="font-family: monospace;"><span style="white-space: pre;"><br /></span></span></div>
<div>
<span style="font-family: monospace;"><span style="white-space: pre;">I forgot to shoot my own video, but my friend took one and here is how it works.</span></span><br />
<div>
<span style="font-family: monospace;"><span style="white-space: pre;"><br /></span></span>
<br />
<br />
//#define fP 7 //Pin the ping sensor is connected to<br />
const int pingPin = 7; //set ping to slot 7 <br />
<br />
void setup()<br />
{<br />
pinMode(4, OUTPUT); //<br />
pinMode(5, OUTPUT); //set led to slot 4,5,6<br />
pinMode(6, OUTPUT); //<br />
} <br />
<br />
void loop()<br />
{<br />
if (ping() > 2) //if ping distance is bigger than #<br />
{<br />
digitalWrite(4, HIGH); //set the LED on<br />
}</div>
<div>
else if(ping() > 6)<br />
{<br />
digitalWrite(5, HIGH);<br />
}<br />
else if(ping() > 10)<br />
{<br />
digitalWrite(6, HIGH);<br />
} <br />
else<br />
{<br />
digitalWrite(4, LOW); //<br />
digitalWrite(5, LOW); //set the LED off<br />
digitalWrite(6, LOW); //<br />
}<br />
} <br />
int ping() //Get CM to obstacle in front of the sensor<br />
{<br />
long duration;<br />
pinMode(pingPin, OUTPUT);<br />
digitalWrite(pingPin, LOW);<br />
delayMicroseconds(2);<br />
digitalWrite(pingPin, HIGH);<br />
delayMicroseconds(15);<br />
digitalWrite(pingPin, LOW);<br />
delayMicroseconds(20);<br />
pinMode(pingPin, INPUT);<br />
duration = pulseIn(pingPin, HIGH);<br />
return duration / 29.0 / 2.0; <br />
}</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3975419263842309138.post-75391571609493411082013-01-21T11:12:00.002-08:002013-02-01T04:38:31.118-08:00First week of prototype courseFirst task was to burn xubuntu live cd. I burned other cd's as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx2wnsHw0gEiUZ74eVLAXMc5V8HiicrUg4PWUrgtMOFWpRs4A36YqX58AFwuPd6fgM7Uc27PMg76kmaK8mqpvvDsARgW6-1KseCP9JY08K8nUiit6elIiLM_CYrYRHYm6OQSPpixEDLmI/s1600/IMG_5419.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx2wnsHw0gEiUZ74eVLAXMc5V8HiicrUg4PWUrgtMOFWpRs4A36YqX58AFwuPd6fgM7Uc27PMg76kmaK8mqpvvDsARgW6-1KseCP9JY08K8nUiit6elIiLM_CYrYRHYm6OQSPpixEDLmI/s320/IMG_5419.jpg" width="213" /></a></div>
<br />
<br />
First lesson of prototype course was very impressive, all other courses are boring or I feel somehow stupid doing other courses. This was the first course this year when I felt I'm in the right place. Maybe later I will attend other Tero's courses if I have time. <br />
<br />
The idea of the course is to build your own prototype and show it to others. Prototype is some kind of demoversion. Here are the "brains" called arduino in the picture.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNLQHpJtlRJO2j9o6KqMPudomDJXYzQgSp5HTeaNKbrPFKcN0ywNrcX7YYEoSTe2US0SHKR4XdZN-9RWHV3fVfgQSPDFT1ixQqzQeCvGxWAM9qSYfwwgqOLchudDkrvjojpmzopQKlTd8/s1600/IMG_5412.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNLQHpJtlRJO2j9o6KqMPudomDJXYzQgSp5HTeaNKbrPFKcN0ywNrcX7YYEoSTe2US0SHKR4XdZN-9RWHV3fVfgQSPDFT1ixQqzQeCvGxWAM9qSYfwwgqOLchudDkrvjojpmzopQKlTd8/s640/IMG_5412.jpg" width="640" /></a></div>
<br />
First program or machine:<br />
<br />
I installed Lubuntu in dualboot and then opened command prompt:<br />
<br />
sudo apt-get update (here i updated the software database)<br />
sudo apt-get install arduino (this code installs the arduino environment)<br />
newgrp dialout (adds dialout group which is needed in arduino)<br />
arduino (starts the actual programming thing)<br />
<br />
At first i downloaded Arduino "Hello World!" program which blinks led light in socket 13 with 1 second delay. It worked and so I was sure the developing environment worked. Then I installed three leds on the testing board and programmed them to blink in order, first led blinks 3 times, second 2 times and the last one of course once. It worked very well ! Here is a video how the system works:<br />
<br />
<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/l1DfdkOoQQQ?feature=player_embedded' frameborder='0'></iframe></div>
<br />
And here is the actual code:<br />
<br />
void setup() { <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
pinMode(2, OUTPUT);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
pinMode(3, OUTPUT);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
pinMode(4, OUTPUT);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
}<br />
void green(){<br />
digitalWrite(3, HIGH);<br />
delay(150);<br />
digitalWrite(3, LOW);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
delay(150);<br />
}<br />
void yellow(){<br />
digitalWrite(4, HIGH);<br />
delay(50);<br />
digitalWrite(4, LOW);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
delay(50);<br />
}<br />
void red(){<br />
digitalWrite(2, HIGH);<br />
delay(100);<br />
digitalWrite(2, LOW);<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
delay(100);<br />
}<br />
void loop() {<br />
for (int i = 0; i < 3; i++){<br />
red();<br />
}<br />
for (int i = 0; i < 2; i++){<br />
green();<br />
}<br />
yellow();<br />
}<br />
<div>
<br />
Some screenshot:<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjr7nNd6nsLdIZ1yTKXyuAqXIyITYh2POTbtxRcH6o_KWsP_a2jp0LED4hWvwC0Iin8I3ftGDRrd9zpeEpUGRlA5uhfUX7Z6f-ZK1CD6QrvK_6FVJBoi1EUSGrXLyfxfmU0ciVjmLzMMM/s1600/2013-01-21-210200_1366x768_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjr7nNd6nsLdIZ1yTKXyuAqXIyITYh2POTbtxRcH6o_KWsP_a2jp0LED4hWvwC0Iin8I3ftGDRrd9zpeEpUGRlA5uhfUX7Z6f-ZK1CD6QrvK_6FVJBoi1EUSGrXLyfxfmU0ciVjmLzMMM/s640/2013-01-21-210200_1366x768_scrot.png" width="640" /></a></div>
<div>
<br /></div>
<div>
Last task was to invent a system with uses some sensor. I couldn't think anything so i just developed basic alarm system. We could use a ultrasonic sensor or infrared if there is a movement in the house or some place and then send email or pictures with webcam to internet to see what is currently happening in the house.<br />
<br />
How to setup the arduino environment:<br />
<br />
<span style="background-color: #444444; color: white;"><br /></span>
<div style="font-family: serif; line-height: 24px;">
<span style="background-color: #444444; color: white;">$ setxkbmap fi</span></div>
<div style="font-family: serif; line-height: 24px;">
<span style="background-color: #444444; color: white;">$ sudo apt-get update</span><br />
<span style="background-color: #444444; color: white;">$ sudo apt-get install arduino</span></div>
<div style="font-family: serif; line-height: 24px;">
<span style="background-color: #444444; color: white;">$ sudo adduser xubuntu dialout</span><br />
<span style="background-color: #444444; color: white;">$ newgrp dialout</span><br />
<span style="background-color: #444444; color: white;">$ arduino</span></div>
</div>
Unknownnoreply@blogger.com0