element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs TI MSP432 LaunchPad: Power Meter 6000 Samples/cycle
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: martinvalencia
  • Date Created: 25 Apr 2015 12:12 AM Date Created
  • Views 1453 views
  • Likes 4 likes
  • Comments 4 comments
  • msp432_launchpad
  • signal
  • spanish
  • lcd
  • sample
  • boosterpack
  • msp432_mcu
  • opam
Related
Recommended

TI MSP432 LaunchPad: Power Meter 6000 Samples/cycle

martinvalencia
martinvalencia
25 Apr 2015
Description MSP432

The MSP432P401R LaunchPad enables you to develop high performance applications that benefit from low power operation. It features the MSP432P401R – which includes a 48MHz ARM Cortex M4F, 95uA/MHz active power and 850nA RTC operation, 14-bit 1MSPS differential SAR ADC and AES256 accelerator.

This Launchpad includes an on-board emulator with EnergyTrace+ Technology, which means you can program and debug your projects without the need for additional tools, while also measuring total system energy consumption.

All pins of the MSP-EXP432P401R device are fanned out for easy access. These pins make it easy to plug in 20-pin and 40-pin BoosterPacks that add additional functionality like wireless, capacitive touch and more.

                                                                         

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

782c5bbd-b926-41e7-840e-00773baa7c2e.HR.jpg

Features
  • Low-power, high performance MSP432P401R MCU
    • 48MHz 32-bit ARM Cortex M4F with Floating Point Unit and DSP acceleration
    • Power consumption: 95uA/MHz active, and 850nA RTC standby operation
    • Analog: 24Ch 14-bit differential 1MSPS SAR ADC, Two Comparators
    • Digital: Advanced Encryption Standard (AES256) Accelerator, CRC, DMA, HW MPY32
    • Memory: 256KB Flash, 64KB RAM
    • Timers: 4 x16-bit, and 2 x 32-bit
    • Communication: Up to 4 I2C, 8 SPI, 4 UART
  • 40 pin BoosterPack Connector, and support for 20 pin BoosterPacks
  • Onboard XDS-110ET emulator featuring EnergyTrace+ Technology
  • 2 buttons and 2 LEDs for User Interaction
  • Back-channel UART via USB to PC

 

                                                                               

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Description Project

The project was developed by the need to know if a motor is operating.

why?

 

- Where have many motoros moving conveyor belt materials and the system detects that one of the 20 or 30 motor this unfortunate and you do not know which is presented.

 

solution!

microcontroller-based low-cost, low power consumption and high reliability, the MSP432 device has these characteristics me to develop my application.

The circuit measures the RMS current and RMS voltage of the line, also indicated on the LCD screen if the engine is running.

there are cases that electrical tension exists between terminals of an engine but the engine just does not work and worse if many motors simply can detect the problem by measuring the current in each motor.

 

Schematic and BoosterPack

imageimage

 

 

 

    Signal Conditioning

 

 

imageimage

Signal Out

image

 

Video Operation MSP432 Power Meter

 

                                                               

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Gallery

 

image

image

 

image

 

Program energia.nu
Power Meter

#include <LiquidCrystal.h>

#include <stdio.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(35, 34, 39, 38, 37, 36);

 

char Mensaje[20]="0";

char Mensaje1[20]="0";

char Mensaje2[20]="0";

 

int sample_corriente[1024];

int sample_voltaje[1024];

 

/*registros para muestras*/

int Samples=1024;

int ii;

 

void setup() {

  // set up the LCD's number of columns and rows:

  analogReadResolution(14);

  lcd.begin(20,4);

  // Print a message to the LCD.

  lcd.setCursor(0, 0);

  lcd.print(" TI LaunchPad MSP432");

  lcd.setCursor(3, 1);

  lcd.print("Vrms and Irms");

  lcd.setCursor(3, 2);

  lcd.print("Power Meter");

  lcd.setCursor(1, 3);

  lcd.print("ElectronAplica");

 

 

  delay(2000);

 

 

}

 

void loop() {

 

  /*Sampling*/

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(490);                      // tiempo de muestreo 980usegundos

  }

 

  /*Calculo de IRMS*/

 

 

  float Irms = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms = Irms + sample_corriente[ii] * sample_corriente[ii] / Samples;

  }

 

 

  float Irmsn = sqrt(Irms) * 3.3 / 16384;

  if (Irmsn > 10e-02) {

    float x1 = Irmsn;

    double x3 = pow(Irmsn, 3);

    double x2 = pow(Irmsn, 2);

 

 

    Irmsn = 2.72433654e-01 * x3 - 2.55920550e-01 * x2 + 3.55114997e-01 * x1

      - 1.53643917e-02;

  }

  else

    Irmsn = 0;

 

  /*Etapa para seleccion de operaciones a realizar*/

  if(Irmsn<100e-3){

    Irmsn=Irmsn*1000;

    sprintf(Mensaje,"%3.3f mA",Irmsn);

  }

  else

    sprintf(Mensaje,"%3.3f A",Irmsn);

 

 

  if(Irmsn<10e-2)

    sprintf(Mensaje2,"Motor OFF");

  else

    sprintf(Mensaje2,"Motor ON");

 

 

  /*Calculo de VRMS*/

 

 

  float Vrms = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms = Vrms + sample_voltaje[ii] * sample_voltaje[ii] / Samples;

 

  //float Vrmsn = sqrt(Vrms) * 3.3 / 4095;

  float Vrmsn = (sqrt(Vrms) * 3.3 / 16384) * 24.3124 * 28.4;

 

  if (Vrmsn < 50)

    Vrmsn = 0;

 

  sprintf(Mensaje1,"%3.2f V",Vrmsn);

  lcd.clear();

 

  lcd.setCursor(1, 0);

  lcd.print("True RMS / MSP432");

  lcd.setCursor(3, 1);

  lcd.print(Mensaje);

  lcd.setCursor(3, 2);

  lcd.print(Mensaje1);

  lcd.setCursor(1, 3);

  lcd.print(Mensaje2);

}

 

UPGRADE

 

6000 SAMPLES PER CYCLE

#include <LiquidCrystal.h>

#include <stdio.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(35, 34, 39, 38, 37, 36);

 

 

 

 

char Mensaje[20]="0";

char Mensaje1[20]="0";

char Mensaje2[20]="0";

 

 

 

 

int sample_corriente[1000];

int sample_voltaje[1000];

 

 

int sample_corriente1[1000];

int sample_voltaje1[1000];

 

 

int sample_corriente2[1000];

int sample_voltaje2[1000];

 

 

int sample_corriente3[1000];

int sample_voltaje3[1000];

 

 

int sample_corriente4[1000];

int sample_voltaje4[1000];

 

 

int sample_corriente5[1000];

int sample_voltaje5[1000];

 

 

 

 

/*registros para muestras*/

int Samples=1000;

int ii;

 

 

void setup() {

  // set up the LCD's number of columns and rows:

  analogReadResolution(14);

  lcd.begin(20,4);

  // Print a message to the LCD.

 

  lcd.setCursor(0, 0);

  lcd.print(" TI LaunchPad MSP432");

  lcd.setCursor(1, 1);

  lcd.print("6000 Samples/Cycle");

  lcd.setCursor(3, 2);

  lcd.print("Full True RMS");

  lcd.setCursor(1, 3);

  lcd.print("ElectronAplica");

 

 

  delay(2000);

 

 

}

 

 

void loop() {

 

 

  /*Sampling*/

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

 

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente1[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje1[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente2[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje2[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente3[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje3[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

  /*Sampling*/

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente4[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje4[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

 

  for (ii = 0; ii < Samples; ii++) {

    sample_corriente5[ii]= analogRead(A14)-analogRead(A11);    //A14 SEÑAL DE CORRIENTE/ A11--->REFERENCIA

    sample_voltaje5[ii]= analogRead(A13)-analogRead(A11);      //A13 SEÑAL DE VOLTAJE/ A11--->REFERENCIA

    delayMicroseconds(4);                      // tiempo de muestreo 980usegundos

  }

 

 

 

 

  /*IRMS*/

  int Samples_part=6000;

 

 

  float Irms = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms = Irms + sample_corriente[ii] * sample_corriente[ii] / Samples_part;

  }

float Irms1 = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms1 = Irms1 + sample_corriente1[ii] * sample_corriente1[ii] / Samples_part;

  }

  float Irms2 = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms2 = Irms2 + sample_corriente2[ii] * sample_corriente2[ii] / Samples_part;

  }

  float Irms3 = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms3 = Irms3 + sample_corriente3[ii] * sample_corriente3[ii] / Samples_part;

  }

    float Irms4 = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms = Irms4 + sample_corriente4[ii] * sample_corriente4[ii] / Samples_part;

  }

  float Irms5 = 0;

  for (ii = 0; ii < Samples; ii++) {

    Irms5 = Irms5 + sample_corriente5[ii] * sample_corriente5[ii] / Samples_part;

  }

 

 

 

  Irms=Irms+Irms1+Irms2+Irms3+Irms4+Irms5;

 

 

 

 

 

 

  /* VRMS*/

  Samples_part=6000;

 

  float Vrms = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms = Vrms + sample_voltaje[ii] * sample_voltaje[ii] / Samples_part;

 

 

  float Vrms1 = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms1 = Vrms1 + sample_voltaje1[ii] * sample_voltaje1[ii] / Samples_part;

 

 

  float Vrms2 = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms2 = Vrms2 + sample_voltaje2[ii] * sample_voltaje2[ii] / Samples_part;

 

 

  float Vrms3 = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms3 = Vrms3 + sample_voltaje3[ii] * sample_voltaje3[ii] / Samples_part;

   

  float Vrms4 = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms4 = Vrms4 + sample_voltaje4[ii] * sample_voltaje4[ii] / Samples_part;

 

 

  float Vrms5 = 0;

  for (ii = 0; ii < Samples; ii++)

    Vrms5 = Vrms5 + sample_voltaje5[ii] * sample_voltaje5[ii] / Samples_part;

 

 

  Vrms=Vrms+Vrms1+Vrms2+Vrms3+Vrms4+Vrms5;

 

 

 

 

  /******************************************/

  float Irmsn = sqrt(Irms) * 3.3 / 16384;

  if (Irmsn > 10e-02) {

    float x1 = Irmsn;

    double x3 = pow(Irmsn, 3);

    double x2 = pow(Irmsn, 2);

 

 

    Irmsn = 2.72433654e-01 * x3 - 2.55920550e-01 * x2 + 3.55114997e-01 * x1

      - 1.53643917e-02;

  }

  else

    Irmsn = 0;

 

 

  /*Etapa para seleccion de operaciones a realizar*/

    sprintf(Mensaje,"%3.6f A",Irmsn);

 

 

  if(Irmsn<10e-2)

    sprintf(Mensaje2,"  Motor    OFF");

  else

    sprintf(Mensaje2,"  Motor    ON");

 

 

 

 

 

 

  //float Vrmsn = sqrt(Vrms) * 3.3 / 4095;

  float Vrmsn = (sqrt(Vrms) * 3.3 / 16384) * 25 * 28.4;

 

 

  if (Vrmsn < 50)

    Vrmsn = 0;

 

 

  sprintf(Mensaje1,"%3.2f   V",Vrmsn);

 

 

 

 

  lcd.clear();

 

 

 

 

 

 

 

 

  lcd.setCursor(3, 0);

  lcd.print(Mensaje);

  lcd.setCursor(3, 1);

  lcd.print(Mensaje1);

  lcd.setCursor(1, 2);

  lcd.print(Mensaje2);

 

 

  lcd.setCursor(0,3);

  lcd.print("--------------------");

 

  //delay(50);

 

 

}

  • Sign in to reply

Top Comments

  • DAB
    DAB over 10 years ago +1
    Nice post and interesting project. The MSP432 looks impressive, so I am very interested in your progress and impressions of how easy it is to use. Thanks DAB
  • martinvalencia
    martinvalencia over 10 years ago in reply to DAB +1
    thank you very much for your comment !, I'm really excited about working with the MSP432 MCU with a high processing capacity, I don't have much knowledge in advanced programming on MSP432 so I use energia…
  • Former Member
    Former Member over 10 years ago +1
    Hello Martin, Very nice job! Let me congratulate for you. I am in trouble with MSP432 Application UART communication back to PC. It seems you are very experienced with MSP432. Would you mind take a look…
Parents
  • Former Member
    Former Member over 10 years ago

    Hello Martin,

     

    Very nice job! Let me congratulate for you. I am in trouble with MSP432 Application UART communication back to PC. It seems you are very experienced with MSP432. Would you mind take a look at my thread on TI's forum? I am in trouble but nothing works... https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/417262/1492332#1492332

     

    Any idea or advice are welcome!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Former Member
    Former Member over 10 years ago

    Hello Martin,

     

    Very nice job! Let me congratulate for you. I am in trouble with MSP432 Application UART communication back to PC. It seems you are very experienced with MSP432. Would you mind take a look at my thread on TI's forum? I am in trouble but nothing works... https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/417262/1492332#1492332

     

    Any idea or advice are welcome!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • martinvalencia
    martinvalencia over 10 years ago in reply to Former Member

    hehehe really have not much experience with the MSP432, but I'm sending your question to the experts at Texas Instruments, hopefully give you a quick solution!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube