Archive for the ‘Arduino’ Category

#Arduino -> Nikon trigger via laser for watterdrops

Monday, February 22nd, 2010

Today I have been asked if I can write something about mine Nikon Arduino trigger video that I have put on Youtube.

And here it is, description, schematics, video and sample pictures.

The idea has already been seen on the Internet. Arduino is controlling photo resistor on which laser beam is pointed. When resistance changes itself because of the drop that is cutting beam then Arduino is triggering Nikon camera after the amount of time specified with one trim capacitor which can be between 0 and 1023, but I have divided it with 2 so that I have better control of the delay. All information is displayed on 2×16 LCD display. Also to be able to take picture of drops colliding it’s necessary that speed of the drops be 10 drops/sec so I have implemented one button for that with proper code behind it.

I have also 4 buttons and 2 led diodes on the board. Buttons that I have are reset for resetting of the electronics, debug that is switching debug mode on and off, drops that is designed to count drops per second and ready button that is used when I’m taking pictures so that when drops are falling fast I don’t trigger camera every time when they are going down. Led diodes that I’m using are green for power and yellow for visual notification when the trigger is trigged.

Here is the final schematics that I’m using right now.

Nikon-Arduino trigger schema

Nikon-Arduino trigger schema

For simplified solution with cables I’m using standard audio cables with 3.5mm stereo jacks on both sides, so I can use same cables for other purposes as well. I have also modified Nikon cable remote so that it has 3.5mm female stereo jack built in for simple use with trigger and without it.

Nikon trigger schema

Modified Nikon cable release

Here are few pictures of the whole setup.

Nikon Trigger

Nikon Trigger

Nikon Trigger

Nikon Trigger

Of course code behind is in this NikonFastTrigger.pde (14) file available for download.

Simple instructions.

  1. when the program is loaded it will display Ready on the second line
  2. when drop breaks laser beam then instead of Ready on display will be Busy until you press Ready button
  3. offten because I have laser box about 1m above the surface delay is needed between 150-220 ms

For drops counter I’m doing like this.

  1. switch to drops counter with drops button
  2. then I try to create drops stream with about 1 drop per second with help of the normal digital watch and by changing delay I set Arduino to recognize that as 1drop/sec
  3. now the only thing left is to configure drops stream to 10 drops/second for colliding watterdrops

Here are couple of pictures captured with this setup and pictures of colliding drops are to come.

And here is the video from YouTube.

Arduino wired remote code scanner for Alpine

Monday, November 23rd, 2009

Currently I’m working on project of interfacing Alpine with Peugeot steering wheel audio controls. I have founded some codes on mp3car.com but not all of them are working on my Alpine CDE-9880R.

Because some of them doesn’t work on my HU I had first to build Arduino scanner to scan for those missing remote codes.

Although I’m sending codes as binaries it was easier for me to work with decimals on the serial console and then latter convert them to binary so I have wrote function for that as well.

Because the first part of signal is always the same there was not need to convert it at all, and it’s stored in variable iHello, so the part that is changed is the second part or 3 decimal numbers.

Now because there are 255*255*255 = 16 581 375 possible combinations I had to bring this to some reasonable number otherwise it would take very much time to find right codes so I have limited combinations a bit.

I took the lowest and the highest values from codes from link above for the first and the second decimals, and limited the third one to 2 possible numbers that I’m sending as finish 85 or 213.

Here are those codes that I have founded working on my HU:

  1. 87  253   85 ( 01010111  11111101  01010101 ) – Pause
  2. 107 247   85 ( 01101011  11110111  01010101 ) – Band/ta
  3. 111  237   85 ( 01101111  11101101  01010101 ) – Defeat
  4. 119 235   85 ( 01110111  11101011  01010101 ) – Power
  5. 173 238 213 ( 10101101  11101110  11010101 ) – Mute
  6. 183 219   85 ( 10101101  11101110  11010101 ) – Source
  7. 187 218 213 ( 10111011  11011010  11010101 ) – Next Track
  8. 93  250 213 ( 01011101  11111010  11010101 ) – Previous track
  9. 219 214 213 ( 11011011  11010110  11010101 ) – Volume up
  10. 109 246 213 ( 01101101  11110110  11010101 ) – Volume down
  11. 171 239 85 ( 10101011  11101111  01010101 ) – Folder/memory up
  12. 85 255 85   ( 01010101  11111111  01010101 ) – Folder/Memory down

Now because I have IR remote for my HU and defeat is not on it I assume that it’s possible to find even more codes for it but I didn’t those so I stopped here where I have everything for my first project.

Here are pictures of the interface that I have built for testing of codes. It consists of 5 buttons which have been assigned different functions and 3.5 mm female audio jack which I use for connection with HU. HU has the same 3.5 mm female jack on the back so I can use regular 3.5mm stereo cable for testing without any modifications on HU or Arduino board.

Here is the Arduino Alpine scanner (63) sketch file with all functions that I have used for scanning, saving and displaying codes on serial console.

Here are the instructions how to use this sketch to find codes.

  1. First you need to erase eeprom with erase function to be sure that it’s clean on the start of scan.
  2. Now comment out function for erase and uncomment function for saving combination on eeprom
  3. Now you are ready for scan, so when you connect Arduino to your HU just press button 4 to start scan
  4. When you see some change on HU you need to press button 4 to stop scan
  5. Using buttons 1 and 3 you can go back or forward to find that combination that you discovered
  6. When you find it you can verify it with button 2 which repeats it again
  7. If that is combination that you are looking fore press button 5 to save it to eeprom
  8. When you have found all combinations that you are interested of connect Arduino to computer and on serial console you will have all combinations that you have found, so copy and paste them in iFounded array
  9. Comment out functions for saving, previous and next button and uncomment functions for import of combinations, sending of previous and next combinations
  10. Now when you power up Arduino press button nr 5 to import combinations and cycle them with buttons 1 or 2 to confirm that you have right combinations saved

Now when I have all of the codes needed to control HU I can finish the first project and the post about it is coming soon.

Any comments are welcome.