millivoltmetro.. ????

Sto ipotizzando di realizzare un voltmero in grado di misurare tensioni di pochi millivolt.. con l'arduino.. mi serve perchè deve misurare tensioni su due punti distinti e fare dei calcoli.. ma intanto prima di lavorare esattamente a questo propotipo vorrei iniare con la sperimentazione di un millivolmetro che passi i dati letti ad un dispaly lcd... qualcuno è interessato ??? qualcuno ha già affrontato un problema simile??? ... aspetto notizie..

puoi partire da qui

http://www.arduino.cc/playground/Main/LCDVoltmeter

grazie tinman

Per misurare basse tensioni Ti serve amplificare la tensione per esempio con un Amplificatore Operazionale. Con il convertitore A/C di Arduino puoi leggere tensioni fino a 5V con step mdi quasi 5mV. Se cambi la tensione di riferimento puoi abbassare sia il range di lettura che la risoluzione (valore assoluto).
Ciao Uwe

grazie Uwe.. intanto mi sto guardando la parte software... per l'hardware.. hai qualche schemino che potresti suggerire.... io non sono una cima in elettronica... sono solo un hobbysta insomma ..... credo che mi serva qualcosa con ingresso ad altissima impedenza ...

scusate .. non riesco a fare funzionare l'LCD con queste impostazioni:

// lcd related constants
#define nbrCharPerLine 16 // update depending on LCD
                          // must be  at least 16 characters per line
#define nbrLines 2 // must be 2 lines at least
#define left 0
#define right 1
#define invisible 0
#define visible 1

// declare variables
int RS = 7; // registry select LCD pin 4
int EN = 8; // enable LCD pin 6
int DB[] = {9,10,11,12}; // data bits LCD pins 11, 12, 13 and 14

mentre mi funiona benissimo con queste...

// LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

qualcuno sa darmi una dritta su come fare a far coincidere le impostazioni di sopra con quelle di sotto che fanno capo alla libreria #include <LiquidCrystal.h>

?????

Scusate se insito.....

non riesco a collegare i miei LCD... secondo lo schema necessario per fare questo:
http://www.arduino.cc/playground/Main/LCDVoltmeter

... faccio presente che i miei LCD funzionano benissimo secondo questo schema:

non ho capito se si riferiscono a LCD diversi e non compatibili.. .. qualcuno può darmi un'indicazione?

domanda:
stai utilizzando l'LCD collegato come http://arduino.cc/en/Tutorial/LiquidCrystal e stai provando il codice di Arduino Playground - LCDVoltmeter?

si... naturalmente ho povato a modificare i pin... cercando un'equvalenza tra un'indicazione e l'altra.. ma non sono giunto a nulla....

allora a naso non può funzionare:
prova modificando

// declare variables
int RS = 7; // registry select LCD pin 4
int EN = 8; // enable LCD pin 6
int DB[] = {9,10,11,12}; // data bits LCD pins 11, 12, 13 and 14

come segue

// declare variables
int RS = 12; // registry select LCD pin 4
int EN = 11; // enable LCD pin 6
int DB[] = {5,4,3,2}; // data bits LCD pins 11, 12, 13 and 14

questol'avevo già provto .. non funge... non è che si attiva magari con il reset sul pin 6..... bho .. comunque non funge!!!!

trovato l'inghippo: la variabile DB non viene mai utilizzata, sere solo come promemoria per ricordarsi il collegamento hardware, se vuoi mantenere la connessione del tutorial utilizza questo codice per avere LCDVoltmeter funzionante

/*
single channel voltmeter
range 0 to 5 Volts in 1023 steps
min max recorder resetable with pushbutton
LCD display driven in "4 bits" mode 
R/W operation is not used; LCD pin 5 must be connected to ground
Reset button (optional) between Arduino's digital port 6 and ground
Analog signal shall be connected to Arduino's analog port 0

no need for additional libraries

no rights, no warranty, no claim just fun
didier longueville, december 2007
*/
// hardware related constants
#define analogPin 0
#define resetPin 6
#define ledPin 13
// lcd related constants
#define nbrCharPerLine 16 // update depending on LCD
                          // must be  at least 16 characters per line
#define nbrLines 2 // must be 2 lines at least
#define left 0
#define right 1
#define invisible 0
#define visible 1

// declare variables
//int RS = 7; // registry select LCD pin 4
//int EN = 8; // enable LCD pin 6
//int DB[] = {9,10,11,12}; // data bits LCD pins 11, 12, 13 and 14

// declare variables
int RS = 12; // registry select LCD pin 4
int EN = 11; // enable LCD pin 6
int DB[] = {5,4,3,2}; // data bits LCD pins 11, 12, 13 and 14

char stringBuffer[nbrCharPerLine + 1]; // this is the working string buffer
int analogValueMax = 0;
int analogValueMin = 1023;

void setup (void) {
  // Serial.begin(9600);
  for (int i = 2;i <= 12;i++) {
    pinMode(i,OUTPUT);
    digitalWrite(i,LOW);
  }
  pinMode(resetPin,INPUT); // define reset pin
  digitalWrite(resetPin, HIGH); // turn on pullup resistor
  LcdInitialize(); // Initialize lcd
  LcdUnderlineCursor(invisible); // hide underline cursor
}

void loop (void) {
  // check if the reset button has been pushed (quick and dirty)
  if(digitalRead(resetPin) == LOW) {
     // reset variables
    analogValueMin = 1023;
    analogValueMax = 0;
    // display status
    BufferClear(); // clear buffer
    //                       1234567890123456
    BufferInsertStringValue("min   now   max ",1);
    LcdSendString(1); 
    BufferClear(); // clear buffer
    //                       1234567890123456
    BufferInsertStringValue("-.--  -.--  -.--",1);
    LcdSendString(2); 
    delay (1000); // time to read
  }
  int analogValue=analogRead(analogPin);
  analogValueMin = min(analogValue,analogValueMin); // record min value
  analogValueMax = max(analogValue,analogValueMax); // record max value
  BufferClear(); // clear buffer
  //                       1234567890123456
  BufferInsertStringValue("min   now   max ",1);
  LcdSendString(1); // display converted value on line 1
  BufferClear(); // clear buffer
  //                       1234567890123456
  BufferInsertStringValue(" .     .     .  ",1);
  BufferInsertNumValue(analogValueMin,5,2,2);
  BufferInsertNumValue(analogValue,5,2,8);
  BufferInsertNumValue(analogValueMax,5,2,14);
  LcdSendString(2); // display converted value on line 2
  // blink status led   
  LedSendPulse(500); 
}

/*
Lcd related functions:
  LcdClearScreen
  LcdCursorHome
  LcdDisplay
  LcdInitialize
  LcdMoveCursor
  LcdScrollDisplay
  LcdSendBits
  LcdSendByte
  LcdSetLine
  LcdUnderlineCursor
*/

void LcdClearScreen() {
  LcdSendCommand(B00000001,8); // 0x01
}

void LcdCursorHome() {
  LcdSendCommand(B00000010,8); // 0x02
}

void LcdDisplay(boolean status) {
  if (status) {
    LcdSendCommand(B00001100,8); // 0x0C Restore the display (with cursor hidden) 
  }
  else {
    LcdSendCommand(B00001000,8); // 0x08 Blank the display (without clearing)    
  }
}

void LcdInitialize() {
  delay(40); // specification says > 30ms after power on
  // function set
  LcdSendCommand(B0010,4); // 0x2
  LcdSendCommand(B00101000,8); // 0x28
  delayMicroseconds(50); // specification says > 39[ch65533]s 
  // display on/off control
  LcdSendCommand(B00001110,8); // 0x0E
  delayMicroseconds(50); // specification says > 39[ch65533]s 
  // clear display
  LcdSendCommand(B00000001,8); // 0x01
  delay(2); // specification says > 1.53ms 
  // entry mode set
  LcdSendCommand(B00000110,8); // 0x06
  delay(2); //  
}

void LcdMoveCursor(boolean dir, int steps) {
  for (int j = 1;j <= steps;j++) {
    if (dir) {
      LcdSendCommand(B00010100,8); // 0x14
    }
    else {
      LcdSendCommand(B00010000,8);  // 0x10  
    }
  }
}

void LcdScrollDisplay(boolean dir, int steps,int pause) {
  for (int j = 1;j <= steps;j++) {
    if (dir) {
      LcdSendCommand(B00011110,8); // 0x1E
    }
    else {
      LcdSendCommand(B00011000,8); // 0x18
    }
    delay(pause);
  }
}

// set bits on Lcd and trigger enable pulse
void LcdSendBits(int value){
  digitalWrite(EN,HIGH); 
  delayMicroseconds(5);  // pause 1.4 [ch65533]s according to datasheet 
  for (signed int i = 5;i >= 2;i--) {
    digitalWrite(i + 0,value & 01); // set bit value
    value >>= 1; // shift bits
  }
  digitalWrite(EN,LOW); // toggle enable line transfer bits 
  delayMicroseconds(5);  // pause 1.4 [ch65533]s according to datasheet 
}

// send one byte onto LCD
void LcdSendByte(int value) {
  constrain(value,32,126); // value shall be no less than 32 and no more than 126 (printable characters)
  digitalWrite(RS,HIGH);
  LcdSendBits(value >> 4); // msw
  LcdSendBits(value); // lsw
}

// send command to LCD display
void LcdSendCommand(int value,int nbrBits) {
  digitalWrite(RS,LOW);
  if (nbrBits == 8) {
    LcdSendBits(value >> 4); // msb
  }
  LcdSendBits(value); // lsb
}

void LcdSendString(int lineIndex){
  constrain(lineIndex,1,nbrLines); //line index shall be no less than 1 and no more than nbrLines
  if (lineIndex == 1) {
    LcdSendCommand(B10000000,8); // 0x80
  }
  else if (lineIndex == 2) {
    LcdSendCommand(B11000000,8); // 0xC0
  }
  // write working string buffer content onto LCD
  for (int i = 0;i <= nbrCharPerLine;i++) {
    LcdSendByte(stringBuffer[i]);    
  }
}

void LcdSetLine(int lineIndex){
  constrain(lineIndex,1,nbrLines); //line index shall be no less than 1 and no more than nbrLines
  if (lineIndex == 1) {
    LcdSendCommand(B10000000,8); // 0x80
  }
  else if (lineIndex == 2) {
    LcdSendCommand(B11000000,8); // 0xC0
  }
}

void LcdUnderlineCursor(boolean status) {
  if (status) {
    LcdSendCommand(B00001110,8); // 0x0E  
  }
  else {
    LcdSendCommand(B00001100,8); // 0x0C
  }
}

/* 
led related functions:
  LedSendPulse
*/
// pulseDelay value is equal to the total pulsing time
void LedSendPulse(int pulseDelay){
  digitalWrite(ledPin,HIGH);
  delay(pulseDelay/2);
  digitalWrite(ledPin,LOW);
  delay(pulseDelay/2);  
}

/*
working string buffer functions:
  BufferClear
  BufferInsertNumValue
  BufferInsertStringValue
*/

// clears the content of the working string buffer (global variable)
void BufferClear (){
  for (int i = 1;i <= nbrCharPerLine;i++){
    stringBuffer[i - 1] = 32; // blank buffer content with space characters
  }
}

// insert converted float in the working string buffer (global variable)
void BufferInsertNumValue (int digitalValue,int fullScaleValue,int decimalPlaces,int decimalSeparatorPosition) {
  unsigned long integerValue=((unsigned long)( digitalValue * fullScaleValue) * PowerInteger(10,decimalPlaces)) / 1023;
  int remainder = 0;
  stringBuffer[decimalSeparatorPosition - 1] = 46;
  // decimals
  for (int i = 1;i <= decimalPlaces;i++){
    int asciiCode = (integerValue % 10) + 48;
    stringBuffer[decimalSeparatorPosition + decimalPlaces - i] = asciiCode;
    integerValue/=10;
  }  
  // integers
  int i = 0;
  do {
    i++;
    int asciiCode = (integerValue % 10) + 48;
    stringBuffer[decimalSeparatorPosition - 1 - i] = asciiCode;
    integerValue /= 10;
  } while (integerValue != 0);
}


// update the working string buffer (global variable)
// startingPosition is base 1
void BufferInsertStringValue(char * s,int startingPosition) {
  int stringLength=strlen(s)-1;
  for (int i = 0;i <= stringLength;i++) {
    stringBuffer[startingPosition + i - 1] = s[i];
  }
}

/*
general purpose functions:
  PowerInteger
*/

int PowerInteger(int mantissa,int exponent){
  int result; // declare result variable
  if (exponent == 0) {
    result = 1;
    }
  else {
    result=mantissa;
    for (int i = 2;i <= exponent;i++) {
      result *= mantissa;
    }
  }
  return result;
}

che strano.....
non funzionava.... nella prima riga mi apparivano caratteri strani... (ro, pigrego, beta ed altri... nella seconda riga nulla... questo per diversi tentativi, compreso diversi reset...

poi, una sola volta ha funzionato,...... appare min - now e max.. e nella riga di sotto apparivano i valori letti...

poi niente più...qualche volta mi apprivano gli stessi caratteri strani di cui sopra.. e qualche altra volta mi appariva sulla prima riga .. min now e max.. ma tutto bloccato.. non cera verso..
ricarico, resetto, resetto e ricarico ma nulla.. sempre lo stesso malfunzionamento...

finchè ho visto che staccando l'alimentaione e riattivandola il sistema parte e misura regolarmnete .....

ma a cosa è dovuto secondo voi?

comunque frog... grazie..

... comunque se resetto il sistema s bloca e non funziona più.... finche non stacco lalimentazione e non lo alimento di nuovo...