Show Posts
Pages: [1]
1  Using Arduino / Displays / Re: 16x2 Works fine then Garbled on: February 22, 2011, 06:27:14 pm
Pins 1, 5, and 16 all go to ground. I had a jumper between 1and 5(the short) and the ground form the Arduino on 16 but never connected 16 to 5
2  Using Arduino / Displays / Re: 16x2 Works fine then Garbled on: February 21, 2011, 06:11:08 pm
Eureka!!!   smiley-mr-green
Schematic was right but the wiring wrong. I had LCD pin 1 to 5 shorted and ground on 16 but forgot the jumper form 1-5. Thanks for making me look.
3  Using Arduino / Displays / Re: 16x2 Works fine then Garbled on: February 21, 2011, 05:01:00 pm
So the parallel display, when displaying information unrelated to analog read, is just fine, right?

Can you show the wiring of the display and details of what you're sensing with analog input?

Yes the second LCD(which the Arduino is talking with serially) that I added doesn't get garbled. But the one the Adrunio is directly connected does get garbled.
The Garbling, on closer inspection happens anywhere I print to the display in a loop.... Could I be overrunning the display. It strange the the serial LCD in the same loop is fine. And remember the garbling seems random. I'll try increasing the loop delay from 500msec to 1sec...
4  Using Arduino / Displays / Re: 16x2 Works fine then Garbled on: February 21, 2011, 03:04:53 pm
that print the float with out a decimal
Why do you do lcd.print(XXX,0)?

Is there a base zero option? I don't know about that though. Did you mean DEC?
that printed the float with out a decimal. it worked maybe wrong.


As a test I connected a Serial enabled LCD and added the code to print to the serial enabled LCD. The LCD connected to the Adruino directly gets garble but the serial LCD doesn't. Attached is a pic of the garbled LCD if that helps.
5  Using Arduino / Displays / 16x2 Works fine then Garbled on: February 21, 2011, 01:34:28 pm
Hello All,

Been working on my project and have run into a snag. My LCD display will get all garbled randomly while the code is measuring a Analog Input. If I go to a section of the code that is not using the AD the display is fine. I can't seem to fine the issue. Sometimes the LCD print out is fine through the measuring section, Other times it gets all garbled.
The only way to get things working again is to hit the reset. I've try different LCD with the same results. Every thing is powered from the Adruino VCC.
I'm using the 4 Bit mode on the LCD, and the library is LiquidCrystal.h.

I'm new to this so I'm sure its my code it'c just the randomness of the issue that has me stumped. I have include my setup and a section that measure the analog. If more is need to figure it out let me know.

THANKS
Code:
// include the library code for the LCD:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);


Code:
void setup() { // LCD
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  analogReference(DEFAULT); // Set Analog reference to 5 Volts
  pinMode(2, INPUT); // RPM Interupt
  pinMode(9,INPUT);// Sets di 9 as input ZeroPB & RMS Mode select
  pinMode(10,INPUT);// Sets di 10 as input MMS Mode Select
  pinMode(11,INPUT);// Sets di 11 as input Current Mode Select
  pinMode(12,INPUT);// Sets di 12 as input RPM Mode Select
  pinMode(13,INPUT);// Sets di 13 as input

  // Print a start up message to the LCD.
  lcd.print("MMS Complete!");
  lcd.setCursor(0, 1);
  lcd.print("Select a mode");
}


Here is where I get the random Garbled LCD on both line

Code:

lcd.setCursor(0, 0);
  lcd.print("RMS Mode");
  delay(100);
  // set the cursor to column 0, line 2
  lcd.setCursor(0, 1);
  lcd.print("                ");
  lcd.setCursor(0, 1);
  // Measurement section
  A1_Value = analogRead(A1)-Zero; // read A1 value - the senors zero state
  F1 = A1_Value*4.8875;  // convert the AD to Volts 4.8875 per steps (5 / 1023)
  if (F1<-100.0) {
    F1=  (F1-RMS_trim);
  }
  else if  (F1>100.0) {
    F1= RMS_trim + F1;
  }

  lcd.print(F1,0);  // Print to LCD with out decimal

  delay(500);



6  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: What am I missing? on: December 28, 2010, 04:15:02 pm
I fixed it
I didn't realize the states from the last reads where still there. Make sense Thats what it was the last read and they will not change till the next time its read

thanks of the replies smiley-wink
7  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: What am I missing? on: December 28, 2010, 02:36:56 pm
Quote
Posted by: Groove      Posted on: Today at 20:20:20
Unless shorted to ground, the chances of an analogRead returning zero are fairly slight.
the "Zero" is around 2.5V and the sensor swing form 2.5-5 0r 2.5-0.
Thats not the problem the PB works but the While Zero doesn't the start state of Zero Var is zero i haven't read it yet. it should wait till the PB is pressed


I have deleted the code around this to keep it simple
8  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: reading mV on: December 27, 2010, 01:51:15 pm
Thank you for how to read it in mV But if I understand this I still only have 1.07mV resolution.

So back to the original question. Can I use ARef to get there (0.1mV) and if I do am I stuck with the ARef voltage for all my Analog input?

Building the 50 Gain circuit to see what happens

Thanks
9  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: reading mV on: December 27, 2010, 01:01:52 pm
http://www.radio-electronics.com/info/circuits/opamp_basics/operational-amplifier-gain.php

I used the Non-Inverting with a LM358n ( so I could use the 0-5V as a source)
R1 9K (pot for fine tuning)
R2 1K

Total gain 10
Still used the 1.1 reference

I got the 10mV since the LCD only read 0.00 and I only see the last digit change. haven't figured out how to make the float display more digits yet. :'(

here is my code
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//Variable to hold A0 reading 0-1023
int A0_Value=0;
float F1=0;
float PercentOfInput=0.0;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Hello, world!");
  // Set Analog reference to Internal 1.1Volts
  analogReference(INTERNAL);
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
  // Set the curser to column 6 row 2
  lcd.setCursor(6, 1);
  lcd.print("          ");
  lcd.setCursor(6, 1);


  A0_Value = analogRead(A0); // read A0 value
  PercentOfInput = float(A0_Value)/1023*100;
 // lcd.print(A0_Value);
 
  F1= (PercentOfInput)*0.011;
  
  lcd.print(F1);  // Print to LCD
  lcd.setCursor(12,1);
  lcd.print(A0_Value);
  
  delay(500);                                                  
  
  
}/tt]
10  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: reading mV on: December 27, 2010, 12:28:16 pm
Yea I tried that but for some reason the Op-amp out was not linear throu out the range. I could tune it for the upper or lower range. Maybe I need a better op-amp circuit.
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / reading mV on: December 27, 2010, 12:08:43 pm
Hello all
I'm a newbee so forgive me.

I've been playing with the Arduino Uno. I'd like to measure 0-100mV with 0.1mV resolution. I used the Internal 1.1 reference and got the about 10mV resolution. Can I use the Aref pin at 100mV to get the 0.1mV resolution I want?
When I tried it the read value just stayed at max (1023). Also I have read that if I use the Exertnal reference I can't use the internal reference in another part of the code since it will short the internal with the external on Aref... is this correct?

Well that's what I'm trying yo pull off thanks in advance
Pages: [1]