AUTOMATIC CRADLE USING MSP430G2553 AND INA 122

Thank you texas instruments for giving sample ic for this project. I have used 
  • msp430g2553 OR msp430g2231
  • INA122
  • 7833
WORKING VIDEO

DESCRIPTION OF PARTS



CIRCUIT 

High pass filter is used remove dc noise and 50Hz noise .but  i used 16Hz cut off frequency. you can design it for 50Hz for better performance.

output of mic section (dc voltage shift due to dc noise)


output of high pass filter


output of ina122



output of ina122 (blue ) and output to relay section from controller

PROGRAM (ENERGIA COMPILER)
int micvoltage,potvoltage;
#define motor P1_5
#define mic A6
#define pot A7
void setup()
{


 pinMode(motor,OUTPUT);digitalWrite(motor,LOW);
}

void loop()
{

  readadc(); 
  
 while(micvoltage > potvoltage)
  {
    digitalWrite(motor,HIGH);delay(5000);
     readadc();  digitalWrite(motor,LOW); 
  }

}

void readadc (void)
{
  micvoltage= analogRead(mic);delay(1);
  potvoltage=analogRead(pot);delay(1);
}