Show Posts
Pages: [1] 2 3 ... 8
1  Using Arduino / General Electronics / Help with CANbus Data logging on: January 13, 2014, 05:25:00 pm
Hello,

I am trying to save CANbus data from my motorcycle when I am riding it.
The CAN bus is sending a data packet every millisecond and I would like to have a fast enough system to capture and save it accurately.
I have a Sparkfun Logomatic (https://www.sparkfun.com/products/10216) and I am thinking of getting OBD-II UART (https://www.sparkfun.com/products/9555) to send CAN data to the logomatic for logging.
I need your help to merge these boards together.  Or if you have any other solution, I am open to suggestion.
Also I should mention that I can't use an Arduino for this (no matter how much I want to)...

Thanks
2  Using Arduino / General Electronics / Re: High side and low side mosfets in one circuit on: November 08, 2013, 01:23:13 pm
Thanks for the reply,
The second option with P channel and N channel mosfet is what I meant.

Is there any application notes about the circuit setup of this kind. I dont really care about the leakage currents anyway. Just as long as load is not connected to power or ground is good enough for me.

Thanks
3  Using Arduino / General Electronics / High side and low side mosfets in one circuit on: November 08, 2013, 12:47:48 pm
Hi,

I know how high side mosfet and driver and low side mosfet and driver work. I was wondering if it would be possible to drive a load like this: first the power supply, then comes a high side mosfet with its own driver, then comes the load, then a low side mosfet and driver, and finally ground...
The reason is that I dont want my load connected to either the power or ground when it is not driven...

Thanks
4  Using Arduino / Programming Questions / Re: Code Question on: November 07, 2013, 01:53:51 pm
What about the
Code:
^ 1

Thanks
5  Using Arduino / Programming Questions / Code Question on: November 07, 2013, 01:44:51 pm
Hi there,

anybody care to explain this code for me:
Code:
if(myCountOn > 0)
        digitalWrite((myPwmInhibit) ? PIN_INHIBIT : PIN_OUT,ON_STATE);
and this
Code:
if(myCount == myCountLow)
      digitalWrite((myPwmInhibit) ? PIN_INHIBIT : PIN_OUT,ON_STATE ^ 1);

Thanks
6  Using Arduino / Programming Questions / Finding index of closest integer in an array on: October 25, 2013, 04:16:14 pm
Hi,

I have non-linear thermistor and I have a table showing ADC analogRead values to temperature from -40 to 150 degrees C.
Now, let say I read the analogRead for thermistor and returns an integer 0 to 1023. How do I find the closest matching ADC number in my table?
I have tried to look at binary search, but I think it is used for finding exact match. Not good for me!!!

Thanks
7  Using Arduino / Project Guidance / CircuitWorks Board file to Eagle on: October 18, 2013, 04:05:08 pm
Hi

I am trying to import a board design from CircuitWorks to Eagle. Eagle can accept .brd format.
The thing is circuitworks can export a .brd file, but when I try to open it with Eagle I am given an error.
"Start tag Expected"
I tried opening the circuitworks generated brd file in notepad and it looks very different from a brd file that was designed and saved in eagle.
Is there any tutorial or converters out there that lets me accomplish this task.

Thanks
8  Using Arduino / General Electronics / SMD temperature sensor with dedicated heat transfer pin. on: October 09, 2013, 05:05:53 pm
Hi,
 I am looking for a temperature sensor IC with the following specifications:
- Automotive grade
- Output voltage linearly proportional to Celcius
- Sensing range of -40 to 125 Degrees Celcius
- DC offset to allow measurement of negative temperature without the need of negative supply
- wide supply range
- Very low self heating when encapsulated in potting epoxy
- Small package size
- (IMPORTANT) Have a dedicated probe pin for measuring temperature of a pad. This pad should not be electrically connected in any way; it should act as heat transfer only.
The device should handle current (80A) and voltage (100V) spikes in its vicinity (not directly connected to sensor).

I have looked at the following as well:
TC1047A (does not have a heat transfer pin. Other than that is has very good specs)
MCP9701A (not sure if the NC pins in the 5 pin package are heat transfer pins)

Thanks,
9  Using Arduino / General Electronics / Re: Need help sourcing a IC temperature sensor on: August 15, 2013, 05:14:47 pm
Thanks for the replys.

I found my answer:
MCP9701 from microchip
or
TC1047 from microchip
or
LM60 from TI
10  Using Arduino / General Electronics / Need help sourcing a IC temperature sensor on: August 15, 2013, 02:44:38 pm
Hello,

I am looking for an ic with temperature sensor built in. What I really need is a SMD IC that I can use to measure the temperature of a PCB pad. This means that the IC has to have some pins to conduct the temperature inside the IC, then the IC will output a ADC (0 to 5) or analog (0 to 5) signal.
The IC I need has to be very small and preferably have Vcc, GND, and Signal. In addition to these pins it should have one or more pins to conduct the heat of the pad I am trying to measure inside the IC.
The temperature range I am looking for is -40 to 100 degrees Celsius.

Thanks
11  Using Arduino / Programming Questions / Re: Reading a variable that is manipulated by ISR on: August 08, 2013, 01:03:25 pm
Thanks...

I had it declared as volatile... just wanted to make sure...
12  Using Arduino / Programming Questions / Reading a variable that is manipulated by ISR on: August 08, 2013, 12:37:57 pm
Hi,

My ISR is incrementing a variable "count" and 1kHz.
I need to read this variable inside my "loop()".
Is there going to be a problem if at the moment I am reading this variable, the ISR kicks in and corrupt my variable?
is there some safety measures I can do for protection against data corruption?

Thanks
13  Using Arduino / Programming Questions / Reducing Clock cycles to do a long calculation on: August 06, 2013, 12:54:09 pm
Hi

I am performing a very long calculation in Arduino, and speed is very critical. The calculation is Bilinear interpolation.
Assuming all the variables are ints (2 byte), my question is how many clock cycles does it take to do a certain operation:
Division
Multiplication
Addition
Subtraction

Thanks
14  Using Arduino / Project Guidance / Integer Math error reduction techniques on: August 02, 2013, 05:26:56 pm
Hello,

I want to implement the Bilinear interpolation in arduino and accuracy is very important. http://en.wikipedia.org/wiki/Bilinear_interpolation
Is there a to keep precision while doing the calculations in integers?

Thanks
15  Using Arduino / Programming Questions / Re: Finding a number in a large array on: July 31, 2013, 04:17:21 pm
Thank you all for the replys and your interest in this...

The data type of all tables are ints
the tables are generated by excel by a very long complex polynomial. I tried the equation in arduino and it was not satisfactory... i have to stick to tables
here are some mini examples of the tables. the tables will get larger than these:
Code:
const int tempTable [][2] = {
// ms , Temp
  {100, 59},
  {150, 54},
  {200, 49},
  {250, 44},
  {300, 39},
  {350, 33},
  {400, 28},
  {450, 23},
  {500, 18},
  {550, 13},
  {600, 7}};

const int ONtimeTable [][11] = {
// BAR 5  , 6  , 7  , 8  , 9  , 10 , 11 , 12 , 13 , 14 , 15   //Temp
      {727, 749, 771, 794, 816, 838, 860, 883, 905, 927, 949},  //10
      {662, 684, 706, 728, 751, 773, 795, 817, 839, 862, 884},  //15
      {596, 618, 641, 663, 685, 707, 730, 752, 774, 796, 818},  //20
      {531, 553, 575, 598, 620, 642, 664, 686, 709, 731, 753},  //25
      {466, 488, 510, 532, 554, 577, 599, 621, 643, 666, 688},  //30
      {400, 422, 445, 467, 489, 511, 533, 556, 578, 600, 622},  //35
      {335, 357, 379, 401, 424, 446, 468, 490, 513, 535, 557},  //40
      {269, 292, 314, 336, 358, 380, 403, 425, 447, 469, 492},  //45
      {204, 226, 248, 271, 293, 315, 337, 360, 382, 404, 426},  //50
      {139, 161, 183, 205, 227, 250, 272, 294, 316, 339, 361},  //55
      {73,  95,  118, 140, 162, 184, 207, 229, 251, 273, 295}}; //60

const int ValveTimeoutTable[][2] = {
// Temp, ms
  {10, 1308},
  {15, 1369},
  {20, 1430},
  {25, 1491},
  {30, 1552},
  {35, 1613},
  {40, 1674},
  {45, 1735},
  {50, 1796},
  {55, 1857},
  {60, 1918}};

The baud rate is 57600... this is the fastest I can go, because any faster and I will get garbage data... the format will mess up...
Every 5 ms I am sending 5 ints to computer

By "it" I mean the process of looking up data from 3 tables ( two tables of 1D and one table of 2D...[above]) and applying linear interpolation on the 1D and bilinear interpolation on the 2D...

I have cooked up the linear interpolation function: (the bilinear will be soon to come)...
Code:
int OneDimLookUp ( const int table[][2], int X) {
  int lowIndex, highIndex;
  int X0, Y0, X1, Y1, Y;
 
  lowIndex = (X/50) - 2;
  highIndex = (X/50) - 1;
 
  X0 = table[lowIndex][0];
  X1 = table[highIndex][0];
 
  Y0 = table[lowIndex][1];
  Y1 = table[highIndex][1];
 
  Y = Y0 + ((Y1 - Y0)*(X - X0))/(X1 - X0);
 
  return Y;
}

I am getting good results from this. I wrote a code that does this lookup and linear interpolation 500 times and it takes about 18ms to complete...
Here is the test code:
Code:
void loop() {
  if (run) {
    Serial.println(micros());
    for (int i = 100; i < 601; i++) {
      output = OneDimLookUp(tempTable, i);
    }
    Serial.println(micros());
    Serial.println(tempTable[0][0]);
  }
  run = 0;
}

So the thing that worries me is if arduino can do "it" in less than 1 ms or not. And if not, is there a faster and more efficient way of doing this?

Thanks
Pages: [1] 2 3 ... 8