Show Posts
Pages: 1 2 [3]
31  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Open Source Data Logger Project Using the Ardu on: February 06, 2008, 01:39:42 am
I did a bit of work on this and got an SD card working (reading/writing) no problem which makes it very easy (and cheap!) to store large amounts of data. Using even a small SD card u could capture data at reasonably high sample rates for a long time. I also added a max1307 real time clock to add timestamps. I did a bit of work on an arduino shield for the circuit with all of this on it but haven't sent it off yet.

To get 8 channels I guess it needs an multiplexer
You can add an 4051 which will give you 8 channels on one analog input and use 3 digital lines.

Real Time data is required/Data visualization
This is actually easier than storing it in a storage device. Just write the results you get to serial. On the pc side read them in and graph them (processing can do this) other options could be python or VBA. There is also a few programs around to do this. A quick google found this one http://www.live-graph.org/



I'll post up my circuits and code once I have it working ok and everything is cleaned up and its not too embarrassing   smiley-razz  
32  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Open Source Data Logger Project Using the Ardu on: December 15, 2007, 05:37:06 pm
The whole thing should be reasonably easy. I might have a go when I get my new decimelia. You can get a 64k eeprom from futurlec for $2.20 (http://www.futurlec.com/ICEEPROM.shtml) so it shouldn't cost too much, an eeprom, 4051 for more inputs and some kind of shield or circuit board to hold it all. You might be able to put the whole thing together with a real time clock for not much. I'm gonna have a go at interfacing an SD card soon and if that works then it would probably end up cheaper and easier to do that (plus u have the benefit of all that storage).
33  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Motion Capture System on: March 30, 2008, 01:37:41 am
I'll try and post up the code for writing to an SD flash card in the next few days. Maybe that would suite your needs. Then you dont need to buy expensive chips and stuff and can just write to SD cards.
34  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Can my Arduino be a clock? on: January 23, 2008, 01:15:41 am
Maxim DS1307 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2688 is an 8pin DIP RTC that uses a tiny standard clock crystal. If you do a search on the forums and also in the playground there are code and examples on how to use it. You can order samples from maxim for nothing and I got my crystals from toys in cornflakes boxes(no joke!) and old motherboards. Just look on any toy or old motherboard for a small round metal can that looks similar to an electrolytic capacitor, thats usually the crystal.
35  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Generating Composite Video on: July 24, 2007, 12:41:34 am
I got the same signal when I first tried it. The solution is don't use digitalwrite, you can only change one pin at a time using that function(so it takes some time to change once and then again so you get step). Just output directly to the port

e.g portb=00000011;

instead of calling digitalwrite() twice. Once I did that I got a clean signal without the steps as shown in your oscilloscope. Also make sure interrupts are disabled. Cheers. Maybe that will help.
36  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Generating Composite Video on: July 23, 2007, 02:53:48 am
Its much more precise using ASM or C but you can generate a valid video signal using arduino. The PAL standard for example allows +-0.3 microseconds for its timing pulses. By using some asm nops you can tune your code to work ok. The main problem people seem to be having is they aren't generating proper signals....not using eq pulses and field sync pulses for example in their code. Also it is important to disable the interrupts. If you get hold of the specifications for TV signals, and follow them, you can generate something that will work ok on most modern tv's.

If you don't have an oscilloscope then you can use a timing trick mentioned in this thread http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1174587934/10#10

to measure timing precisely. I'm gonna get hold of a DSO in a few weeks and I'll write a better video gen example then.
37  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Generating Composite Video on: July 14, 2007, 07:50:15 pm
And the other half....just a copy of the first half  smiley Cut and paste both of these into one file and it should be good to go.

Code:
//
  // Generate 5 Narrow Equalization pulses
  //
  PORTD = B10000000; // Make the sync high to start with
  for(i=0;i<5;i++)
  {
     PORTD = B00000000; // Sync pulse goes low and delay 2.3 microseconds
     delayMicroseconds(1);
     delayMicroseconds(1);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
     PORTD = B10000000; // Sync pulse goes high and delay 29.7 microseconds
     delayMicroseconds(29);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
  }
  
  //
  // Generate the 5 Field Sync Pulses
  //
  for(i=0;i<5;i++)
  {
    PORTD = B00000000; // Sync goes low and delay 27.3 microseconds
    delayMicroseconds(27);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // 0.3 microseconds
    PORTD = B10000000; // Sync goes high and delay 4.7 microseconds
    delayMicroseconds(1);
    delayMicroseconds(1);
    delayMicroseconds(1);
    delayMicroseconds(1);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // 0.7 microseconds
  }
  //
  // Generate 5 Narrow Equalization pulses
  //
  for(i=0;i<5;i++)
  {
     PORTD = B00000000; // Sync pulse goes low and delay 2.3 microseconds
     delayMicroseconds(1);
     delayMicroseconds(1);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // 0.3 microseconds
     PORTD = B10000000;
     delayMicroseconds(29); // Sync pulse goes high and delay 29.7 microseconds
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); // 0.7 microseconds
    
  }
  
  // Generate 18 Blank Frames
  for(i=0;i<18;i++)
  {
    PORTD = B00000000;    //0 volts
     delayMicroseconds(4);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); //0.7 microseconds
    PORTD = B10000000;
    delayMicroseconds(59);
  }
  
    
 //  
  // Generate the next half of the Image
  //
  for(i=0;i<285;i++)
  {
    //
    // Front Porch
    //
    PORTD = B10000000;
    delayMicroseconds(1); // Front Porch: 1.65 microseconds
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Generate sync pulse
    //
    PORTD = B00000000;    // Sync pulse pulled low: 4.7 microseconds
     delayMicroseconds(4);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Back Porch
    //
    PORTD = B10000000;    // This is the back porch: 5.6 microseconds.
    delayMicroseconds(5);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Drawing starts here: Total time available is 53 microseconds
    //
    PORTD = B10000000;    // Draw black
    delayMicroseconds(20);
    PORTD = B11000000;    // Draw white
    delayMicroseconds(10);
    PORTD = B10000000;    // Draw black
    delayMicroseconds(22);
    
    
  }
}

38  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Generating Composite Video on: July 14, 2007, 07:47:54 pm
I managed to get the Arduino generating a PAL signal. My TV syncs to this signal without any problems. I followed the specs for a PAL signal as close as possible. It uses asm nops to try and get more precise delay times. Each nop is a 65ns delay (1 instruction at 16 Mhz...it should be 65ns but i don't have a good enough oscilloscope to check). The PAL signal has +- 0.3 microseconds leeway on the sync signals anyway so it works ok.

The code generates a white bar in the middle of the TV. Here is the first half.

Code:
int pixel = 6;  // Connected to 550ohm resistor (Should be 470ohm)
int sync = 7;   // Connected to 1k ohm resistor
int i;

void setup()
{
  pinMode(pixel,OUTPUT); // Switch to output pin
  pinMode(sync,OUTPUT);  // Switch to output pin
  cli();                // Turn off interupts
}


void loop()
{
  //
  // Generate 5 Narrow Equalization pulses
  //
  PORTD = B10000000; // Make the sync high to start with
  for(i=0;i<5;i++)
  {
     PORTD = B00000000; // Sync pulse goes low and delay 2.3 microseconds
     delayMicroseconds(1);
     delayMicroseconds(1);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
     PORTD = B10000000; // Sync pulse goes high and delay 29.7 microseconds
     delayMicroseconds(29);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
  }
  
  //
  // Generate the 5 Field Sync Pulses
  //
  for(i=0;i<5;i++)
  {
    PORTD = B00000000; // Sync goes low and delay 27.3 microseconds
    delayMicroseconds(27);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    PORTD = B10000000; // Sync goes high and delay 4.7 microseconds
    delayMicroseconds(1);
    delayMicroseconds(1);
    delayMicroseconds(1);
    delayMicroseconds(1);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
  }
  //
  // Generate 5 Narrow Equalization pulses
  //
  for(i=0;i<5;i++)
  {
     PORTD = B00000000; // Sync pulse goes low and delay 2.3 microseconds
     delayMicroseconds(1);
     delayMicroseconds(1);
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
     PORTD = B10000000;
     delayMicroseconds(29); // Sync pulse goes high and delay 29.7 microseconds
     __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
  }
  // Generate 18 Blank Frames
  for(i=0;i<18;i++)
  {
    PORTD = B00000000;    // Pull sync pin low -> 0 volts
     delayMicroseconds(4);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    PORTD = B10000000; // Pull sync pin high
    delayMicroseconds(59);
  }
  //  
  // Generate half the Image
  //
  for(i=0;i<285;i++)
  {
    //
    // Front Porch
    //
    PORTD = B10000000;
    delayMicroseconds(1); // Front Porch: 1.65 microseconds
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Generate sync pulse
    //
    PORTD = B00000000;    // Sync pulse pulled low: 4.7 microseconds
     delayMicroseconds(4);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Back Porch
    //
    PORTD = B10000000;    // This is the back porch: 5.6 microseconds.
    delayMicroseconds(5);
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
    
    //
    // Drawing starts here: Total time available is 53 microseconds
    //
    PORTD = B10000000;    // Draw black
    delayMicroseconds(20);
    PORTD = B11000000;    // Draw white
    delayMicroseconds(10);
    PORTD = B10000000;    // Draw black
    delayMicroseconds(22);
    

  }
39  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Frequently-Used OpAmps? on: June 16, 2007, 03:47:16 am
Your best bet is to buy an instrumentation op-amp. Go to analog devices for example and check their op-amp range for inst op-amps.  Instrumentation op-amps have good CMRR and are specially designed to do the task you want. The data sheets often have good example circuits too.
40  Forum 2005-2010 (read only) / Bar Sport / Re: Littlebird Electronics. on: January 10, 2008, 03:39:34 am
I'm from aus and I ordered from adafruit for my second arduino and with the US exchange rate at the moment it worked out cheaper and also faster getting it from US than Little Bird. It was just b4 xmas as well.  smiley I recommend adafruit.
Pages: 1 2 [3]