miércoles, 29 de noviembre de 2017

Calculating Capacitor Current in Transformerless Power Supplies

Transformer less AC to DC power supply circuit using dropping capacitor


http://www.circuitsgallery.com/2012/07/transformer-less-ac-to-dc-capacitor-power-supply-circuit2.html

Production of low voltage DC power supply from AC power is the most important problem faced by many electronics developers and hobbyists. The straight forward technique is the use of a step down transformer to reduce the 230 V or 110V AC to a preferred level of low voltage AC. But i-St@r comes with the most appropriate method to create a low cost power supply by avoiding the use of bulky transformer.Yes, you can construct power supply for your development without a transformer. This circuit is so simple and it uses a voltage dropping capacitor in series with the phase line. Transformer less power supply is also called as capacitor power supply. It can generate 5V, 6V, 12V 150mA from 230V or 110V AC by using appropriate zener diodes. See the design below.

Circuit diagram

Power supply circuit

Components required

  1. Resistors (470kΩ, 1W; 100Ω)
  2. Capacitors (2.2µF, 400V, X rated; 1000µF, 50V)
  3. Bridge rectifier (1N4007 diodes x 4)
  4. Zener diode (6.2V, 1W)
  5. LED (Optional)

Working of Transformer less capacitor power supply

  • This transformer less power supply circuit is also named as capacitor power supply since it uses a special type of AC capacitor in series with the main power line.
  • A common capacitor will not do the work because the mains spikes will generate holes in the dielectric and the capacitor will be cracked by passing of current from the mains through the capacitor.
  • X rated capacitor suitable for the use in AC mains is vital for reducing AC voltage.
  • A X rated dropping capacitor is intended for 250V, 400V, 600V AC. Higher voltage versions are also obtainable. The dropping capacitor is non polarized so that it can be connected any way in the circuit.
  • The 470kΩ resistor is a bleeder resistor that removes the stored current from the capacitor when the circuit is unplugged. It avoid the possibility of electric shock.
  • Reduced AC voltage is rectifiered by bridge rectifier circuit. We have already discussed about bridge rectifiers. Then the ripples are removed by the 1000µF capacitor.
  • This circuit provides 24 volts at 160 mA current at the output. This 24 volt DC can be regulated to necessary output voltage using an appropriate 1 watt or above zener diode.
  • Here we are using 6.2V zener. You can use any type of zener diode in order to get the required output voltage.

Design

Reactance of the capacitor,
where f is the supply frequency and C is the capacitance.
If the supply frequency is 50Hz, then reactance of 2.2µF X rated capacitor is given by,

So output current,

You can design your own supply if you need high current rating other than 159mA by choosing different capacitor values.




Calculating Capacitor Current in Transformerless Power Supplies

https://www.homemade-circuits.com/calculating-capacitor-current-in/

You may have studied countless transformerless power supplies in this blog and in the web, however calculating the crucial mains capacitor current in such circuits has always remained an issue for the many constructors.

Analyzing a Capactive Power Supply

Before we learn the formula for calculating and optimizing the mains capacitor current in a transformerless power supply, it would be important to first summarize a standard transformerless power supply design.
The following diagram shows a classic transformerless power supply design:




Referring to the diagram, the various components involved are assigned with the following specific functions:
C1 is the nonopolar high voltage capacitor which is introduced for dropping the lethal mains current to the desired limits as per the load specification. This component thus becomes extremely crucial due to the assigned mains current limiting function.
D1 to D4 are configured as a bridge rectifier network for rectifying the stepped down AC from C1, in order to make the output suitable to any intended DC load.
Z1 is positioned for stabilizing the output to the required safe voltage limits.
C2 is installed to filter out any ripple in the DC and to create a perfectly clean DC for the connected load.
R2 may be optional but is recommended for tackling a switch ON surge from mains, although preferably this component must be replaced with a NTC thermistor.

Capacitor Controls Current

In the entire transformerless design discussed above, C1 is the one crucial component which must be dimensioned correctly so that the current output from it is optimized optimally as per the load specification.
Selecting a high value capacitor for a relatively smaller load may increase the risk of excessive surge current entering the load and damaging it sooner.
A properly calculated capacitor on the contrary ensures a controlled surge inrush and nominal dissipation maintaining adequate safety for the connected load.

Using Ohm's Law

The magnitude of current that may be optimally permissible through a transformerless power supply for a particular load may be calculated by using Ohm's law:
I = V/R
where I = current, V = Voltage, R = Resistance
However as we can see, in the above formula R is an odd parameter since we are dealing with a capacitor as the current limiting member.
In order to crack this we need to derive a method which will translate the capacitor's current limiting value in terms of Ohms or resistance unit, so that the Ohm's law formula could be solved.

Calculating Capacitor Reactance

To do this we first find out the reactance of the capacitor which may be considered as the resistance equivalent of a resistor.
The formula for reactance is:
Xc = 1/2(pi) fC
where Xc = reactance,
pi = 22/7
f = frequency
C = capacitor value in Farads
The result obtained from the above formula is in Ohms which can be directly substituted in our previously mentioned Ohm's law.
Let's solve an example for understanding the implementation of the above formulas:
Let's see how much current a 1uF capacitor can deliver to a particular load:
We have the following data in our hand:
pi = 22/7 = 3.14
f = 50 Hz (mains AC frequency)
and C= 1uF or 0.000001F
Solving the reactance equation using the above data gives:
Xc = 1 / (2 x 3.14 x 50 x 0.000001)
=  3184 ohms approximately
Substituting this equivalent resistance value in our Ohm's law formula, we get:
R = V/I
or I = V/R
Assuming V = 220V (since the capacitor is intended to work with the mains voltage.)
We get:
I = 220/3184
= 0.069 amps or 69 mA approximately
Similarly other capacitors can be calculated for knowing their maximum current delivering capacity or rating.
The above discussion comprehensively explains how a capacitor current may be calculated in any relevant circuit, particularly in transformerless capacitive power supplies.




https://circuitdigest.com/electronic-circuits/transformerless-power-supply

X-Rated Capacitor

As mentioned they are connected in series with phase line of AC to lower down the voltage, they are available in 230v, 400v, 600v AC or higher ratings.
x rated capacitors
Below is the table for output current and output voltage (without the Load), of different values of X-rated capacitors:
Capacitor Code
Capacitor value
Voltage
Current
104k
0.1 uF
4 v
8 mA
334k
0.33 uF
10 v
22 mA
474k
0.47 uF
12 v
25 mA
684k
0.68 uF
18 v
100 mA
105k
1 uF
24 v
40 mA
225k
2.2 uF
24 v
100 mA

Selection of voltage dropping capacitor is important, it is based on Reactance of Capacitor and  the amount of current to be withdrawn. The Reactance of the capacitor is given by below formula:
X = 1 / 2¶fC
X = Reactance of Capacitor
f = frequency of AC
C = Capacitance of X rated capacitor
We have used 474k means 0.47uF capacitor and frequency of AV mains is 50 Hz so the Reactance X is:
X = 1 / 2*3.14*50*0.47*10-6 = 6776 ohm (approx)
Now we can calculate the current (I) in the circuit:
I = V/X = 230/6775 = 34mA
So that’s how the Reactance and Current is calculated.

Como trabajar con un LCD con modulo I2C en Arduino en 3 pasos para un LCD 20x4 ( o 16x2)

Como trabajar con un LCD con modulo I2C en Arduino en 4 pasos para un LCD 20x4 ( o 16x2)

Paso 1. Alambrar el modulo I2C al Arduino UNO
SDA - Pin A4 de Arduino
SCL - Pin A4 de Arduino
VCC - Fuente Arduino
GND - Tierra Arduino

Paso 2. Escanear la dirección del módulo con el siguiente código

//Descargado de:
//https://miarduinounotieneunblog.blogspot.com.co/2015/12/display-lcd-16x2-con-comunicacion-i2c.html

/*  TITULO: Escaner de direcciones I2C

    AUTOR:
   
    MARIANO DEL CAMPO GARCÍA (@2016) --> INGENIERO TÉCNICO INDUSTRIAL ESPECIALIDAD ELECTRÓNICA
    - FACEBOOK: https://www.facebook.com/mariano.delcampogarcia
    - TWITTER: https://twitter.com/MarianoCampoGa
    - CORREO: marianodc83@gmail.com
   
   
    DESCRIPCIÓN DEL PROGRAMA
   
    Este programa sirve para buscar la dirección de comunicación I2C, en dispositivos conectados a nuestro
    Arduino mediante este protocolo de comunicación. El programa nos envía todas las direcciones de los
    dispositivos I2C que tengamos conectados en un determinado instante a través del monitor serie del IDE
    de Arduino. En este caso vamos a utilizar el escaner I2C para encontrar la dirección de un display LCD
    1602 conectado a través de este protocolo de comunicación.
 

    ESQUEMA DE CONEXION
   
                                      +-----+
         +----[PWR]-------------------| USB |--+
         |                            +-----+  |
         |         GND/RST2  [ ][ ]            |
         |       MOSI2/SCK2  [ ][ ]  A5/SCL[ ] |   SCL del módulo I2C conectado al LCD 1602
         |          5V/MISO2 [ ][ ]  A4/SDA[ ] |   SDA del módulo I2C conectado al LCD 1602
         |                             AREF[ ] |
         |                              GND[ ] |
         | [ ]N/C                    SCK/13[ ] |  
         | [ ]IOREF                 MISO/12[ ] |  
         | [ ]RST                   MOSI/11[ ]~|  
         | [ ]3V3    +---+               10[ ]~|  
         | [ ]5v    -| A |-               9[ ]~|  
         | [ ]GND   -| R |-               8[ ] |  
         | [ ]GND   -| D |-                    |
         | [ ]Vin   -| U |-               7[ ] |  
         |          -| I |-               6[ ]~|  
         | [ ]A0    -| N |-               5[ ]~|  
         | [ ]A1    -| O |-               4[ ] |  
         | [ ]A2     +---+           INT1/3[ ]~| 
         | [ ]A3                     INT0/2[ ] |  
         | [ ]A4/SDA  RST SCK MISO     TX>1[ ] |  
         | [ ]A5/SCL  [ ] [ ] [ ]      RX<0[ ] |  
         |            [ ] [ ] [ ]              |
         |  UNO_R3    GND MOSI 5V  ____________/
          \_______________________/

  NOTAS:
   - La alimentación y la masa del módulo LCM 1602 I2C V1 instalado en el LCD 1602, van directamente conectadas
     a VCC (+5V) y GND respectivamente. 
*/

// Librería necesaria para comunicación I2C
#include <Wire.h>


void setup()
{
  Wire.begin(); // Iniciamos la comunicación I2C

  Serial.begin(9600); // Iniciamos la comunicación con el monitor serie
  //while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nEscaner de direcciones I2C");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Escaneando...");

  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // Se utiliza el valor de retorno de Write.endTransmisstion() para ver si se ha reconocido
    // o no la dirección I2C de un dispositivo
  
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("Dispositivo I2C encontrado en la direccion 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("!");

      nDevices++;
    }
    else if (error == 4)
    {
      Serial.print("Error desconocido en la direccion 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }   
  }
  if (nDevices == 0)
    Serial.println("No se han encontrado direcciones I2C de ningun dispositivo \n");
  else
    Serial.println("Hecho\n");

  delay(5000);           // Espera 5 segundos hasta el siguiente escaneo
}



Paso 3. Descargar la libreria desde Github, e instalarla en Arduino (Programa -> Incluir Libreria...)

https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library


 https://cloud.mail.ru/public/4q5r/YzCuu7hEW

Paso 4. Hola mundo del LCD con I2C
Tener en cuenta escribir la dirección del escaneo en la creación del objeto: lcd(0x3F, 20, 4), en este caso el escaneo nos arrojo 0x3f



#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x3F for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F, 20, 4);

void setup()
{
  // initialize the LCD
  lcd.begin();

  // Turn on the blacklight and print a message.
  lcd.backlight();
  lcd.print("Hello, world!");
}

void loop()
{
  // Do nothing here...
}




Otro enlace interesante:
http://osoyoo.com/2017/01/15/use-arduino-serial-port-to-talk-with-i2c-lcd-display/

martes, 21 de noviembre de 2017

Programa en LAbVIEW para guardar la adquisición de 2 señales en un archivo plano txt

Programa en LAbVIEW 2017 para guardar la adquisición de 2 señales en un archivo plano txt










https://cloud.mail.ru/public/GF8d/dA4EDDoCY

Las columnas del archivo dados.txt son:

Tiempo: contador i, se multiplica por el Sampled Period, si se quiere hacer analisis en excel
Señal 1: Una señal aleatoria de 0 a 100
Señal 2: Otra señal aleatoria de 0 a 100

Aplicacion en LabVIEW para comunicacion Serial y Guardar en archivo de Excel

Aplicacion en LabVIEW para comunicacion Serial y Guardar en archivo de Excel
-Comunicación serial (VISA se debe descargar e instalar)
-Aplicación con 4 leds
-Escritura en un archivo de excel


Enlaces version Labview 2017 y código Arduino
https://cloud.mail.ru/public/MGAc/qZq8TPUgh

En version LabVIEW 2015
https://cloud.mail.ru/public/AzM9/nLwqzFso3

A continuación se presentan algunos pantallazos del programa en LabVIEW, en Arduino y el archivo de Excel que se escribe




sábado, 18 de noviembre de 2017

book Blender Game Engine Beginner's Guide The non programmer's guide to creating 3D video games Victor Kuller Bacone



Buena página para descargar libro

Blender Game Engine
Beginner's Guide
The non programmer's guide to creating 3D video games
Victor Kuller Bacone


https://it-book.pro/download/?id=126&type=pdf

Programación Visual Basic (VBA) para Excel y Análisis Numérico

https://tecdigital.tec.ac.cr/revistamatematica/cursos-linea/NUMERICO/excel/

 

Programación Visual Basic (VBA) para Excel y Análisis Numérico


M.Sc. Walter Mora F., M.Sc. José Luis Espinoza B.
Escuela de Matemática
Instituto Tecnológico de Costa Rica