Im on my hands one project with one Arduino MEGA ADK, to receive pressure from a pressure tranductor and convert it to Kg's to display it on LCD 20x4.
Im having trouble with the pressure sensor, it's one WIKA A-10, 0-6Bar and output 0-5V.
It's powered from outside with 12Vdc and the output simply connected to A0 from Mega.
Im having trouble with the readings, it keeps floating between 0 and 1023 in ADC, measuring the output with a voltimeter it keeps stable and 0.17V with no pressure on it.
I tried to pull a resistor of 100k to ground on pin A0, did nothing, tried to pull down every single analog input of MEGA did nothing.
Im going crazy with this reading of arduino .. Can you give me a tip please?
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html
then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Also can you post a link to the pressure transmitter please, are you sure it is 0-5V output and not 0-20mA?
You musy connect arduino ground to sensor ground so that the analog input has a ground reference to the sensor.
What is your electronics, programming, arduino, hardware experience?
Ok, here is the result ..
Connected the negative from the sensor to Arduino's ground and now I don't have that amount of oscilaton .. But still don't have any measurement from the sensor ..
Here is the code to conver the sensor signal to Bar.
Got it working finally, just needed a common ground with the sensor to keep everything working fine.
Now the arduino and the sensor are powered from a 12Vbattery.
Another thing, anyone knows what regist should I call from a Mikroe RTC board to receive the time clock and date?
Ruanez:
Got it working finally, just needed a common ground with the sensor to keep everything working fine.
Reply #1 for the win!
Another thing, anyone knows what regist should I call from a Mikroe RTC board to receive the time clock and date?
It's a Mikroe RTC Click board.
Did the board come with an Arduino library? Then use that. Did it come with a datasheet? Then read the datasheet. If not, then you need to find out which chip is on that board and find the datasheet for that.
Still having trouble with my RTC module .. Con't get the right date and time, once I setup the date and time, it keep's showing me the setup date and time instead of upgrading it and show the right and actual date/time.
It's the PCF8583, RTC Click by Mikroe.
Here is my code:
#include "Wire.h"
#include <LiquidCrystal.h>
#define Mikroe_ADDRESS 0x50
byte zero = 0x00;
//Selecionadataehora()
Mostrarelogio();
delay(500);
void SelecionaDataeHora() //Seta a data e a hora do RTC
{
byte segundos = 35; //Valores de 0 a 59
byte minutos = 30; //Valores de 0 a 59
byte horas = 16; //Valores de 0 a 23
byte diadasemana = 2; //Valores de 0 a 6 - 0=Domingo, 1 = Segunda, etc.
byte diadomes = 10; //Valores de 1 a 31
byte mes = 5; //Valores de 1 a 12
byte ano = 16; //Valores de 0 a 99
Wire.beginTransmission(Mikroe_ADDRESS);
Wire.write(zero); //Stop no CI para que o mesmo possa receber os dados
//As linhas abaixo escrevem no CI os valores de
//data e hora que foram colocados nas variaveis acima
Wire.write(ConverteParaBCD(segundos));
Wire.write(ConverteParaBCD(minutos));
Wire.write(ConverteParaBCD(horas));
Wire.write(ConverteParaBCD(diadasemana));
Wire.write(ConverteParaBCD(diadomes));
Wire.write(ConverteParaBCD(mes));
Wire.write(ConverteParaBCD(ano));
Wire.write(zero); //Start no CI
Wire.endTransmission();
//-------------------------------------------------------------------
}
byte ConverteParaBCD(byte val){ //Converte o número de decimal para BCD
return ( (val/10*16) + (val%10) );
}
byte ConverteparaDecimal(byte val) { //Converte de BCD para decimal
return ( (val/16*10) + (val%16) );
}
void Mostrarelogio()
{
Wire.beginTransmission(Mikroe_ADDRESS);
Wire.write(zero);
Wire.endTransmission();
Wire.requestFrom(Mikroe_ADDRESS, 7);
int segundos = ConverteparaDecimal(Wire.read());
int minutos = ConverteparaDecimal(Wire.read());
int horas = ConverteparaDecimal(Wire.read() & 0b111111);
int diadasemana = ConverteparaDecimal(Wire.read());
int diadomes = ConverteparaDecimal(Wire.read());
int mes = ConverteparaDecimal(Wire.read());
int ano = ConverteparaDecimal(Wire.read());
lcd.setCursor(0,3);
switch(diadasemana)
{
case 0:lcd.print("Sun ");
break;
case 1:lcd.print("Mon ");
break;
case 2:lcd.print("Tue ");
break;
case 3:lcd.print("Wed ");
break;
case 4:lcd.print("Thu ");
break;
case 5:lcd.print("Fry ");
break;
case 6:lcd.print("Sat ");
}
//----------------------------
//----Data e Hora----------
// lcd.print("Data: ");
lcd.print(diadomes);
lcd.print("/");
lcd.print(mes);
lcd.print("/");
lcd.print(ano);
lcd.print(" ");
//lcd.print("Hora : ");
lcd.print(horas);
lcd.print(":");
lcd.print(minutos);
lcd.print(":");
lcd.print(segundos);
Can anyone please give me a tip? What's going on here?