April 26, 2013

Stop motion with Pentax K5 and Arduino


Sebastian Setz has created an Arduino library that can emulate an IR remote for a system camera. It supports all major brands. I created a sketch that takes a picture when i push a button. I used it to create a stop motion movie where it is important not to move the camera between shots. This library could also be used to make time laps shots where the camera takes pictures at a defined interval.

Below you can see my set up for the stop motion. To make a video of the jpg images i used MakeAVI.


Here is the video.
 

April 16, 2013

Develop for Arduino on Android - ArduinoDroid

ArduinoDroid is an Arduino development environment (IDE) for Android providing (almost) the same functionality as the computer version. Almost since not all boards and functions are supported yet. An OTG cable and Android device capable of OTG are needed to upload code to the board.

I loaded the app on my Sony Xperia V and compiled the blinker example.Then I connected the Arduino UNO and upload it without problems! A great job done by Anton Smirnov that develops this.

My set up.
 

Screenshot

April 12, 2013

Fixing slow and not responding Firefox

After the latest updates of Firefox it has started run extremely slow both at startup and when surfing. I often got "not responding" and freeze of Firefox for several seconds when loading a web page. I have also seen this on other computers. Finally I have found the magic cure. What you need to do is a reset that will rebuild your profile while keeping the most important settings (bookmarks, passwords, etc) and removing old junk.

To do the reset open the "Troubleshooting Information" window:
Windows XP: Help -> Troubleshooting Information
For later versions of Windows: Firefox > Help -> Troubleshooting Information 

Then press the Reset Firefox button.

For a detailed description see the Mozilla support here.

April 9, 2013

Arduino Pro Mini low power modification


In this post I use an Arduino Pro Mini 5V 16 MHz MEGA328 powered by an external 5 V source. My application will run on a small battery so I need to minimize the power consumption. I measured the board to consume about 16 mA in normal operation.

My application can be in sleep mode until an event occurs. This is how to enter sleep mode:
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sleep_mode();


Make sure to used this include:
#include <avr/sleep.h>

Wake-up from sleep mode is done with an interrupt. That part is not covered in this post. In sleep mode I measured the current consumption to be 476 uA (microampere). To improve this is I did the following:
  1. Disabled the power on LED by removing the current limiting resistor. It got down to 152 uA.
  2. Removed the unused on board 5 Volt regulator to avoid leakage. This resulted in 136 uA.
The picture below shows the positions of the components that I have removed.

The battery that I will use is a 3.7 V 230 mAh Li-Po regulated by a TI TPS61200 Boost Converter. With an assumed efficiency of 90% I get 230 * (3.7 / 5) * 0.9 = 153 mAh. This gives the theoretical time of operation:

Sleep mode before: 476 uA => 321 h (~13days)
Sleep mode after: 136 uA => 1125 h (~46 days)
Normal operation  mode: 16 mA =>9.5 h

Conclusion: The improvement of the modification is about 3.5 times longer standby time in sleep mode. I was hoping for a month of standby time so with the improvements it should be enough for my design.

April 4, 2013

Monochrome 128x32 OLED Display

I purchased a tiny OLED display from the eBay seller wide.hk that also have a webpage. The dimensions for the module is about 13x34 mm and the interface is I2C.


Here is how to get the display running with Arduino. Download and install both these adafruit libraries:
https://github.com/adafruit/Adafruit_SSD1306
and:
https://github.com/adafruit/Adafruit-GFX-Library 

Hint: use the ZIP button on the github page to get all the files.

For installation instructions see my previous post.

Open the example ssd1306_128x32_i2c in the Arduino software. When compiling you will probably get this error mesage "ssd1306_128x32_i2c.ino:53:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");"

To fix this open the newly installed library file: Adafruit_SSD1306.h
Find these lines in the file:
   #define SSD1306_128_64
//   #define SSD1306_128_32

change them to:
//   #define SSD1306_128_64
   #define SSD1306_128_32

Save the file and compile again. This time it should complete without errors.
Hint: Use CTRL+R to compile.

Connect your display to the Arduino UNO as follows:
  • ⏚ to GND
  • + to 5V
  • SDA to A4
  • SCL to A5
The library is also using pin 4 as reset. This display does not have a reset terminal so just leave it unconnected.

Upload the code to the Arduino and your display should wake up!
Hint: Use CTRL+U to Upload.