This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1230 interfacing 8052 Microcontroller

Other Parts Discussed in Thread: ADS1230

Dear Sir,

            I  interfaced ADS1230 with 8051.Its working fine,for the load cells 10kg,20kg,50kg......100kg.When  connecting  these load cells the internal counts(initial ADC counts without load)  of the ADC will remains in positive,so there is no problem to calibrate and also it shows the exact weight.

             But if i connected some other high capacity load cells such as200kg,300kg...750kg  the initial counts without load will remain below zero.So if i calibrated without considering these negative counts,it seems skipping the starting value until  the counts reaches positive, during weighing an object.

             So what step should  i take to eliminate these problems.Please Help..

             Expecting Your precious suggestions...

                                                                             Thanking You..

                                                                                            Ajit Plakkat

  • Hi Ajit,

    How do you compensate for the initial counts of the ADS1230 when using the smaller load cells?  I suspect you perform an offset calibration and then subtract any positive code error from each conversion result.  The operation should be similar for a negative error - simply add that value to each conversion result.  Are your problems related to dealing with the binary two's compliment format of the conversion results? 

  • Hello Sir,
       First, Thanks for your great support and quick response.
    1)   Actually i get the initial counts by applying 20 clock pulses(without any load on the load cell).And i  store this counts in a variable(h_count).This counts is always a positive binary numbers.But in rare cases i observed that this count will remains in 2's compliment, if the load cell is not properly balanced.So my doubt is when these initial counts remains in 2's compliment how to handle the data. Should i change the 2's compliment counts into positive binary(by EX-OR ing + 1) before calculation.If there any problem if i use 2's compliment directly in calculation.For my calculation i will change the 2's compliment into binary,Is this procedure is correct.My calculation looks like:
    ((updated_count - h_count) * (calibrated_weight)) / (s_count - g_count)
    where, h_count are the initial counts without load(binary or in 2's compliment)
               s_count and g_count are the counts stored during calibration.
    2) Also i have doubt regarding the Least Count setting.After the above calculation i can weigh the weight on load cells and the reading looks like 0000,0001,0002,......0010...0100..1000 etc(1000 for 1kilogram).Some weigh scale uses 1gm Least count.Some others uses 2gm or even 5gm(depending upon the  load cell capacity).My doubt is how to use different least count in the above calculation.
      Actually i made a formula to calculate the least count,but i m not sure its perfect.its look like
        unsigned long my_data;
        unsigned char compare;
        my_data=((updated_count - h_count) * (calibrated_weight) * 10) / (s_count - g_count);
        my_data=my_data / least_count ;   //least_count may be 1gm,2gm or 5gm
        
        compare=my_data%10;
        
        if(compare > least_count)
          {
          my_data = my_data / 10;
         my_data = (my_data * least_count) + least_count;
        }
    else
       {
          my_data = my_data / 10;
         my_data = (my_data * least_count);
       }
    I m using the above calculation to achieve different least count(1gm,2gm,5gm etc).But I m not sure these procedures for calculations are correct or not.Please verify  my codes and give me necessary suggestions..Expecting your valuable reply...
                                                     
                                         Thank you

                                                 by Ajit Plakkat

  • Ajit,

    The best thing to do after power up is to run the offset calibration.  This will remove any offset that may be inherent to the ADS1230.  The next thing to do is make sure that the input is stable prior to scale calibration.  This will take about 4-5 conversion periods for the digital filter to settle.  At this point you can take the conversion count and store as your no load count (we will call this CalMin.)  It is possible for this count to be a negative value, as the difference applied may be something other than a positive value if the scale is not balanced.

    Now if you place the calibrated weight on the load cell you will have a step change.  You must once again wait for the digital filter to settle which will take about 4-5 conversion periods.  The result will now be your calibrated full scale count (which we will call CalMax.)  The total span of the load cell using the calibrated weight is CalMax-CalMin.  The smallest weight unit that can be measured is the CalibratedWeight / (span) or CalibratedWeight / (CalMax-CalMin).

    The actual weight that is measured will be determined by the value of the ADCResult (offset adjusted) with a weight applied, times the value of smallest weight unit that can be measured.

     Weight  = (CalibratedWeight / (CalMax - CalMin) ) * (ADCResult - CalMin)

    All these values take into account the two's complement value, so they must be signed instead of unsigned values, and the ADCResult must be properly sign extended.  The Weight value will be relative to the calibrated weight and the span.  This is the actual weight.  To find the closest weight can be done in a number of ways.  One way may be to use modf() function to analyze the fractional component of a number and then add or subtract a value to the closest desired point.  In our software we use a number conversion process prior to displaying a value to a LCD display as an ASCII value, and not regular numeric manipulation as you have shown.  This is more on the order of formatting the data for display.

    Best regards,

    Bob B

     

  • sir please can u send me the circuit diagram and the code for 1230 .....i will thankful..my email id is ptapan268@gmail.com

  • Hi Tapan,

    All files related to the ADS1230REF, which is a weigh scale reference design using an MSP430, are found here:

    ftp://ftp.ti.com/pub/data_acquisition/ADS123xREF/ADS123x_CDROM/

    Best regards,

    Bob B

  • thanks bob i gone through the refrence code  ...but i need refrence code for 8051 controllers so i thought maybe ajit kumar can help me out

  • bob.. can i use icl 7135 for weighing scale and how can i get the bcd data to  8051 do i need to connet an demux for that job..please reply as soon as possible

  • Hi Tapan,

    The part you are referencing is unfortunately a competitor's part and I am not able to support it.  As to 8051, it may be easisest to just bit-bang the GPIO for communication to the ADS1230.  Maybe Ajit will reply, but this thread is over two years old.

    Best regards,

    Bob B