Show Posts
Pages: 1 [2] 3
16  Using Arduino / Project Guidance / Re: Arduino Mega 2560 R3 vs. Uno R3 for beginners {Raspberry Pi} on: January 04, 2013, 09:20:42 pm
First off that board is a Chinese copy not a real Arduino.

First clue - it's $15.  Second, its a picture of the real Arduino Mega but the "Made in Italy" in the upper left corner is blocked out.

You might have a lot of problems with the fake Arduino, and some people here despise them.

As for the Mega vs. Uno, it depends what you are going to use it for.
If you want to learn basic electronics, how to let smoke out of components, the Uno is great.

The Mega has more "horsepower" under the hood, is larger and has many more digital and analog pins.
If you are only connecting a few sensor or components up the Uno is a better choice.

Also, if you connect something wrong and fry the main chip, it is easily replace with the Uno.
On the Mega you will be learning how to remove surface mounted ICs, reflow soldering, etc.

My main advice is buy the Arduino from a reputable dealer, such as Sparkfun or Adafruit.
You will be getting the real deal and supporting the inventors, not the copiers.
17  Using Arduino / Sensors / Re: [ADXL335] Measuring acceleration in Gs. on: January 03, 2013, 12:31:14 pm
The calibration method is really important.

If you use the 1g numbers for min and max, the only range you will get is 1g.
Any readings out of that range will not display properly.

Finding the range of +/- 1g is important.  Add them and divide by two.
That will give you the analogRead() value of 0g, assuming the accelerometer is perfectly level.
The difference between 0g and the min or max is your resolution.  How many units read/g.

For an example, on my sensor I get 401 & 611 on the X axis.  (I am using external voltage reference @ 3.6v)
Zero g would be at 506.  The resolution would be 105.  
Multiply the difference of analog reading from 0g by .0095 (1/105 or 1/resolution) and there is your g reading.
Or (analogRead(analog pin) - 506) * .0095

Here is the code I used for calculating g forces while driving.
The orientation of the Adafruit accelerometer:  X points left, Y points to the rear.
Arduino orientated natural (USB on left) and accelerometer header pins mounted next to analog pins on protoshield.

WARNING - please do not use alone while driving.  Ask a friend to be your Co-pilot or Navigator - WARNING

Code:
/*
 Designed by AB9VH James Douglas July 2012
 Unified Microsystem's ATS-1 LCD Terminal Display Shield
 with adafruit 3 axis accelerometer, external 3.3v reference
 Shows g forces while driving
 
 */

int Xaxis = 0;         // fresh data from accelerometer
int Yaxis = 0;
int Xcal = 505;        // calibration data, zero g
int Ycal = 505;
int key = -1;

void setup() {
  analogReference(EXTERNAL);     // uses 3.3v from accelerometer for reference voltage
  Serial.begin(4800);            // opens serial port for LCD shield
  Serial.write(1);               // clears display and homes cursor
  Serial.println("   Automobile  ");
  Serial.print(" Accelerometer ");
  delay(2000);
  Serial.write(1);
  Serial.println(" Prototype 2012");
  Serial.print(" J. Douglas III");
  delay(2000);
  Serial.write(1);               // clear display & home cursor
  Serial.println(" Press any Key");
  Serial.print("    to start ");
  while (key<0) key = Serial.read();
  Serial.write(1);
}

void loop() {
  Xaxis = analogRead(2);
  Yaxis = analogRead(1);
  if (Xaxis<Xcal) {                          // calculate Left & right
    Serial.print("Right ");
    Serial.print((Xcal-Xaxis)*.0095);
    Serial.println("g   ");
  }
  else if (Xaxis>Xcal) {                      // always display left and right
    Serial.print("Left ");                   // g force as positive value
    Serial.print((Xaxis-Xcal)*.0095);            
    Serial.println("g   ");
  }
  else Serial.println("L/R 0.00g     ");    // display forward as positive g
  Serial.print("Front ");                   // display rearward as negative g
  Serial.print((Ycal-Yaxis)*.0095);          
  Serial.println("g   ");
  delay(50);
  LCDpos(1,1);                                // home cursor ATS-1
}




void LCDpos(char x, char y) {
  Serial.write(20);
  Serial.write(x);
  Serial.write(y);
}
18  Using Arduino / Project Guidance / Re: Ham Radio project - Arduino and MFJ TNC on: January 02, 2013, 12:00:50 pm
Thanks again - I looked up the specs on Digikey.

Exactly what I need smiley
19  Using Arduino / Project Guidance / Ham Radio project - Arduino and MFJ TNC on: January 02, 2013, 04:30:16 am
Just wondering about the software serial library and using that to communicate with my old MFJ TNC.
Does it simulate the RS-232 serial interface?

I would like to have the Arduino send APRS packets.

Perhaps digipeating thru the ISS, mobile?
Or part of a weather station project, sending WX data.
20  Using Arduino / Displays / Re: 16x2 lcd with UnoR3 probs on: December 19, 2012, 02:01:21 am
Good info -

I went back and looked at the tutorial again - oh yeah no resistor on the LED connection smiley-wink

Seems to be a good idea to use the limiting resister for the backlight on all displays
unless you need the full brightness of the back light.....
21  Using Arduino / Displays / Re: 16x2 lcd with UnoR3 probs on: December 18, 2012, 01:38:38 am
Something else to consider.

When you see the row of pins start at #15 & #16, then 1-14, it might be a non-backlit LCD display.

I have several different 16x2 character displays, and of the 3 that are not backlit, 2 have the goofy pin orientation.

With those pin 15 & 16 are not connected.  
Pin 1 & 5 - ground
pin 3 - 10k pot OR resistor to ground (8k-9k)
pin 2 - 5v
pins 4,6,11-14 connected to arduino digital pins

Adafruit has a wonderful tutorial which I still use as a reference.  Never hurts to double check connections before heating the iron.

http://learn.adafruit.com/character-lcds/wiring-a-character-lcd
22  Using Arduino / Microcontrollers / Re: Unable to Upload to Sketch to ATmega 328P-PU on: December 17, 2012, 09:20:03 pm
How are you hooking up the FTDI cable?
23  Using Arduino / Project Guidance / Re: BLUETOOTH + IPHONE + ARDUINO on: December 17, 2012, 09:06:09 pm
I can't help you with the bluetooth.....

But I saw this on maker shed smiley

http://www.makershed.com/RedPark_TTL_iOS_Cable_Breakout_Pack_p/msbun36.htm
24  Using Arduino / Sensors / Re: TMP36 sensor working fine or damaged? on: December 17, 2012, 06:25:28 pm
As Riddick pointed out there is a chance of shorting out the Arduino if the AREF is not connected properly.

If you wanted full resolution (not accuracy) you would need a voltage reference higher than 2v.
But since you do not care about that, no need to connect anything to AREF.  Just use the internal reference.  It's safer.

If you need to use the full capability of the TMP36 you would connect the 3v pin to the AREF pin w/ a 5k resistor.
That would kind of act like a voltage divider and the actual reference voltage would be around 2.8v
Also add a .1uf cap between the AREF pin and ground, closest to the AREF pin as possible.


** MAKE SURE TO CALL analogReference(EXTERNAL) before calling analogRead() or else you will short out the Arduino. **


A good spot for the .1uf caps are at the analog pin, between the analog pin and ground.
Also as close to the TMP36's power connection as possible and ground.
25  Using Arduino / Sensors / Re: TMP36 sensor working fine or damaged? on: December 14, 2012, 10:05:26 pm
The datasheet shows the input voltage 3v-5v
Output voltage .05 - 2v output.
Using the 3v reference you see a better resolution in temperature vs. 5v reference.

Also try filtering out the power to the TMP36 at the sensor w/ .1uf cap -
26  Using Arduino / Sensors / Re: ADXL 335 Accelerometer for Leveling? on: December 06, 2012, 07:04:33 pm
Yup - that's what I wrote before.

"If the object that the accelerometer is mounted to is level then the 3 numbers you get would be the calibration data."
27  Using Arduino / Sensors / Re: ADXL 335 Accelerometer for Leveling? on: December 04, 2012, 05:11:37 pm
How have you verified 0.5° accuracy?  Have you calibrated the unit?


I never said 1/2 degree accuracy, I said 1/2 degree resolution.  I know this because I can move the accelerometer around and I get 1/2 degree movements.
Also I have a granite surface plate with angle blocks.  When zeroed on the granite all the angle blocks measure right.

The calibration is in the software.  Look at the X,Y, & Z cal values.  Those are set to 0 g.  When you mount the accelerometer, first write a sketch that outputs only the value of analogRead in all 3 axis.  If the object that the accelerometer is mounted to is level then the 3 numbers you get would be the calibration data.
28  Using Arduino / Sensors / Re: Temperature Sensor (TMP36) and RFI on: December 04, 2012, 12:35:51 am
Yup, I learned that one the hard way, too.

.1uf caps are like the magic fairy dust of electronics, sprinkle them everywhere in your design smiley
29  Using Arduino / Sensors / Re: ADXL 335 Accelerometer for Leveling? on: December 04, 2012, 12:21:41 am
I use adafruits ADXL335 board.
I have a resistor and capacitor filtering the 3v reference going into the AREF pin, that's it.
3 axis directly to the analog pins.
I use a shielded cable to connect the accelerometer to my duemilanove.
I think it was from an extra serial cable I had laying around.

No software filtering, very basic.

You need to use 3v reference to get 1/2 degree resolution.  If you use the 5v reference it works out to be around 7/8 degree.

I have my board mounted flat.  X is left right, Y is forward back, Z is up down.
If you have the board mounted different then the LR & FB formulas need to be changed.

I used the AN-1057 application note from analog devices to figure out the dual axis calculations.


float LR = 0.00;            // left-right angle
float FB = 0.00;            // front-back angle
int Xaxis = 0;         // fresh data from accelerometer
int Yaxis = 0;
int Zaxis = 0;
int Xcal = 506;        // calibration data, zero g
int Ycal = 506;
int Zcal = 518;

void setup() {
  analogReference(EXTERNAL);     // uses 3.3v from accelerometer for reference voltage
}

void loop() {
  Xaxis = analogRead(2);                 // read analog inputs
  Yaxis = analogRead(1);                 // average & filter readings
  Zaxis = analogRead(0);
  LR = (atan(((Xaxis-Xcal)/Xres) / ((Zaxis-Zcal)/Zres))) *57.2957;
  FB = (atan(((Yaxis-Ycal)/Yres) / ((Zaxis-Zcal)/Zres))) *57.2957;


and then print to serial monitor or LCD screen...
30  Using Arduino / Microcontrollers / Re: Arduino UNO board (but with duemilanove bootloader) on: December 04, 2012, 12:04:26 am
I did the reverse with my Duemilanove.  I burned the Uno's optiboot on it.
Loads sketches faster, only problem is sometimes I forget to choose Uno as the board.
Then i get an error loading a sketch.  Oh yeah, Uno not Duemilanove anymore........

Pages: 1 [2] 3