In this input we will see how to measure the current frequency and power with a non-invasive current sensor SCT-13-50, a dual amplifier LM358. The poweruc company supplied several sensors for review can visit them in www.poweruc.com
The most interesting thing about this project is that the current measurement can be done without having to open the circuit, because the sct013-50 sensor is very similar to an ampirometric clamp.
You may be interested in projects in Arduino, pic, robotics, telecommunications, subscribe http://www.youtube.com/user/carlosvolt?sub_confirmation=1 videos with full source code and diagrams
It should be noted that only one of the cables must be passed to make the measurement, because if we pass the two conductors we will get a wrong reading.
Circuit
The circuit is very simple to assemble,we will assemble it with an arduino nano, we can also use an arduino mega but we have to make a slight modification to the code, please observe the comments in the source code, to see which lines should be commented and un commented on.
Let’s use the sh1106 display to display at all times the current consumed, the network frequency and the apparent power. The LM358 is an operational amplifier, whose function is the rectification of the alternating wave generated by the sct-013-50 sensor, this wave is not suitable for the analog pin A0 of the Arduino, because this pin supports voltages ranging from 0 to 5 volts and the voltage that can deliver the current sensor goes from +/- 1 volt.
The semi negative cycle can damage our Arduino, so we must eliminate it, this we could get with rectifier diodes but the silicon diodes cause a voltage drop of 0.7 volts and the germanium ones of 0.6 volts, this is too much for the signal that the current sensor sct0-013-50 delivers us, so we will use an operational amplifier the LM358 in its configuration as a voltage tracker.
The LM358 is a dual general purpose operational amplifier, no dual source required, high gain, low power consumption, 0.7 MHz bandwidth.
Features:
-
- No. operational amplifiers: 2
- No dual source required (However with simple source it is not possible for the output to get negative voltages)
- Power voltage: 3 V to 32 V single source (±1.5 V to ±16 V dual source)
- Low power consumption
- Typical bandwidth: 0.7 MHz
- Compensated in frequency internally
- High gain
- Compatible with all forms of logic
The other configuration of the second operational amplifier is set as a non-inverter operational amplifier.
Look at the next circuit
Full circuit
We will need a resistor of 4.7 Kohm and 1 Mohm, at the output we will have an amplified and square wave suitable to connect a microcontroller to a digital pin.
The frequency of this wave will be directly related to the network frequency used in our country, in this example it will be 50 Hz, for the area where I live.
Let’s set an example taken from experience and captured with an oscilloscope.
The wave generated by the current sensor, is a wave ranging from -1 volts to 1 volt, is a sine wave. The voltage value delivered by the sensor will depend on the current consumed by the appliance.
The higher current consumed, the higher the voltage delivered by the sensor.
Once the wave is rectified, by the first operational amplifier (remember that the LM358 has two), we will only see the positive semicycle of the wave, which makes it suitable for the analog pins of any microcontroller.
PinOut LM358
In this image we can see in the yellow sine wave an alternating signal, which is not suitable for our Arduino, further down in the green wave we see a wave with half wave rectification.
It is observed that the frequency is almost 5o Herz, the same as that of the electricity grid, which is used is my country, we will take advantage of this frequency to obtain information and send it to the Arduino for its representation an oled display.
We compare the two waves, and we notice that the yellow part is the negative semicycle that we are not going to use.
We compare the two waves, at first glance it seems that both waves have the same amplitude, but if we look at the oscilloscope data correctly, we will see that the square wave has 3.7 volts, while the semi rectified wave is 132 mV.
If we see the multimeter the reading is almost zero as in the oled display, but in it we can see the consumed intensity, power and network frequency.
In order to measure the current with the sensor, we only have to pass one of the cables.
Here we can see the current consumption in both the multimeter and the display, it is almost the same, although we can improve the pressure by modifying some parameters in the source code.
Source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
#include "U8glib.h"//Librería para el control del display oled #include <FreqCount.h>//Librería para medir la frecuencia de una señal U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);// I2C / TWI // Se habilita esta linea según el display a usar en este caso el driver SH1106 unsigned long contador=0; float intencidad; float sensor; float potencia; void setup() { Serial.begin(9600);//velocidad de seteo del puerto serial analogReference(INTERNAL);//Configura la tensión de referencia utilizada para la entrada analógica 1.1 voltios //analogReference(INTERNAL1V1); //si usamos Arduino Mega FreqCount.begin(1000); } void loop() { float ondac=0; long retardo=millis(); int s=0; while(millis()-retardo<1000)//Duración de un segundo { //-------Ecuaciones para el calculo de la intencidad y potencia sensor = analogRead(A0) * (1.1 / 1023.0);//voltaje del sensor(se puede cambiar el valor para lograr mayor presisción) intencidad=sensor*50; //(50A/1V) ondac=ondac+sq(intencidad);//Sumatoria de Cuadrados/ sq-->cuadrado de un número s=s+1; delay(1); } ondac=ondac*2;//Para compensar los cuadrados de los semiciclos negativos. intencidad=sqrt((ondac)/s); //ecuación del RMS sqrt-->raiz cuadrada potencia=intencidad*220.0; // P=IV (Watts) cualculo de la potencia Serial.print("Corriente: "); Serial.print(intencidad,4); Serial.print(" Amperes, Potencia: "); Serial.print(potencia,4); Serial.println(" Watts"); contador = FreqCount.read();//Devuelve la medición más reciente, la medición se hace por defecto en el pin numero 5 del arduino Serial.print("Freq:"); Serial.println(contador);//Imprime el valor de la frecuencia obtenida en el monitor serial //} //--------Muestra en la pantalla los valores obtenidos de intencidad, potencia y frecuencia----------------- u8g.firstPage(); do { draw();//Llama a la función draw } while( u8g.nextPage() ); // Reconstruye la imagen después de un tiempo delay(50); } void draw(void) { //Los comandos gráficos para volver a dibujar la pantalla completa deben colocarse aquí u8g.setFont(u8g_font_unifont); u8g.setPrintPos(0, 20); u8g.print("Int:"); u8g.print(intencidad,4); u8g.print("A"); u8g.setPrintPos(0, 40); u8g.print("Pot:"); u8g.print(potencia,4); u8g.print("W"); u8g.setPrintPos(0, 60); u8g.print("Fre:"); u8g.print(contador); u8g.print("Hz"); } |
You may be interested in projects in Arduino, pic, robotics, telecommunications, subscribe http://www.youtube.com/user/carlosvolt?sub_confirmation=1 many videos with full source code and diagrams
RECOMMENDED PROJECT