Show Posts
Pages: 1 ... 13 14 [15] 16 17 ... 23
211  Topics / Science and Measurement / Re: Why use bridge vs. other measurement circuits for thermistors? on: April 21, 2013, 08:10:33 am
Quote
So with a single value of the potentiometer in the first leg you may compensate to zero the thermistor of ANY value in the second.

Yes, of course he just needs to do it once. If the "zeroing" is constantly done then the bridge will always be balanced at any temp with no differential output. The ten turn pot is to allow precise adjustment and recalibrate for drift errors from time to time if necessary. Another way is to use 1% or lower tolerance resistors with high stability.
212  Topics / Science and Measurement / Re: Why use bridge vs. other measurement circuits for thermistors? on: April 21, 2013, 07:02:40 am
Quote
Not sure how a bridge circuit can have impedances that are close to balanced unless you employ a variable impedance resistor in the bridge? Or perhaps a ladder of resistors in series that are shorted by transistors as needed?

Yes, that's how you will need to balance your bridge (Zeroing) for the temp you want to establish as reference. Ten turn precision pots are regularly used for that. Another way is to set an offset voltage level added to the diff amp. If the signal is converted to digital, corrections can also be done by adding or subtracting a "DC voltage" value to the samples to compensate for the difference and zeroing the bridge. 
213  Topics / Science and Measurement / Re: Why use bridge vs. other measurement circuits for thermistors? on: April 20, 2013, 06:19:15 pm
Quote
chances are the noise will be picked up by both lines, and therefore should/will be rejected at the inputs of your differential amp. Only the true signal (i.e. the data you want),will be accepted by the diff opamp. So it has better noise immunity.

That's exactly why.

edit a little bit  smiley-wink

chances are the common mode noise will be present at both inputs with the same amplitud  and therefore should/will be rejected by your differential amp. The diff amp will not amplify (or very little) if there is no difference between the inputs. Only the true signal (i.e. the differential signal, the signal you want), will be amplified by the diff amp. So it has better noise immunity.

This subjects will help.
-Common Mode Rejection Ratio (CMRR) of the diff amp.
-Wheastone Bridge

214  Topics / Science and Measurement / Re: Artificial Horizon+Compass. on: April 20, 2013, 11:09:32 am
Hi:

I did a few modifications with respect to what appears in the video, like decreasing the precision of the variables and rotating the Pitch scale instead of the Bank one.

I'd like to see someone adding the code to handle 3 simple pots connected to 3 Arduino analog inputs to have it ready (better if the code can handle 360 deg pots at least for the compass). I don't want to do that now.

I had the CircularScale(); function already written for a previous project and decided to reuse it here instead of going PVectors as the instructions are low level and simple so they can easily be modified for other languages.

Here is the code:

//Artificial Horizon+Compass by Adrian Fernandez 4-19-2013
//Built with Processing 1.5.1
int W=1350; //My Laptop's screen width
int H=690;  //My Laptop's screen height
float Pitch;
float Bank;
float Azimuth;
float ArtificialHoizonMagnificationFactor=0.7;
float CompassMagnificationFactor=0.85;
float SpanAngle=120;
int NumberOfScaleMajorDivisions;
int NumberOfScaleMinorDivisions;
PVector v1, v2; //For testing only

void setup()
{
  size(W, H);
  rectMode(CENTER);
  smooth();
  //strokeCap(SQUARE);//Optional
}

void draw()
{
  background(0);
  translate(W/4, H/2.1); 
  MakeAnglesDependentOnMouse();
  Horizon();
  rotate(-Bank);
  PitchScale();
  Axis();
  rotate(Bank);
  Borders();
  Plane();
  ShowAngles();
  Compass();
  ShowAzimuth();
}

void MakeAnglesDependentOnMouse() //For testing only.
{
  v2= new PVector();
  v1= new PVector(W/2, H/2);
  v2.x=mouseX;
  v2.y=mouseY;
  Bank = PVector.angleBetween(v1, v2);
  Pitch=mouseY-H/2;
  Azimuth=(180/PI*10*Bank)%360;
}

void Horizon()
{
  scale(ArtificialHoizonMagnificationFactor);
  noStroke();
  fill(0, 180, 255);
  rect(0, -100, 900, 1000);
  fill(95, 55, 40);
  rotate(-Bank);
  rect(0, 400+Pitch, 900, 800);
  rotate(Bank);
  rotate(-PI-PI/6);
  SpanAngle=120;
  NumberOfScaleMajorDivisions=12;
  NumberOfScaleMinorDivisions=24; 
  CircularScale();
  rotate(PI+PI/6);
  rotate(-PI/6); 
  CircularScale();
  rotate(PI/6);
}

void ShowAzimuth()
{
  fill(50);
  noStroke();
  rect(20, 470, 440, 50);
  int Azimuth1=round(Azimuth);
  textAlign(CORNER);
  textSize(35);
  fill(255);
  text("Azimuth:  "+Azimuth1+" Deg", 80, 477, 500, 60);
}

void Compass()
{
  translate(2*W/3, 0);
  scale(CompassMagnificationFactor);
  noFill();
  stroke(100);
  strokeWeight(80);
  ellipse(0, 0, 750, 750);
  strokeWeight(50);
  stroke(50);
  fill(0, 0, 40);
  ellipse(0, 0, 610, 610);
  for (int k=255;k>0;k=k-5)
  {
    noStroke();
    fill(0, 0, 255-k);
    ellipse(0, 0, 2*k, 2*k);
  }
  strokeWeight(20);
  NumberOfScaleMajorDivisions=18;
  NumberOfScaleMinorDivisions=36; 
  SpanAngle=180;
  CircularScale();
  rotate(PI);
  SpanAngle=180;
  CircularScale();
  rotate(-PI);
  fill(255);
  textSize(60);
  textAlign(CENTER);
  text("W", -375, 0, 100, 80);
  text("E", 370, 0, 100, 80);
  text("N", 0, -365, 100, 80);
  text("S", 0, 375, 100, 80);
  textSize(30);
  text("COMPASS-01", 0, -130, 500, 80);
  rotate(PI/4);
  textSize(40);
  text("NW", -370, 0, 100, 50);
  text("SE", 365, 0, 100, 50);
  text("NE", 0, -355, 100, 50);
  text("SW", 0, 365, 100, 50);
  rotate(-PI/4);
  CompassPointer();
}

void CompassPointer()
{
  rotate(PI+radians(Azimuth)); 
  stroke(0);
  strokeWeight(4);
  fill(100, 255, 100);
  triangle(-20, -210, 20, -210, 0, 270);
  triangle(-15, 210, 15, 210, 0, 270);
  ellipse(0, 0, 45, 45);   
  fill(0, 0, 50);
  noStroke();
  ellipse(0, 0, 10, 10);
  triangle(-20, -213, 20, -213, 0, -190);
  triangle(-15, -215, 15, -215, 0, -200);
  rotate(-PI-radians(Azimuth));
}

void Plane()
{
  fill(0);
  strokeWeight(1);
  stroke(0, 255, 0);
  triangle(-20, 0, 20, 0, 0, 25);
  rect(110, 0, 140, 20);
  rect(-110, 0, 140, 20);
}

void CircularScale()
{
  float GaugeWidth=800; 
  textSize(GaugeWidth/30);
  float StrokeWidth=1;
  float an;
  float DivxPhasorCloser;
  float DivxPhasorDistal;
  float DivyPhasorCloser;
  float DivyPhasorDistal;
  strokeWeight(2*StrokeWidth);
  stroke(255);
  noFill();

  float DivCloserPhasorLenght=GaugeWidth/2-GaugeWidth/9-StrokeWidth;
  float DivDistalPhasorLenght=GaugeWidth/2-GaugeWidth/7.5-StrokeWidth;

  for (int Division=0;Division<NumberOfScaleMinorDivisions+1;Division++)
  {
    an=SpanAngle/2+Division*SpanAngle/NumberOfScaleMinorDivisions; 
    DivxPhasorCloser=DivCloserPhasorLenght*cos(radians(an));
    DivxPhasorDistal=DivDistalPhasorLenght*cos(radians(an));
    DivyPhasorCloser=DivCloserPhasorLenght*sin(radians(an));
    DivyPhasorDistal=DivDistalPhasorLenght*sin(radians(an));   
    line(DivxPhasorCloser, DivyPhasorCloser, DivxPhasorDistal, DivyPhasorDistal);
  }

  DivCloserPhasorLenght=GaugeWidth/2-GaugeWidth/10-StrokeWidth;
  DivDistalPhasorLenght=GaugeWidth/2-GaugeWidth/7.4-StrokeWidth;

  for (int Division=0;Division<NumberOfScaleMajorDivisions+1;Division++)
  {
    an=SpanAngle/2+Division*SpanAngle/NumberOfScaleMajorDivisions; 
    DivxPhasorCloser=DivCloserPhasorLenght*cos(radians(an));
    DivxPhasorDistal=DivDistalPhasorLenght*cos(radians(an));
    DivyPhasorCloser=DivCloserPhasorLenght*sin(radians(an));
    DivyPhasorDistal=DivDistalPhasorLenght*sin(radians(an));
    if (Division==NumberOfScaleMajorDivisions/2|Division==0|Division==NumberOfScaleMajorDivisions)
    {
      strokeWeight(15);
      stroke(0);
      line(DivxPhasorCloser, DivyPhasorCloser, DivxPhasorDistal, DivyPhasorDistal);
      strokeWeight(smiley-cool;
      stroke(100, 255, 100);
      line(DivxPhasorCloser, DivyPhasorCloser, DivxPhasorDistal, DivyPhasorDistal);
    }
    else
    {
      strokeWeight(3);
      stroke(255);
      line(DivxPhasorCloser, DivyPhasorCloser, DivxPhasorDistal, DivyPhasorDistal);
    }
  }
}

void Axis()
{
  stroke(255, 0, 0);
  strokeWeight(3);
  line(-115, 0, 115, 0);
  line(0, 280, 0, -280);
  fill(100, 255, 100);
  stroke(0);
  triangle(0, -285, -10, -255, 10, -255);
  triangle(0, 285, -10, 255, 10, 255);
}

void ShowAngles()
{
  textSize(30);
  fill(50);
  noStroke();
  rect(-150, 400, 280, 40);
  rect(150, 400, 280, 40);
  fill(255);
  Pitch=Pitch/5;
  int Pitch1=round(Pitch);
  Bank=Bank*180/PI;
  int Bank1=round(Bank);
  text("Pitch:  "+Pitch1+" Deg", -20, 411, 500, 60);
  text("Bank:  "+Bank1+" Deg", 280, 411, 500, 60);
}

void Borders()
{
  noFill();
  stroke(0);
  strokeWeight(400);
  rect(0, 0, 1100, 1100);
  strokeWeight(200);
  ellipse(0, 0, 1000, 1000);
  fill(0);
  noStroke();
  rect(4*W/5, 0, W, 2*H);
  rect(-4*W/5, 0, W, 2*H);
}

void PitchScale()

  stroke(255);
  fill(255);
  strokeWeight(3);
  textSize(24);
  textAlign(CENTER);
  for (int i=-4;i<5;i++)
  { 
    if ((i==0)==false)
    {
      line(110, 50*i, -110, 50*i);
    } 
    text(""+i*10, 140, 50*i, 100, 30);
    text(""+i*10, -140, 50*i, 100, 30);
  }
  textAlign(CORNER);
  strokeWeight(2);
  for (int i=-9;i<10;i++)
  { 
    if ((i==0)==false)
    {   
      line(25, 25*i, -25, 25*i);
    }
  }
}
215  Topics / Science and Measurement / Artificial Horizon+Compass. on: April 19, 2013, 05:11:22 am
Hi:

This is an Artificial Horizon/Compass combo built with Processing to be used with Arduino for 3 axis position visualization of a static swivel platform. It's not intended for navigation. At this point, the variables are dependent on the mouse position for testing purposes. These are part of the set of instruments I'm building to be used with Arduino. The idea is to have several "off-the-shelf instruments" already built to facilitate the implementation of Arduino projects using a computer.

Here is the video:https://www.youtube.com/watch?v=w5K2QXLH4eo&feature=youtu.be
216  Topics / Science and Measurement / Re: Control Panels for Arduino/Processing 1.5.1. on: April 15, 2013, 06:32:33 pm
Thanks.
217  Topics / Science and Measurement / Re: Problems using the DUE DACs to drive a difference amplifier on: April 07, 2013, 09:21:35 am
Quote
"I can provide code and/or circuit diagrams (if needed) once I get back to my apartment after the holiday weekend."

Did you return already?
Posting the schematic will help.
218  Topics / Science and Measurement / Control Panels for Arduino/Processing 1.5.1. on: March 31, 2013, 09:43:02 am
This is a set of instruments and controls panels which can easily be configured to build several Arduino Projects in a relatively fast way. Still some coding will be required depending on the particularities of each Project; but having these Panels already built, will make the task way easier and faster. This Project was built using Processing 1.5.1.
More Panels can be added in the future such as Timers, Voltmeters, etc.

Suggestions appreciated.
Thanks.

Here is the video:
https://www.youtube.com/watch?v=r49vKhHDrmE&feature=youtu.be
219  International / Español / Re: programa de conexion de xbee serie 1 con arduino uno on: March 19, 2013, 08:47:52 am
Este video puede ayudarte:

https://www.youtube.com/watch?v=WTnC1bHoaDM
220  Using Arduino / Programming Questions / Re: Tips and Tricks to Optimize Your C Code on: March 17, 2013, 10:59:39 pm
Good to know.
Thanks for sharing.
221  International / Español / Re: programa de conexion de xbee serie 1 con arduino uno on: March 17, 2013, 10:52:03 pm
Here is his post translated to English:
Hi:
" I'm beginning with Arduino and I don't know how to program the connection to an XBEE 1. If anyone knows how its done please let me know. I need both the sending and receiving code.
My project is a DS18B20 connected to an arduino and an XBEE. I need to know how to programn that."


Hola:

Es muy probable que muy pocos en este forum respondan a tu pregunta en espanol. Yo no he trabajado con el XBEE; pero te recomiendo que hagas una busqueda en Google y aqui en este forum y quizas encuentres algo. Tambien es muy probable que lo que encuentres este en ingles.

Si sabes algo de Ingles, aunque sea poco trata de hacer tu post en Ingles y enseguida te responden. si quieres yo te puedo ayudar un poco con la traduccion aunque mi tiempo es muy limitado.

Buena suerte.
222  Using Arduino / General Electronics / Re: Stepper using uln2004, external power on: March 04, 2013, 07:53:24 am
Glad you solved.
Good Luck.
223  Using Arduino / General Electronics / Re: Stepper using uln2004, external power on: March 03, 2013, 09:59:28 pm
I don't knoiw much about bread boards as I never use them, I prefer to solder to avoid faulty contacts, etc. Anyways, is there continuity between the rails where you have your battery connected and the rail where you connect the power fromn arduino?. In the pic it looks you have plugged the battery into different rails. Try plugging the battery to the same railing section where all the other wires are.
224  Using Arduino / Interfacing w/ Software on the Computer / Re: Sending data from processing to arduino on: February 25, 2013, 11:20:03 pm
On Processing:

//Define your variables here
import processing.serial.*;                 //imports serial library
int Com=0;                                         //Sets which Port from the list will be used.

void setup()
{
size(Width,Height);
frameRate(30);
blah; //whatever else you may need here.
blah;//whatever else you may need here
CPort = new Serial(this, Serial.list()[Com], 115200);              //Define CPort and baud rate here.
SendOrderToArduino();
}

void draw()
{
blah; //Your things here.
blah;
blah;
}


void SendOrderToArduino()
{
if(you want motor to move left==true)
{
Order=5;
}
if(you want motor to move right==true)
{
Order=10;
}
CPort.write(order);
}


On Arduino:
void setup()
{
blah;
blah;
Serial.begin(115200); //begins serial Communication with computer at 115200 bps.
}

void loop()
{
CheckOrder();
}

void CheckOrder()
{
if(Serial.available()>0)
{
Order=Serial.read();
if(Order==5)
{
MoveMotorLeft();
}
if(Order==10)
{
MoveMotorRight();
}
Order=0;
}


225  Topics / Science and Measurement / Data Logger & Recorder (Arduino UNO + Processing 1.5.1) on: February 24, 2013, 11:38:29 pm
Hi:

This is a Data Logger and Recorder built for trainning purposes using previous experiences with Arduino and Processing.  Still has some minor problems; but I'll leave it like that for now as my time is very limited and I'm kind of tired by now.

Input signal is connected directly (no amplification) to any of the Arduino analog inputs. User can select input channel from the computer screen.

here are the details: http://www.adrianelectronics.com/index.php?p=1_43_Data-Logger-Recorder

here is the video: https://www.youtube.com/watch?v=oTthPJNIToE

Thanks.
Pages: 1 ... 13 14 [15] 16 17 ... 23