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.
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
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
Signal Conditioning
Signal Out
Video Operation MSP432 Power Meter
Gallery
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);
} |
Top Comments