Arduino Weight Sistem

Hello everyone,

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?

My code for sensor reading is:

#define sensor A0
float adc;

void setup() {
Serial.begin(9600);
}

void loop() {

adc = analogRead(sensor);
delay(1)
Serial.println(adc);
delay(1000);

}

What im doing wrong to read the right analog input from the sensor?

The datasheet of it is: http://www.wika.us/upload/DS_PE_A_10_en_us_16479.pdf

Can you please give me a tip?

Cheers

Did you connect the grounds?

I've conected the sensor positive and negative to external power source and output to arduino.

Tried to conect the earth ground from the sensor to arduino's ground, but keeps the same thing. :confused:

(deleted)

Just 2 mins and I upload a draw of the mega and the sensor how I got it connected

Here it is...

Tried to connect the earth ground to arduino's ground, still got the same oscilation :confused:

Hi,
Welcome to the forum.

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?

Thanks.. Tom... :slight_smile:

Hi,
Just found your sensor.

http://www.wika.com.au/upload/DS_PE_A_10_en_us_16479.pdf

Check which pins are 1, 2, and 3.
You need to connect the negative of the sensor to the gnd of the arduino.

Tom.... :slight_smile:

I have a Mecatronic formation, but on eletronic im not that good .. So, im very newbi :stuck_out_tongue:

I'll try so to connect the negative to arduino's ground ..

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.

#define sensor A0
float adc;
float voltaje;
float variable;
float rel_voltage_variable = 0.83;

void setup() {
Serial.begin(9600);
}

void loop() {
adc = analogRead(sensor);
delay(1);
voltaje = adc * 5 / 1023;
delay(1);
variable = voltaje * rel_voltaje_variable;
delay(1);
Serial.print(variable);
Seria.println(" Bar");

delay(1000);
}

Im getting readings now from 0.00 to 0.02 and sometimes 0.13 but rarely .. But when I apply presure on the sensor it keeps stable at 0.00 or 0.13 .. :confused:

Getting crazy about this ..

Hi,
How much pressure are you applying?
Can you measure with a DMM the output volts of the sensor as you apply pressure and see what it reads.

Thanks... Tom.. :slight_smile:

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?

It's a Mikroe RTC Click board.

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.

It's a Mikroe RTC Click.

Datasheet: http://download.mikroe.com/documents/add-on-boards/click/rtc/rtc-click-manual-v100.pdf

Can't see an arduino librery on it :confused:

Google "pcf8583 arduino"

Hey guys,

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? :confused:

Cheers

Your code does not (cannot possibly) compile.

It was just part of the code, not a complete copy paste of that.

Now I got the hours working fine .. But the year are passing 20 by 20 and can't set the day of the week neither the month ..

Ruanez:
It was just part of the code, not a complete copy paste of that.

Then do post all of it.