Simple Seismograph Arduino

Made with parts easy to get, very simple really. There's a video of how it works.

http://arduinohnev.blogspot.com/2009/05/seismograph-arduino.html :)

En español http://arduino.linuxmaya.com/2009/05/sismografo-arduino/

Very creative. Good job!

quite some nice idea.. i wonder if one could reduce the form factor a bit as i wanted to build a small seismograph for one of my projects as well...

very nice looking

First rate project and a very creative use of bits and pieces from your spares box.

Thank you all. :) ;)

Very nicely done

Jens Erik

Thanks for letting us have a look.

-- Martyn

Nice project...really neat idea.

I made a seismograph with an Arduino with my younger brother in-law for a science project except we used a ADXL 322 which was a much smaller form factor. Yours is much more interesting though. Here are a couple of pics:

http://www.flickr.com/photos/danwagoner/3332458809/in/set-72157607180162834/

http://www.flickr.com/photos/danwagoner/3333295294/in/set-72157607180162834/

Nice project. Which operating system is the computer running that allows it to be programmed in Pascal and talk to a usb Arduino through a serial port?

Nice project. Which operating system is the computer running that allows it to be programmed in Pascal and talk to a usb Arduino through a serial port?

The program run under MS-DOS, but it could be compiled for linux too.

Nice project...really neat idea.

I made a seismograph with an Arduino with my younger brother in-law for a science project except we used a ADXL 322 which was a much smaller form factor. Yours is much more interesting though. Here are a couple of pics:

http://www.flickr.com/photos/danwagoner/3332458809/in/set-72157607180162834/

http://www.flickr.com/photos/danwagoner/3333295294/in/set-72157607180162834/

Thanks but your looks definitely much better, a nice teamwork.

Would you be willing to share the pascal code you used to communicate with the Arduino?

Would you be willing to share the pascal code you used to communicate with the Arduino?

Here is the code

program sismografo_v2;
uses crt,otge;

const
     com1 = $3F8;
     com2 = $2F8;
     com3 = $3E8;
     com4 = $2E8;
     speed = $000C; {9600 bps}
     pmax = 156;

type
    puntos = record
           x,y : integer;
           color : byte;
           busy : boolean;
           end;

var
   salir,com_port_up : boolean;
   res : char;
   com_port : word;
   port_name : string[4];
   p1,p2 : ptvirtual;
   s1,s2 : word;
   fuente : letrero;
   punto : array[0..pmax] of puntos;
   i,counter : byte;

procedure gen_title;
begin
     clrscr;
     twriteln('Sismografo Arduino');
     if (com_port_up) then writeln('- Port ',port_name,' Active -');
     writeln;
end;

{Serial Setup start}
procedure inicia_port;
var
   porto : char;
begin
     gen_title;
     twriteln('Port Selection: ');
     twriteln('COM1 - 1');
     twriteln('COM2 - 2');
     twriteln('COM3 - 3');
     twriteln('COM4 - 4');
     porto:=readkey;
     case porto of
          '1' : begin
                     com_port:=com1;
                     port_name:='COM1';
                     end;
          '2' : begin
                     com_port:=com2;
                     port_name:='COM2';
                     end;
          '3' : begin
                     com_port:=com3;
                     port_name:='COM3';
                     end;
          '4' : begin
                     com_port:=com4;
                     port_name:='COM4';
                     end;
     end;
     write('Port Init - please wait... ');
     port[com_port+1]:=0;
     delay(500);
     port[com_port+3]:=128;
     delay(500);
     port[com_port+0]:=lo(speed);
     delay(500);
     port[com_port+1]:=hi(speed);
     delay(500);
     port[com_port+3]:=3;
     delay(500);
     port[com_port+2]:=199; {199 <- 14 bytes de buffer}
     delay(500);
     port[com_port+4]:=11;
     com_port_up:=true;
     writeln('Port is now active!');
     delay(1000);
end;

function data_in : string;
var
   buffer_in : string;
begin
     buffer_in:='';
     while (port[com_port+5] and 1 <> 0) do buffer_in:=buffer_in+chr(port[com_port]);
     data_in:=buffer_in;
end;

function data_in_byte : byte;
begin
     while (port[com_port+5] and 1 <> 0) do data_in_byte:=port[com_port];
end;

procedure data_out(byte_out : string);
var
   info_tam,i : byte;
begin
     info_tam:=length(byte_out);
     repeat
     until ((port[com_port + 5] and 32) <> 0);
     for i:=0 to info_tam do port[com_port]:=ord(byte_out[i]);
end;

procedure data_out_byte(byte_out : byte);
var
   i : byte;
begin
     repeat
     until ((port[com_port + 5] and 32) <> 0);
     port[com_port]:=byte_out;
end;
{Serial Setup end}

procedure inicializa;
begin
     for i:=0 to pmax do
     with punto[i] do
     begin
          x:=317;
          y:=180;
          busy:=false;
     end;
     counter:=0;
end;

function get_boom : string;
begin
     data_out_byte(100);
     delay(100);
     get_boom:=data_in;
end;

procedure dibuja;
var
   cadena : string;
   onda,code : word;
begin
     for i:=0 to counter do
     with punto[i] do
     begin
          dec(x,2);
          if not busy then
          begin
               val(get_boom,onda,code);
               case onda of
                    0..255 : color:=131;
                    256..511 : color:=130;
                    512..1024 : color:=129;
               end;
               y:=y-(onda div 4);
               if (y <= 10) then y:=10;
               busy:=true;
          end;
          if (i <= 0) then
          begin
               pixel(x,y,color,s2);
               pixel(x,y-1,color,s2);
               pixel(x-1,y-1,color,s2);
               pixel(x-1,y,color,s2);
          end
          else
          begin
               linea(punto[i-1].x,punto[i-1].y,x,y,196,s2);
               pixel(punto[i-1].x,punto[i-1].y,color,s2);
               pixel(punto[i-1].x,punto[i-1].y-1,color,s2);
               pixel(punto[i-1].x-1,punto[i-1].y-1,color,s2);
               pixel(punto[i-1].x-1,punto[i-1].y,color,s2);
          end;
          str(y,cadena);
          escribe_font(10,10,cadena,s2,fuente);
     end;
     inc(counter);
     if (counter >= pmax) then inicializa;
end;

procedure graficas;
begin
     grafico;
     crea_pv(p1,s1);
     crea_pv(p2,s2);
     carga_font('font.otf',fuente);
     if (up_pcx('escala.pcx',0,0,320,200,s1) <> 0) then
     begin
          inicializa;
          repeat
                copia_pv(s1,s2);
                dibuja;
                copia_pv(s2,vga);
          until(keypressed);
          del_font(fuente);
          del_pv(p1);
          del_pv(p2);
          texto;
     end
     else
     begin
          del_font(fuente);
          del_pv(p1);
          del_pv(p2);
          texto;
          writeln('File not found - (escala.pcx)');
          delay(1500);
     end;
end;

procedure check;
begin
     clrscr;
     gen_title;
     write('Data test: ');
     repeat
           gotoxy(12,4);
           write(get_boom);
           clreol;
     until(keypressed);
end;

begin
     salir:=false;
     com_port_up:=false;
     repeat
           gen_title;
           twriteln('OPTIONS MENU:');
           twriteln('1 - PORT SETUP');
           twriteln('2 - GRAPHIC MODE');
           twriteln('3 - CHECK COMUNICATION');
           twriteln('4 - EXIT');
           res:=readkey;
           case res of
                '1' : if not(com_port_up) then inicia_port else
                    begin
                         writeln('The port is already active!');
                         delay(1000);
                    end;
                '2' : if not(com_port_up) then
                    begin
                         writeln('The port is not active.');
                         delay(1000);
                    end
                    else graficas;
                '3' : if not(com_port_up) then
                    begin
                         writeln('The port is not active.');
                         delay(1000);
                    end
                    else check;
                '4' : salir:=true;
           end;
     until (salir);
     writeln;
     twriteln('See ya!!!');
     delay(2000);
end.

It use an graphic unit made by me called OTGE. but the serial setup section is what you need.