on march 11 my apartment in tokyo was shook by an earthquake of magnitude 9.0:
since i don’t have a mobile phone (i must be the only one in japan without a keitai) i wasn’t aware of the incoming earthquake and my software was useless (being alert 10 minutes after the earthquake):
by detecting the primary waves we know in how many seconds (depending on the epicenter location) an earthquake will occur. i don’t know if it’s possible to build a p waves monitoring device (anyone?), but for now i’m using a free software (windows & japanese only) that send me an alert (no hardware required).
connecting the software to a microcontroller was not that hard, but since i don’t want to boot in windows just for monitoring the p waves i had to hack little. grosso modo: virtual box (windows in linux) -> autoit (checking for a p waves popup) -> create file <- linux bash checking for new file -> send serial command to arduino -> physical feedback.
please make a donation to the japanese red cross society
i am using polycaprolactone (FDA approuved). the schematic is pretty simple, but i had to play with the capacitor and inductor to get more power into the vibrator. it’s overkill to use an attiny for cycling the colors of the led (i didn’t know that you can buy RGB led with built-in pwm). even so, i am sharing the small code, maybe it can be useful to someone. since i am using an electric toothbrush there’s no physical connection to recharge it, thus completely waterproof. i will need to remelt the polycaprolactone to change the battery someday.
now that i have a digital camera (but my heart will always belong to film-based photography) i can do time lapse photography. sadly the firmware of my camera isn’t supporting this feature, so i had to build an intervalometer. i didn’t want to use an arduino (overkill & pricy), so i went with an attiny45, a generic optocoupler, a voltage regulator and a potentiometer for adjusting the timer from 1 second to 1 minute.
i just found out that it’s possible to power the avr from the camera (focus ring). have a look at this complete and small solution: http://www.doc-diy.net/photo/hdr-jack/
//Intervalometer from 1 second to 1 minute//Author: Patrick Sebastien Coulombe//Website: www.workinprogress.ca//Date: 2010-07-24#define F_CPU 8000000#include <avr/io.h>#include <util/delay.h>// use PB2 for led, pin 7#define LED_BIT 2// select ADC2, PB4, pin 3#define CHANNEL 2// shutter on (in ms)#define HOLD 300 // Return the 10bit value of the selected adc channel.uint16_t get_adc(uint8_t channel){// ADC setup
ADCSRA =(1<< ADEN)|(1<< ADPS1)|(1<< ADPS0);// select channel
ADMUX = channel;// warm up the ADC, discard the first conversion
ADCSRA |=(1<< ADSC);while(ADCSRA &(1<< ADSC));
ADCSRA |=(1<< ADSC);// start single conversionwhile(ADCSRA &(1<< ADSC));// wait until conversion is donereturn ADCW;}// Scalelong map(long x,long in_min,long in_max,long out_min,long out_max){return(x - in_min)*(out_max - out_min)/(in_max - in_min)+ out_min;}// Main programint main(void){// varsuint16_t adcvalue =0;uint16_t i;// define LED as outputs
DDRB |=(1<< LED_BIT);while(1){//release the shutter
PORTB |=(1<< LED_BIT);//exposure lengthfor(i=0; i<HOLD; i++){
_delay_ms(1);}
PORTB &= ~(1<< LED_BIT);//interval time (using a potentiometer to adjust)
adcvalue = map(get_adc(CHANNEL),0,1023,1,60);
adcvalue = adcvalue *1000;//one way to achieve long delayfor(i=0; i<adcvalue; i++){
_delay_ms(1);}}return0;}
Time lapse test (3 hours) from my balcony.
I used Blender for making the tilt / shift effect. Here’s the source of the Blender file.
10 watts amplifier with built-in 16-bit / 48kHz RIFF-WAVE player (music on a SD-CARD). 2 servos for controlling the beaks. I did this project mostly to learn stuff. The result is a bit stupid.