Se sei già registrato           oppure    

Orario: 02/05/2024 07:26:04  

 

Energia Alternativa ed Energia Fai Da Te > PPTEA

VISUALIZZA L'ALBUM

Pagine: (3)   1   2   [3]    (Ultimo Msg)


PPTEA - SENSORE DI IDROGENO
FinePagina

jumpy75

Avatar
GigaWatt


Gruppo:MODERATORE
Messaggi:686

Stato:



Inviato il: 14/2/2012,12:53

Ciao Bolle, questa sera come torno a casa provo a verificare il funzionamento anche di questo codice!

Grazie

Jumpy

 

gancetto

Avatar
MegaWatt


Gruppo:Utente
Messaggi:596

Stato:



Inviato il: 25/2/2012,13:38

ok purtroppo non capisco i codici di programmazione cerchero di studiare in proposito se avete qlk doc farebbe comodo.

la mia domanda è come vien calibrato il sensore??'
la calibraazione è fissa ? ( si fa una volta o si fa ogni esempio 2-3 gg)
il segnale è stabile ?

come possiamo confrontare con uno standard di misura??
es si potrebbe ottenre un campione di aria a conc nota di H2 e confrontarla

 

jumpy75

Avatar
GigaWatt


Gruppo:MODERATORE
Messaggi:686

Stato:



Inviato il: 25/2/2012,16:44

Ciao gancetto,

CODICE
la mia domanda è come vien calibrato il sensore??'

il sensore è già tarato, comunque necessita per funzionare di un trim da 10Kohm.

CODICE
la calibraazione è fissa ?
Si la calibrazione è fissa.

CODICE
il segnale è stabile ?
Si, il segnale è molto stabile.

Lo standard che puoi utilizzare sono le Particelle Per Milione di idrogeno che si trovano nell'aria, considera che insieme a drmacchi11 abbiamo preso accordo che provvederà a fare sperimentazione in laboratorio con il mio PPTEA. Spero di trovare un pò di tempo in settimana per chiudere tutto e spedire basetta e sensore in modo che può eseguire tutti i test in sicurezza.

Come abbiamo i primi risultati vi aggiorniamo pubblicando foto e video in questa discussione!


Jumpy




Modificato da jumpy75 - 7/3/2012, 13:20
 

gancetto

Avatar
MegaWatt


Gruppo:Utente
Messaggi:596

Stato:



Inviato il: 25/2/2012,18:24

ok quindi si calibra in aria sapendo quale sia la conc di H nell aria

ho notato che il problema sarebbe di aumentare il renge del sensore da 0-10000
a 40.000 ppm
se si potrebbe ottenere una curva di calibrazzione e il limite di rivelabilità si potrebbe aumentare il range
il problema è ottenere degli standard
è possibile sapered i piu sulla procedura di calibrazione?
da quanto ho capito il sensore viene fornito gia tarato?



 

jumpy75

Avatar
GigaWatt


Gruppo:MODERATORE
Messaggi:686

Stato:



Inviato il: 27/2/2012,10:17

Ciao gancetto, il sensore viene fornito già tarato, quindi non è possibile eseguire delle modifiche di taratura.
Inoltre per il nostro scopo portarlo a 40.000ppm non ha senso, perchè rischiamo di perdere la sensibilità del sensore stesso,
tieni presente che a noi interessa avere una soglia di sicurezza all'interno del locale batterie molto alta, quindi limite a 10.000ppm è sufficente a garantire un locale quattro volte più sicuro rispetto ad un valore di 40.000 ppm (drmacchi11 correggimi se dico eresie).


A presto

Jumpy

 

antoni0
milliWatt


Gruppo:Utente
Messaggi:8

Stato:



Inviato il: 1/4/2013,20:11

dr macchi, molto bello il tuo ragionamento. In questo documento
"ODonnellPaper2008PROOF_6.pdf" (di cui non riesco a postare il link)
a pagina 6-8 trovi una formula, confermata dall'IEEE, sulla quantità di idrogeno emessa nel caso peggiore. Anche se mi sembra veramente esagerato...

Jumpy75, riguardo al sensore, ho letto il datasheet e lo sto provando su un arduino. Ho diffcoltà a capire cosa vuol dire sul datasheet Rs/Ro. Rs intuisco sia la resistenza variabile del sensore, Ro cosa sarebbe ?

Inoltre volevo chiederti come hai fatto la conversione dal valore di tensione a PPM ? Hai ricavato una relazione linare dal grafico del datasheet immagino, ma io non riesco a farlo non sapendo cos'è Ro...

Grazie, ciao

 

jumpy75

Avatar
GigaWatt


Gruppo:MODERATORE
Messaggi:686

Stato:



Inviato il: 2/4/2013,09:50

Ciao Antonio, non saprei come aiutarti con arduino, quello che ho implementato e' legato tutto al PPTEA. Per quanto riguarda la formula per calcolare le PPM anche questa e' legata al PPTEA, non credo che con arduino puo' funzionare (io non ho eseguito nessuna prova come ti ho detto con arduino), comunque con un po' di sbattimento potresti ricavarti la formula dal datasheet, invece se vuoi la pappa fatta, prova a vedere a questo link se il codice rilasciato come esempio puo' esserti i aiuto.


J.

 

ElettroshockNow

Avatar
GigaWatt


Gruppo:Utente
Messaggi:4656

Stato:



Inviato il: 2/4/2013,10:17

CITAZIONE
Ro cosa sarebbe ?

Il valore di resistenza del sensore nella condizione di 1000ppm di H2 in aria pulita (serve solo per rappresentare graficamente il comportamento del sensore).


Se può essere utile riporto il 1° link del sensore dove riportano un listato per arduino .......
www.ebay.it/itm/120723626960?ssPage...9#ht_7620wt_934

e questo è il codice del MQ-2 ......... con troppi ricamini faccine/biggrin.gif rendendolo quasi illeggibile faccine/sad.gif
/*******************Demo for MQ-2 Gas Sensor Module V1.0*****************************
Author: Tiequan Shao: tiequan.shao[at]sandboxelectronics.com
Peng Wei: peng.wei[at]sandboxelectronics.com

Lisence: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
Note: This piece of source code is supposed to be used as a demostration ONLY. More
sophisticated calibration is required for industrial field application.

Sandbox Electronics 2011-04-25
************************************************************************************/
/************************Hardware Related Macros************************************/
#define MQ_PIN (0) //define which analog input channel you are going to use
#define RL_VALUE (5) //define the load resistance on the board, in kilo ohms
#define RO_CLEAN_AIR_FACTOR (9.83) //RO_CLEAR_AIR_FACTOR=(Sensor resistance in clean air)/RO,
//which is derived from the chart in datasheet
/***********************Software Related Macros************************************/
#define CALIBARAION_SAMPLE_TIMES (50) //define how many samples you are going to take in the calibration phase
#define CALIBRATION_SAMPLE_INTERVAL (500) //define the time interal(in milisecond) between each samples in the
//cablibration phase
#define READ_SAMPLE_INTERVAL (50) //define how many samples you are going to take in normal operation
#define READ_SAMPLE_TIMES (5) //define the time interal(in milisecond) between each samples in
//normal operation
/**********************Application Related Macros**********************************/
#define GAS_LPG (0)
#define GAS_CO (1)
#define GAS_SMOKE (2)
/*****************************Globals***********************************************/
float LPGCurve[3] = {2.3,0.21,-0.47}; //two points are taken from the curve.
//with these two points, a line is formed which is "approximately equivalent"
//to the original curve.
//data format:{ x, y, slope}; point1: (lg200, 0.21), point2: (lg10000, -0.59)
float COCurve[3] = {2.3,0.72,-0.34}; //two points are taken from the curve.
//with these two points, a line is formed which is "approximately equivalent"
//to the original curve.
//data format:{ x, y, slope}; point1: (lg200, 0.72), point2: (lg10000, 0.15)
float SmokeCurve[3] ={2.3,0.53,-0.44}; //two points are taken from the curve.
//with these two points, a line is formed which is "approximately equivalent"
//to the original curve.
//data format:{ x, y, slope}; point1: (lg200, 0.53), point2: (lg10000, -0.22)
float Ro = 10; //Ro is initialized to 10 kilo ohms
void setup()
{
Serial.begin(9600); //UART setup, baudrate = 9600bps
Serial.print("Calibrating...n";
Ro = MQCalibration(MQ_PIN); //Calibrating the sensor. Please make sure the sensor is in clean air
//when you perform the calibration
Serial.print("Calibration is done...n";
Serial.print("Ro=";
Serial.print(Ro);
Serial.print("kohm";
Serial.print("n";
}
void loop()
{
Serial.print("LPG:";
Serial.print(MQGetGasPercentage(MQRead(MQ_PIN)/Ro,GAS_LPG) );
Serial.print( "ppm" );
Serial.print(" ";
Serial.print("CO:";
Serial.print(MQGetGasPercentage(MQRead(MQ_PIN)/Ro,GAS_CO) );
Serial.print( "ppm" );
Serial.print(" ";
Serial.print("SMOKE:";
Serial.print(MQGetGasPercentage(MQRead(MQ_PIN)/Ro,GAS_SMOKE) );
Serial.print( "ppm" );
Serial.print("n";
delay(200);
}
/****************** MQResistanceCalculation ****************************************
Input: raw_adc - raw value read from adc, which represents the voltage
Output: the calculated sensor resistance
Remarks: The sensor and the load resistor forms a voltage divider. Given the voltage
across the load resistor and its resistance, the resistance of the sensor
could be derived.
************************************************************************************/
float MQResistanceCalculation(int raw_adc)
{
return ( ((float)RL_VALUE*(1023-raw_adc)/raw_adc));
}
/***************************** MQCalibration ****************************************
Input: mq_pin - analog channel
Output: Ro of the sensor
Remarks: This function assumes that the sensor is in clean air. It use
MQResistanceCalculation to calculates the sensor resistance in clean air
and then divides it with RO_CLEAN_AIR_FACTOR. RO_CLEAN_AIR_FACTOR is about
10, which differs slightly between different sensors.
************************************************************************************/
float MQCalibration(int mq_pin)
{
int i;
float val=0;

for (i=0;i<calibaraion_sample_times;i++) { //take multiple samples
val += MQResistanceCalculation(analogRead(mq_pin));
delay(CALIBRATION_SAMPLE_INTERVAL);
}
val = val/CALIBARAION_SAMPLE_TIMES; //calculate the average value

val = val/RO_CLEAN_AIR_FACTOR; //divided by RO_CLEAN_AIR_FACTOR yields the Ro
//according to the chart in the datasheet

return val;
}
/***************************** MQRead *********************************************
Input: mq_pin - analog channel
Output: Rs of the sensor
Remarks: This function use MQResistanceCalculation to caculate the sensor resistenc (Rs).
The Rs changes as the sensor is in the different consentration of the target
gas. The sample times and the time interval between samples could be configured
by changing the definition of the macros.
************************************************************************************/
float MQRead(int mq_pin)
{
int i;
float rs=0;
for (i=0;i<read_sample_times;i++) {
rs += MQResistanceCalculation(analogRead(mq_pin));
delay(READ_SAMPLE_INTERVAL);
}

rs = rs/READ_SAMPLE_TIMES;

return rs;
}
/***************************** MQGetGasPercentage **********************************
Input: rs_ro_ratio - Rs divided by Ro
gas_id - target gas type
Output: ppm of the target gas
Remarks: This function passes different curves to the MQGetPercentage function which
calculates the ppm (parts per million) of the target gas.
************************************************************************************/
int MQGetGasPercentage(float rs_ro_ratio, int gas_id)
{
if ( gas_id == GAS_LPG ) {
return MQGetPercentage(rs_ro_ratio,LPGCurve);
} else if ( gas_id == GAS_CO ) {
return MQGetPercentage(rs_ro_ratio,COCurve);
} else if ( gas_id == GAS_SMOKE ) {
return MQGetPercentage(rs_ro_ratio,SmokeCurve);
}

return 0;
}
/***************************** MQGetPercentage **********************************
Input: rs_ro_ratio - Rs divided by Ro
pcurve - pointer to the curve of the target gas
Output: ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
of the line could be derived if y(rs_ro_ratio) is provided. As it is a
logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
value.
************************************************************************************/
int MQGetPercentage(float rs_ro_ratio, float *pcurve)
{
return (pow(10,( (log(rs_ro_ratio-pcurve[1])/pcurve[2]) + pcurve[0])));
}


-Aggiungo Codice dell' MQ-8 (inizialmente sfuggito ,pardon faccine/sad.gif )
/*******************Demo for MQ-8 Gas Sensor Module V1.0*****************************
Author: Tiequan Shao: tiequan.shao[at]sandboxelectronics.com
Peng Wei: peng.wei[at]sandboxelectronics.com

Lisence: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
Note: This piece of source code is supposed to be used as a demostration ONLY. More
sophisticated calibration is required for industrial field application.

Sandbox Electronics 2011-04-25
************************************************************************************/
/************************Hardware Related Macros************************************/
#define MQ_PIN (0) //define which analog input channel you are going to use
#define RL_VALUE (10) //define the load resistance on the board, in kilo ohms
#define RO_CLEAN_AIR_FACTOR (9.21) //RO_CLEAR_AIR_FACTOR=(Sensor resistance in clean air)/RO,
//which is derived from the chart in datasheet
/***********************Software Related Macros************************************/
#define CALIBARAION_SAMPLE_TIMES (50) //define how many samples you are going to take in the calibration phase
#define CALIBRATION_SAMPLE_INTERVAL (500) //define the time interal(in milisecond) between each samples in the
//cablibration phase
#define READ_SAMPLE_INTERVAL (50) //define how many samples you are going to take in normal operation
#define READ_SAMPLE_TIMES (5) //define the time interal(in milisecond) between each samples in
//normal operation
/**********************Application Related Macros**********************************/
#define GAS_H2 (0)
/*****************************Globals***********************************************/
float H2Curve[3] = {2.3, 0.47,-0.82}; //two points are taken from the curve in datasheet.
//with these two points, a line is formed which is "approximately equivalent"
//to the original curve.
//data format:{ x, y, slope}; point1: (lg200, 0.47), point2: (lg10000, -0.92)
float Ro = 10; //Ro is initialized to 10 kilo ohms
void setup()
{
Serial.begin(9600); //UART setup, baudrate = 9600bps
Serial.print("Calibrating...n";
Ro = MQCalibration(MQ_PIN); //Calibrating the sensor. Please make sure the sensor is in clean air
//when you perform the calibration
Serial.print("Calibration is done...n";
Serial.print("Ro=";
Serial.print(Ro);
Serial.print("kohm";
Serial.print("n";
}
void loop()
{
Serial.print("H2:";
Serial.print(MQGetGasPercentage(MQRead(MQ_PIN)/Ro,GAS_H2) );
Serial.print( "ppm" );
Serial.print("n";
delay(200);
}
/****************** MQResistanceCalculation ****************************************
Input: raw_adc - raw value read from adc, which represents the voltage
Output: the calculated sensor resistance
Remarks: The sensor and the load resistor forms a voltage divider. Given the voltage
across the load resistor and its resistance, the resistance of the sensor
could be derived.
************************************************************************************/
float MQResistanceCalculation(int raw_adc)
{
return ( ((float)RL_VALUE*(1023-raw_adc)/raw_adc));
}
/***************************** MQCalibration ****************************************
Input: mq_pin - analog channel
Output: Ro of the sensor
Remarks: This function assumes that the sensor is in clean air. It use
MQResistanceCalculation to calculates the sensor resistance in clean air
and then divides it with RO_CLEAN_AIR_FACTOR. RO_CLEAN_AIR_FACTOR is about
10, which differs slightly between different sensors.
************************************************************************************/
float MQCalibration(int mq_pin)
{
int i;
float val=0;

for (i=0;i<calibaraion_sample_times;i++) { //take multiple samples
val += MQResistanceCalculation(analogRead(mq_pin));
delay(CALIBRATION_SAMPLE_INTERVAL);
}
val = val/CALIBARAION_SAMPLE_TIMES; //calculate the average value

val = val/RO_CLEAN_AIR_FACTOR; //divided by RO_CLEAN_AIR_FACTOR yields the Ro
//according to the chart in the datasheet

return val;
}
/***************************** MQRead *********************************************
Input: mq_pin - analog channel
Output: Rs of the sensor
Remarks: This function use MQResistanceCalculation to caculate the sensor resistenc (Rs).
The Rs changes as the sensor is in the different consentration of the target
gas. The sample times and the time interval between samples could be configured
by changing the definition of the macros.
************************************************************************************/
float MQRead(int mq_pin)
{
int i;
float rs=0;
for (i=0;i<read_sample_times;i++) {
rs += MQResistanceCalculation(analogRead(mq_pin));
delay(READ_SAMPLE_INTERVAL);
}

rs = rs/READ_SAMPLE_TIMES;

return rs;
}
/***************************** MQGetGasPercentage **********************************
Input: rs_ro_ratio - Rs divided by Ro
gas_id - target gas type
Output: ppm of the target gas
Remarks: This function passes different curves to the MQGetPercentage function which
calculates the ppm (parts per million) of the target gas.
************************************************************************************/
int MQGetGasPercentage(float rs_ro_ratio, int gas_id)
{
if ( gas_id == GAS_H2) {
return MQGetPercentage(rs_ro_ratio,H2Curve);
}
return 0;
}
/***************************** MQGetPercentage **********************************
Input: rs_ro_ratio - Rs divided by Ro
pcurve - pointer to the curve of the target gas
Output: ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
of the line could be derived if y(rs_ro_ratio) is provided. As it is a
logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
value.
************************************************************************************/
int MQGetPercentage(float rs_ro_ratio, float *pcurve)
{
return (pow(10,( (log(rs_ro_ratio-pcurve[1])/pcurve[2]) + pcurve[0])));
}





Modificato da ElettroshockNow - 2/4/2013, 12:07
 

antoni0
milliWatt


Gruppo:Utente
Messaggi:8

Stato:



Inviato il: 2/4/2013,10:44

Grazie della risposta a entrambi, il mio dubbio non è specifico dell'arduino, riguarda anche l'implementazione che hai fatto te sul PPTEA. Io per adesso leggo solo dei dati che possono andare da 0 a 1023, che corrispondono ai valori di tensione da 0 a 5V. In ambiente normale ho dei valori intorno 500 che sarebbero 2.5V circa, usando una RL di 10K. I valori che ottengo sono coerenti con i tuoi ? tu che RL hai usato ?

Cmq Ro, come ha detto Elettroshock, dovrebbe essere la resistenza del sensore a 1000ppm di H2, Ro non è fornita in quanto probabilmente varia molto da un device all'altro e quindi ti dicono di fare una taratura a 1000ppm che sarebbe il punto in cui Rs/Ro vale 1.

Dopodichè per fare la conversione da Volt a PPM, ATTENZIONE, il diagramma è in scala Log-Log e quindi se li riportiamo in scala lineare otteniamo questa curva

ForumEA/us/img96/5724/84819651.jpg

che è un be
l esponenziale e quindi per trovare la formula bisogna chiedere aiuto ad excel o Matlab. Lo farò prossimamente però senza la possibilità di tararlo sui 1000PPM non si fa niente.

Cosa ne pensate del mio ragionamento ? è corretto ?








Modificato da antoni0 - 4/4/2013, 12:05
 

NonSoloBolleDiAcqua

Avatar
PetaWatt


Gruppo:AMMINISTRATORE
Messaggi:13786

Stato:



Inviato il: 2/4/2013,10:49

CITAZIONE (antoni0 @ 2/4/2013, 11:44)
per trovare la formula bisogna chiedere aiuto ad excel o Matlab

Non è necessario che tu calcoli la formula...come mi sembra di capire, se la funzione non è lineare, puoi ricavarti i valori in modo discreto. Mi spiego meglio, devi linearizzare i tratti lineari (da quel che vedo puoi suddividere il tuo grafico in 4 parti) e vai a prendere i valori corrispondenti in quella area.§Questo èvalido per qualsiasi funzione o grafico non lineare.Chiaro? Nella speranza di aver capito il tuo problema.
Cqm se lo fai con il PPTEA ti do una mano...se lo fai con arduino..no faccine/tongue.gif !
Ciao
Bolle



---------------
Chi sa raccontare bene le bugie ha la verità in pugno (by PinoTux).
Un risultato se non è ripetibile non esiste (by qqcreafis).

 

antoni0
milliWatt


Gruppo:Utente
Messaggi:8

Stato:



Inviato il: 2/4/2013,10:57

riguardo al codice che mi ha fatto scoprire Elettroshock, non è male, c'è anche quello per l'MQ-8 ! http://www.ebay.it/itm/MQ-8-Hydrogen-H2-Se...#ht_7277wt_1397

Cmq ho dato un occhiata veloce e li li calibrano in aria....ma in aria...non abbiamo 1000 PPM o si ? quant'è la percentuale di H2 in aria ? wikipedia dice che sono 0.55 PPM
Inoltre in quel codice li, fanno notare che è necessario usare una lookup table per avere una buona precisione, poi come esempio usano una relazione lineare.

QUOTE (NonSoloBolleDiAcqua @ 2/4/2013, 11:49)
QUOTE (antoni0 @ 2/4/2013, 11:44)
per trovare la formula bisogna chiedere aiuto ad excel o Matlab

Non è necessario che tu calcoli la formula...come mi sembra di capire, se la funzione non è lineare, puoi ricavarti i valori in modo discreto.

Grazie NonSoloBolle, ho capito cosa intendi, però mi sare più facile trovare una relazione apporossimata di un esponenziale...penso. Cmq vorrei capire se voi con il PPTEA avete tenuto conto che la relazione NON è lineare...

 

NonSoloBolleDiAcqua

Avatar
PetaWatt


Gruppo:AMMINISTRATORE
Messaggi:13786

Stato:



Inviato il: 2/4/2013,12:48

Sinceramente non conosco ne la problematica ne il codice scritto da Jumpy75, se lo dovevo fare io avrei effettuato una linearizzazione...l'eabasic consente di fare questo in modo molto semplice.
Ciao
Bolle



---------------
Chi sa raccontare bene le bugie ha la verità in pugno (by PinoTux).
Un risultato se non è ripetibile non esiste (by qqcreafis).

 

antoni0
milliWatt


Gruppo:Utente
Messaggi:8

Stato:



Inviato il: 4/4/2013,11:05

ho cambiato il grafico che avevo inseito, quello di prima era sbagliato.

 

NonSoloBolleDiAcqua

Avatar
PetaWatt


Gruppo:AMMINISTRATORE
Messaggi:13786

Stato:



Inviato il: 4/4/2013,11:15

Indipendentemente dal grafico il discorso non cambia.
Ciao
Bolle



---------------
Chi sa raccontare bene le bugie ha la verità in pugno (by PinoTux).
Un risultato se non è ripetibile non esiste (by qqcreafis).

 

BogdanS1
milliWatt


Gruppo:Utente
Messaggi:2

Stato:



Inviato il: 13/12/2013,19:59

Ciao!
Avete abandonato proggetto opure qualcosa e scoppiato? faccine/smile.gif


P.S. Devo tenere 24 x PzS750Ah in un magazinetto di 3m2 allora devo trovare il metodo efficace di ventilazione/sensor H2
Saluti
BogdanS

 
 InizioPagina
 

Pagine: (3)   1   2   [3]    (Ultimo Msg)

Versione Mobile!

Home page       TOP100-SOLAR      Home page forum