Show Posts
Pages: 1 2 [3] 4 5 6
31  Using Arduino / Sensors / Opto-Isolator for Thermocouple on: July 28, 2013, 01:52:01 am
Hello,

Does anyone have a good solution to isolate a thermocouple.  Any recommendations for an opto-isolator.  I have searched the internet, and can't find much info. 

Thanks!
32  Using Arduino / Microcontrollers / Re: Building PC Software to interface with device on: July 26, 2013, 10:11:25 pm
Hello,  I would highly recomend Lab View.  You can buy the student version from sparkfun for $50.  You can build a beautiful user interface in minutes.  For example if you would like to change a sample rate.  Have the user type in the rate, and press send.  Then have your device read the serial port.  Update your sample rate variable with this new piece. 

The nice thing about Lab View is that information is everywhere.  A plug in for arduino has also already been built.  Hope this helps!
33  Topics / Science and Measurement / Re: Temperature control/data logging with excel on: June 16, 2013, 09:35:53 pm
If you parse the data just like a .csv you can import the data as a text file.  It will give you the option to separate the data using camas.  You can make a header in the text file, and have the data stream below it.  What are you logging the data to, an sd card?
34  Community / Gigs and Collaborations / Re: Standalone Data Aquasition System on: June 15, 2013, 08:23:55 pm
Sent you a PM RudiAhlers
35  Community / Gigs and Collaborations / Re: Standalone Data Aquasition System on: June 04, 2013, 08:56:51 pm
Its a 3K ohm resistor, and a 10pf cap. This works good in the 0-10000 rpm range. The sensors must then be recalibrated in the code .  I think most off the shelf thermocouple conditioning equipment use opti-isolators, but I have not tried these yet.  Let me know if this work, or if you find a better solution.
36  Community / Gigs and Collaborations / Re: purchase mega2560 manufacturer's part number list on: June 01, 2013, 04:48:27 am
I attached a BOM for a board very similar to the mega2560 it uses most of the same component's.  One major difference is it uses a FTDI chip for serial communication.  I found all these components on digikey, and the board has been tested with these components.  Hope this can help.
37  Community / Gigs and Collaborations / Standalone Data Aquasition System on: May 20, 2013, 10:18:06 pm
Hello everyone,

I have been building a stand alone data aquasition system.  The idea is to have something that can be strapped to an engine and collect data in harsh enviornments.  I have built one using the Arduino and shields, but now I need something a bit more rugged.  I have put together a design for a custom solution.  It uses a Atmega 2560.  I am on my second revision, and still having some trouble getting everything functioning.  As of right now I have 3 thermocouples, and a RPM(12V hall effect sensor) working.  I kind of got myself in over my head lol. If anyone is interested in helping I would be willing to ship you a board now, and one of each revision.  Thanks!

 The problems I am having are

1). The battery charging circuit is not working.  I assume this is because it has no way to switch off the rest of the circuit when it is charging.  I was thinking of adding some sort of transistor to do this.

2). I have 2 ADP1610 Step up converters.  One steps up the 3.7V to 5V, And that goes into the nevt converter.  This converter boost it up to 12V.  This part of the circuit is pulling way to much current.  The first converter gets extreamly hot!  Both put out the proper voltage, but it is way to hot!(hot enough to melt solder).  I tried changing inductor sizes, and adp switching speed, but no luck.

3). I have it wired for the gps, but run into problems when I try to get all the code working at the same time.  The gps code, and the max6675 use the spi bus for communication.

4). Last thing is a wierd problem with the thermocouples.  I had to put in a low pass filter to get them to work.  The engine is a terrible ground and without the filter a charge builds up, and resets the chip.

Any help with this stuff would be greatly appreciated.

Code:
//1.0.3 Removed NAN.  
//This code is functional  
//Added sample rate at 1hz
//Removed DHT sensor.  now has RPM, and three thermocouples
//Resets rpm to zero when unit is off.
#include <SD.h>
#include "DHT.h"
#include <LiquidCrystal.h>
#include "max6675.h"

#define DHTPIN 43        // what pin we're connected to for amb, and humidity
#define DHTTYPE DHT22   // DHT 22  (AM2302)

const int chipSelect = 10; //for SD
File dataFile;

volatile int rpmcount;
unsigned int rpm;
unsigned long timeold;

//Next six lines are for the five thermocouple pins.
int thermoDO = 27;
int thermoCS = 29;
int thermoCLK = 31;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

int VPin = 39;           //This sets variables for 5V and Ground for humidity sensor
int GPin = 41;

float ThermtempA;        //Thermocouple temperatures.
float ThermtempB;        
float ThermtempC;

int counter; //counter for thermocouples
long previousMillis = 0;        // will store last time data was writen
long interval = 800;           // sample rate ms.  Remember to take into account the 200ms delay.

int h = 0;
int t = 0;
//DHT dht(DHTPIN, DHTTYPE);

void setup() {
   Serial.begin(115200); //remember to check to see if this is fast enough for rpm input.
      
    attachInterrupt(0, rpm_fun, RISING);
         rpmcount = 0;
         rpm = 0;
         timeold = 0;
    int i=0;
    char filename[]="AC8Field.csv";
    
    digitalWrite(2, HIGH);

    //For multiplexer ADG608
    pinMode(39,OUTPUT);
    pinMode(A2,OUTPUT);
    pinMode(A4,OUTPUT);
    pinMode(A6,OUTPUT);
    digitalWrite(39,HIGH);//Enables adg608
  
    
        
    pinMode(SS, OUTPUT);//SD
    
    /*pinMode(VPin, OUTPUT);//Temp&Humidity
    digitalWrite(VPin, HIGH);//Sets pin 39 to 5V
    pinMode(GPin, OUTPUT);
    digitalWrite(GPin, LOW);//Sets pin 41 to Ground
    delay(1000);
    dht.begin();*/
    
    if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    while (1) ;
  }
  
  
  // Open up the file we're going to log to!
  dataFile = SD.open(filename, FILE_WRITE);
  if (! dataFile) {
    Serial.println("error opening datalog.txt");
    // Wait forever since we cant write data
    while (1);
    
  }
    
    Serial.println("SpkTemp, CarbTemp, AmbTemp, RPM");
    dataFile.println("SpkTemp, CarbTemp, AmbTemp, RPM");
    
    //set counter value for thermocouples
    counter=0;

}



void loop() {

 
  
   if (counter==0)
   {
     digitalWrite(A2,HIGH);//Sets to 1 1 0 channel B
     digitalWrite(A4,HIGH);
     digitalWrite(A6,LOW);

     ThermtempA = (thermocouple.readFahrenheit()-8.7654)/.9928;//calibrates thermocouple temp.
     counter++;
     //set variable "value" to value read from channel zero
   }
   else if (counter==1)
   {
     digitalWrite(A2,HIGH);//Sets to 1 0 0 channel C
     digitalWrite(A4,LOW);
     digitalWrite(A6,HIGH);

     ThermtempB = (thermocouple.readFahrenheit()-826.25)/.8295;//calibrates thermocouple temp.
     counter++;

   }
  
   else if (counter==2)
   {
     digitalWrite(A2,HIGH);//Sets to 1 1 1 channel A
     digitalWrite(A4,HIGH);
     digitalWrite(A6,HIGH);

     ThermtempC = (thermocouple.readFahrenheit()*1.1097)-508.53;//calibrates thermocouple temp.
     counter = 0;

   }
  
  
    if(rpmcount >= 50) {
     //Update RPM every 50 counts, increase this for better RPM resolution,
     //decrease for faster update
     rpm = 60.0*1000/(millis() - timeold)*rpmcount;
     timeold = millis();
     rpmcount = 0;
     }
   else if(rpmcount < 50){
    
               rpm = 60.0*1000/(millis() - timeold)*rpmcount;
if(rpm < 800){
  rpm = 0;
}
   }
  
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  //float h = dht.readHumidity();
  //float t = dht.readTemperature();

            //Serial.println(timer);
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;  
    
    
         Serial.print(ThermtempA); //Prints F=Thermocouple temp first
         Serial.print(",");
         Serial.print(ThermtempB); //Prints F=Thermocouple temp first
         Serial.print(",");
         Serial.print(ThermtempC); //Prints F=Thermocouple temp first
         Serial.print(",");
         Serial.println(rpm,DEC);
        
        
      dataFile.print(ThermtempA);
      dataFile.print(",");
      dataFile.print(ThermtempB);
      dataFile.print(",");
      dataFile.print(ThermtempC);
      dataFile.print(",");
      dataFile.println(rpm,DEC);

  }
                dataFile.flush();
                                    delay(200);

}
void rpm_fun()
 {
   rpmcount++;
   //Each rotation, this interrupt function is run twice
 }
38  Development / Other Hardware Development / Re: my own ft232rl circuit on: September 25, 2012, 06:44:44 am
Is your rx going to tx, and tx to rx.  Sorry couldn't pull your schematic up on my phone, but thought this could be the case. This causes the driver to download ok, but wont be able to upload.  Also, do you have the dtr pin to the reset line?  It might not be automatically reseting to upload.
39  Using Arduino / Storage / Re: Sd logger problem on: September 25, 2012, 06:39:02 am
I went back and checked the sd card pins.  Turns out i just did a terrible soldering job.  I resoldered it and it works perfect.  Thanks for your help!
40  Using Arduino / Storage / Re: Sd logger problem on: September 22, 2012, 12:12:54 am
I just built the circuit on a bread board again it has a micro sd broken out to the buffer chp, and the spi lines going to the buffer chip.  I tripple checked wiring.  Looks ok.  Now every once in a while I get -

Can't determine the card size.
Try another SD card or reduce the SPI bus speed.
The current SPI speed is: 2.00 MHz
Edit spispeed in this sketch to change it.

I changed the speed down to quarter, and still nothing. Also tried other SD cards.

I just put a resistor from GND to the middle of the chipselect line, and know it has that same error every time.  It initializes.  I hope I'm headed in the right direction, but still can't get it past that.
41  Using Arduino / Storage / Sd logger problem on: September 21, 2012, 07:57:24 pm
I made myself a sd shield to use with the mega it has a micro sd going to a sn74ahc125n and then to the SPI lines on the Mega.  It also has a 3.3v regulator.

MOSI -> 51
MISO -> 50
SCK  -> 52
CS    -> 10

I can not get any of the example sketches to work.  I have also tried a shield from adafruit with the same problem   http://www.ladyada.net/make/logshield//  I tried the sd library, and the sdfatlib.  The card wont initialise.  I had it working on a breadboard with no problems.  I am totally stumped.  I changed the chipselect in the sketch.

I have used the card with the one on a breadboard, so I know its formatted right. (I also tried 3 different sd cards)

Also I just upgraded to IDE 1.0.1  Could this have done anything?

Any help would be greatly appreciated. Here is the code. Thanks!

Code:
// Quick hardware test
#include <SdFat.h>
// Test with reduced SPI speed for breadboards.
// Change spiSpeed to SPI_FULL_SPEED for better performance
// Use SPI_QUARTER_SPEED for even slower SPI bus speed
const uint8_t spiSpeed = SPI_HALF_SPEED;
//------------------------------------------------------------------------------
// Normally SdFat is used in applications in place
// of Sd2Card, SdVolume, and SdFile for root.
Sd2Card card;
SdVolume volume;
SdFile root;

// Serial streams
ArduinoOutStream cout(Serial);

// input buffer for line
char cinBuf[40];
ArduinoInStream cin(Serial, cinBuf, sizeof(cinBuf));

// SD card chip select
int chipSelect;

void cardOrSpeed() {
  cout << pstr(
    "Try another SD card or reduce the SPI bus speed.\n"
    "The current SPI speed is: ");
  uint8_t divisor = 1;
  for (uint8_t i = 0; i < spiSpeed; i++) divisor *= 2;
  cout << F_CPU * 0.5e-6 / divisor << pstr(" MHz\n");
  cout << pstr("Edit spiSpeed in this sketch to change it.\n");
}

void reformatMsg() {
  cout << pstr("Try reformatting the card.  For best results use\n");
  cout << pstr("the SdFormatter sketch in SdFat/examples or download\n");
  cout << pstr("and use SDFormatter from www.sdcard.org/consumer.\n");
}

void setup() {
  Serial.begin(9600);
  cout << pstr(
    "\nSD chip select is the key hardware option.\n"
    "Common values are:\n"
    "Arduino Ethernet shield, pin 4\n"
    "Sparkfun SD shield, pin 8\n"
    "Adafruit SD shields and modules, pin 10\n");
}

bool firstTry = true;
void loop() {
  // read any existing Serial data
  while (Serial.read() >= 0) {}

  if (!firstTry) cout << pstr("\nRestarting\n");
  firstTry = false;

  cout << pstr("\nEnter the chip select pin number: ");
  cin.readline();
  if (cin >> chipSelect) {
    cout << chipSelect << endl;
  } else {
    cout << pstr("\nInvalid pin number\n");
    return;
  }
  if (!card.init(spiSpeed, chipSelect)) {
    cout << pstr(
      "\nSD initialization failed.\n"
      "Do not reformat the card!\n"
      "Is the card correctly inserted?\n"
      "Is chipSelect set to the correct value?\n"
      "Is there a wiring/soldering problem?\n");
    cout << pstr("errorCode: ") << hex << showbase << int(card.errorCode());
    cout << pstr(", errorData: ") << int(card.errorData());
    cout << dec << noshowbase << endl;
    return;
  }
  cout << pstr("\nCard successfully initialized.\n");
  cout << endl;

  uint32_t size = card.cardSize();
  if (size == 0) {
    cout << pstr("Can't determine the card size.\n");
    cardOrSpeed();
    return;
  }
  uint32_t sizeMB = 0.000512 * size + 0.5;
  cout << pstr("Card size: ") << sizeMB;
  cout << pstr(" MB (MB = 1,000,000 bytes)\n");
  cout << endl;

  if (!volume.init(&card)) {
    if (card.errorCode()) {
      cout << pstr("Can't read the card.\n");
      cardOrSpeed();
    } else {
      cout << pstr("Can't find a valid FAT16/FAT32 partition.\n");
      reformatMsg();
    }
    return;
  }
  cout << pstr("Volume is FAT") << int(volume.fatType());
  cout << pstr(", Cluster size (bytes): ") << 512L * volume.blocksPerCluster();
  cout << endl << endl;

  root.close();
  if (!root.openRoot(&volume)) {
    cout << pstr("Can't open root directory.\n");
    reformatMsg();
    return;
  }
  cout << pstr("Files found (name date time size):\n");
  root.ls(LS_R | LS_DATE | LS_SIZE);

  if ((sizeMB > 1100 && volume.blocksPerCluster() < 64)
    || (sizeMB < 2200 && volume.fatType() == 32)) {
    cout << pstr("\nThis card should be reformatted for best performance.\n");
    cout << pstr("Use a cluster size of 32 KB for cards larger than 1 GB.\n");
    cout << pstr("Only cards larger than 2 GB should be formatted FAT32.\n");
    reformatMsg();
    return;
  }
  // read any existing Serial data
  while (Serial.read() >= 0) {}
  cout << pstr("\nSuccess!  Type any character to restart.\n");
  while (Serial.read() < 0) {}
}


42  Development / Other Hardware Development / Re: Small-run PCB assembly on: September 17, 2012, 03:16:40 pm
You send the company your gerber files, and a build of materials.  If you have any other instructions on assembly also send them.  They will be able to quote you with this.  The company i talked to had a minimum of 20, but prices weren't practical until 100.  I have everything set up,  but have not yet had a fully assembled run made.  Hope this info helps, and good luck.
43  Development / Other Hardware Development / Re: 2560Tiny standalone board on: September 17, 2012, 03:11:01 pm
CrossRoads, I just added some money to my paypal so i'll send you some as soon as it clears in my account. You can set up an online store in about 5you minutes with bigcartel.com.  i have used them before. It's free for 5 items or less. It might be worth checking out.

The boards are $48.00 shipped to your door step in the US.  The assembly of these boards are costly.  They are double sided boards.  The point of the boards are to function the exact same way the arduino does,  but be lighter, and smaller.

How much do you think a bootloaded atmega2560 is worth?  The chip itself is $20 on digikey unless you buy more than 10 at a time.  Hopefully i can buy 100, so i can get them for $10.00.  After programming them, packaging them, and paying for shipping i don't think i could do it any cheaper. Thats not even thinking about taxes,  and credit card processing fees.

If you have any ideas on getting the price down im all ears.  Thanks.
44  Development / Other Hardware Development / Re: 2560Tiny standalone board on: September 15, 2012, 03:47:32 pm
I'd like to get one.  Do you except paypal,  or have an online store?
45  Development / Other Hardware Development / Re: 2560Tiny standalone board on: September 14, 2012, 08:33:31 pm
Awesome stuff.  I really like the Leonardino ("Little Leonardo").  What are the demensions of that board? 
Pages: 1 2 [3] 4 5 6