Tuesday, June 29, 2021

How to Calculate and Design Uncontrolled Halfwave Rectifier with R Load | MATLAB Simulink

A half-wave rectifier is a rectifier that converts ac to dc and widely used for low-power applications. However, the practical application of this circuit is limited and worth studying in detail. Figures (i) and (ii) show the circuit and a voltage waveform of an uncontrolled half-wave rectifier with the resistive load that has a 240 V source of voltage at a frequency of 50 Hz with the load resistor 10 Ω. 

First, determine the values of (a) the average load current, (b) the average load voltage, (c) the average load power, (d) the rms value of load current, (e) the rms value of load voltage (f) the rms value of load power and (g) the power factor of the circuit. After that, design the rectifier using Simulink MATLAB. Finally, compare the simulation result with the theory.

(i) The circuit of uncontrolled half-wave rectifier with resistive (R) load

(ii) The voltage waveform of uncontrolled half-wave rectifier with resistive (R) load

List of symbols:
$I_{o,avg}$ average output current
$I_{o}$ output current
$I_{s,rms}$ source current in rms value
$I_{o,rms}$ output current in rms value
$V_{m}$ maximum voltage
$V_{d}$ diode voltage
$V_{o,avg}$ average output voltage
$V_{o}$ output voltage
$V_{s,rms}$ source voltage in rms value
$V_{o,rms}$ output voltage in rms value
$V_{f}$ forward voltage
$P_{o,avg}$ average output power
$P_{o}$ power output
$P_{o,rms}$ output power in rms value
$\omega $ angular frequency
$t$ time
$pf$ power factor
$R$ resistor
$S$ apparent power

Step 1: Theory
  1. The average load current, $I_{o,avg}$
    \[I_{o,avg}= I_{o}= \frac{V_{o}}{R}=\frac{V_{m}}{\pi R}\]
    \[V_{m}=\sqrt{2}\times V_{s,rms}\]
    \[I_{o,avg}=\sqrt{2}\times 240\]
    \[I_{o,avg}=10.80\:A\]

  2. The average load voltage, $V_{o,avg}$
    \[V_{o,avg}=V_{o}=I_{o}R=\frac{V_{m}}{\pi }\]
    \[V_{o,avg}=\frac{\sqrt{2}\times 240}{\pi }\]
    \[V_{o,avg}=108.04\:V\]

  3. The average load power, $P_{o,avg}$
    \[P_{o,avg}=P_{o}=P_{o,avg}I_{o,avg}=I_{o,avg}^{2}R=\frac{V_{o,avg}^{2}}{R}\]
    \[P_{o,avg}=\frac{108.04^{2}}{10}\]
    \[P_{o,avg}=1167.26\:W\]

  4. The rms value of load current, $I_{o,rms}$
    \[I_{o,rms}=\frac{V_{o,rms}}{R}=\frac{V_{m}}{2R}\]
    \[I_{o,rms}=\frac{\sqrt{2}\times 240}{2\times 10}\]
    \[I_{o,rms}=16.97\:A\]

  5. The rms value of load voltage, $V_{o,rms}$
    \[V_{o,rms}=I_{o,rms}R=\frac{V_{m}}{2}\]
    \[V_{o,rms}=\frac{\sqrt{2}\times 240}{2}\]
    \[V_{o,rms}=169.71\:V\]

  6. The rms value of load power, $P_{o,rms}$
    \[P_{o,rms}=V_{o,rms}I_{o,rms}=I_{o,rms}^{2}R=\frac{V_{o,rms}^{2}}{R}\]
    \[P_{o,rms}=\frac{169.71^{2}}{10}\]
    \[P_{o,rms}=2880.15\:W\]

  7. The power factor of the circuit, $pf$
    \[pf=\frac{P_{o,rms}}{S}=\frac{P_{o,rms}}{V_{s,rms}I_{s,rms}}=\frac{V_{o,rms}}{V_{s,rms}}\]
    \[I_{s,rms}=I_{o,rms}\]
    \[pf=\frac{169.71}{240}\]
    \[pf=0.707\]
Step 2: Simulation
  1. For simulation, open the Simulink Library Browser and add blocks (Scope, AC Voltage Source, Diode, Series RLC Branch, RMS, Mean, Display, Voltage Measurement, Current Measurement, Goto, From, powergui, Product and Divide) to model.

  2. Rearrange, copy and paste, and rename blocks accordingly, as shown in the figure below.



  3. Click Series RLC Branch block and change the parameters to "Branch type:" to R, "Resistance (ohms):" to  10, and "Measurement" to None.


  4. Click Diode block and change all the parameters to 0 and unclick Show measurement port.


  5. Click Scope > File and set the Number of Input Ports > More... > Number of input ports: change to 4.


  6. Click Mean blocks and change the parameter "Fundamental frequency (Hz):" to 50. Other parameters change to 0.


  7. Click RMS blocks and change the parameters "Fundamental frequency (Hz):" to 50, "Initial RMS value:" to 240, "Sample time:" to 0, and click True RMS value.


  8. Click AC Voltage Source block and change the parameters "Peak amplitude (V):" to 240*sqrt(2), "Phase (deg:)" to 0, "Frequency (Hz):" to 50, "Sample time:" to 0 and "Measurement" to None.


  9. After setting all the parameters, change Stop Time to 2 and run the simulation.

  10. Click Scope block to shows the result of waveform  $I_{o,rms}$, $V_{o,rms}$, $V_{s,rms}$, and $V_{d}$.


  11. Display shows the result of $I_{o,avg}$, $V_{o,avg}$, $P_{o,avg}$, $I_{o,rms}$, $V_{o,rms}$, $P_{o,rms}$,  and $pf$.



Discussion
  1. The value of parameters for theory and simulation are almost equal.
  2. The waveform generated from the simulation is identical to the theory waveform.
Conclusion
The objection of this experiment is to compare the theory and simulation in terms of parameters value and waveform.  The result shows that the value of the parameter of the theory is almost equal to simulation; the same goes for the waveform. Hence, the experiments were held successfully.

Video:

That all from me. If you have any suggestions, please write in the comment section. Thank you for your time 👷.





Sunday, June 20, 2021

How to Interface Buzzer Speaker Sounder with Arduino in Proteus 8 | toneMelody

Hi guys, today I want to share how to interface buzzer or speaker or sounder with Arduino UNO in Proteus 8. Buzzer usually contains a built-in oscillation circuit to generate sound/tone by applying voltage. On the other hand, the sounder is driven by an audio waveform and requires additional circuitry to generate a sound. Finally, a speaker is a device used to reproduce sound from an AC voltage with the sound going out similar to sound going and require additional circuitry. This simulation plays a little melody you may have heard before.


Buzzer/Speaker/SounderApplications:

  • Alarm
  • Telephone
  • Toys
  • Computer
  • Car
  • Indicator
  • Etc

Steps (Buzzer):
  1. Open Proteus and add Arduino UNO R3 and buzzer to the workspace.


  2. Connect digital pin 8 to a buzzer top pin and another pin to the ground.


  3. Select buzzer and right-click > Edit Properties. Under 'Operating Voltage:' and 'Load Resistance:' change to 5V and 100.


  4. Open Arduino software and go to File > Examples > Digital> toneMelody. Verify the sketch and copy the Hex file, then paste it into the Project file Arduino board.


  5. Start the simulation, and the buzzer generates some tone melody.


Steps (Speaker):
  1. Add speaker to the workspace.


  2. Connect digital pin 8 to a speaker top pin and another pin to the ground.


  3. Open Arduino software and go to File > Examples > Digital> toneMelody. Verify the sketch and copy the Hex file, then paste it into the Project file Arduino board.


  4. Start the simulation, and the speaker generates some tone melody.


Steps (Sounder):
  1. Add sounder to the workspace.



  2. Connect digital pin 8 to a speaker top pin and another pin to the ground.


  3. Open Arduino software and go to File > Examples > Digital> toneMelody. Verify the sketch and copy the Hex file, then paste it into the Project file Arduino board.


  4. Start the simulation, and the sounder generates some tone melody.


Video:

That all from me. If you have any suggestion, please write in the comment section. Thank you for your time 👷.



Thursday, June 17, 2021

How to Add Arduino Nano Library to Proteus 8 | Easy | Fast

Hi guys, today I will share how to add the Arduino Nano library in Proteus 8. The Arduino Nano board is similar to the Arduino Nano based on ATmega328 but with a different PCB package (small). The minor difference is no DC power jack and uses a Mini-B USB cable instead of a standard one.


Specifications:

  • Microcontroller: ATmega328
  • Operating Voltage: 5V
  • Input Voltage (recommended): 7-12V
  • Digital I/O Pins: 22 (6 of which are PWM)
  • Analog Input Pins: 8
  • DC Current per I/O Pin: 40 mA
  • DC Current for 3.3V Pin: 50 mA
  • Flash Memory: 32 KB, of which 2 KB used by the bootloader
  • SRAM: 2 KB
  • EEPROM: 1 KB
  • Clock Speed: 16 MHz
  • LED_BUILTIN: 13
  • Length: 45 mm
  • Width: 18 mm
  • Weight: 7 g

Steps:
  1. Download the Arduino Nano library file at TheEngineeringProjects.com or click the link HERE. The download link will appear after 20 seconds.

  2. You will find two files on the downloaded zip file, named as:
    -ArduinoNanoTEP.LIB
    -ArduinoNanoTEP.IDX



  3. Extract these two files and place them in the Proteus libraries folder (C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\LIBRARY).

  4. Open your Proteus software and search for the Arduino Nano component. 


  5. Double click and drag to add to the Proteus 8 workspace.


Video:


If you have any suggestion, please write in the comment section. Thank you for your time 👷.

Tuesday, June 15, 2021

How to Add Arduino Nano Footprint PCB Package on Proteus 8 | V2.3 | V3.0

Hi guys, today I will share how to add the Arduino Nano footprint PCB package in Proteus 8. The PCB package is created by me and interface with Arduino Nano from TEP. The dimension of the PCB package is based on Arduino Nano V2.3 and V3.3, as mention in the references.

References:
  • https://www.arduino.cc/en/uploads/Main/ArduinoNanoManual23.pdf
  • https://www.mouser.com/pdfdocs/Gravitech_Arduino_Nano3_0.pdf

Steps:

  1. Download the Arduino Nano PCB package files HERE.

  2. Go to the PCB Layout tab. There are two versions of the PCB package (Arduino Nano R1&R2 and Arduino Nano R3).

  3. Select Arduino Nano PCB and right-click > Make Package.


  4. Type Arduino Nano on the 'New Package Name:' column. Create a new one under the 'Package Category:' column and type PCB. Under the 'Package Type:' column, select Through Hole. For the 'Package Sub-category:' column, create a new and type Header. Then, type 'Dimension is based on Arduino Nano V2.3' at the 'Package Description:' column. Lastly, under 'Save Package To Library:' choose CONNECTORS.


  5. Click OK, and another window pop up > Click OK.

  6. Repeat the same process for another PCB package. Select Arduino Nano R3 PCB and right-click > Make Package.


  7. Type Arduino Nano R3 on the 'New Package Name:' column. Select PCB in the 'Package Category:' column. Under the 'Package Type:' column, select Through Hole. For the 'Package Sub-category:' column, select Header. Then, type 'Dimension is based on Arduino Nano V3.0' at the 'Package Description:' column. Lastly, under 'Save Package To Library:' choose CONNECTORS.


  8. Click OK, and another window pop up > Click OK.

  9. Next, go to the Schematic Capture tab and add Arduino Nano and Arduino Nano R3 components to the workspace. Then, right-click on the Arduino Nano component and select the Packaging tool.


  10. Click Add > PCB > ARDUINO NANO and press OK.


  11. Change the pin number (A) as in the table. Then Click Assign Package(s) > ArduinoNanoTEP > Save Package(s) and another window pop out > Click Yes.


  12. Double click Arduino Nano Component > PCB Package: > ARDUINO NANO and press OK.


  13. Repeat the same process for another PCB package. Right-click on the Arduino Nano R3 component and select the Packaging tool.


  14. Click Add > PCB > ARDUINO NANO R3 and press OK.


  15. Change the pin number (A) as in the table. Then Click Assign Package(s) > ArduinoNanoTEP > Save Package(s) and another window pop out > Click Yes.


  16. Double click Arduino Nano R3 Component > PCB Package: > ARDUINO NANO R3 and press OK.


  17. Test adding footprint on PCB Layout tab. Go to PCB Layout > Component Mode and add both footprints.


Video:


That all from me. If you have any suggestion, please write in the comment section. Thank you for your time 👷.

How to Add Ultrasonic Sensor Library to Proteus 8 | HC-SR04 | Generic

Hi guys, today I want to share how to add an ultrasonic sensor library in Proteus 8. The ultrasonic sensor is a device that transmits sound wave to the object and bouncing back to the receiver. In the Arduino world, the ultrasonic sensor HC-SR04 is the best choice due to its cheap and easy interface with the Arduino microcontroller.


Ultrasonic Sensor Applications:

  • Liquid level detection and measurement
  • Radar
  • Box sorting
  • Vehicle detection
  • Robotic sensing
  • Trash level sensing
  • Etc

Steps:
  1. Download the Ultrasonic Sensor library file at TheEngineeringProjects.com or click the link HERE. The download link will appear after 20 seconds.

  2. You will find three files on the downloaded zip file, named as:
    -UltrasonicTEP.IDX
    -UltrasonicTEP.LIB
    -UltrasonicTEP.HEX


  3. Extract these three files and place them in the Proteus libraries folder (C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\LIBRARY).

  4. Open your Proteus software and search for the ultrasonic sensor component. 


  5. Double click and drag to add to the Proteus 8 workspace.


Video:


Thank you for your time. Next post, I will update you on how to use the ultrasonic sensor in Proteus 8.



Sunday, June 13, 2021

How to Replace a Scooter (Motorcycle) Battery | YTX7A-BS | 12 V | SYM Jet Power 125

Today, I want to show you how to replace/change a scooter (SYM Jet Power 125) battery. This scooter uses battery type YTX7A-BS with an approximate 150mm x 87mm x 94mm. The Battery is located at the floor panel, as shown in the figure:


References:
  1. SYM Jet 4 125 Manual

Step 1: Removal of Battery
  1. Remove the battery cover by unscrewing the 4 screws on the battery cover.

  2. Unscrew 2 screws on the battery terminal cover and remove the battery terminal cover.
  3. The red cable indicates a positive (+) cable, and the black cable indicates a negative (-) cable. At first, unscrew and remove the negative (-) cable. After that, unscrew and remove the positive (+) cable.
  4. Remove the Battery. For the replacement battery, I used battery type YTX7A-BS. If you buy a new battery, it usually includes nuts and screws.
Step 2: Installation of Battery
  1. Install the Battery in the reverse step of removal. Noted: for safety reasons install positive (+) cable/terminal then negative (-) cable/terminal.

The link tools and components replacement I used in this video are listed below:

Tools/Components/Items (Shopee):

  1. Battery (YTX7A-BS)
  2. Battery (Nut & Screw)
  3. Screwdriver Set
Tools/Components/Items (Lazada):
  1. Battery (YTX7A-BS)
  2. Battery (Nut & Screw)
  3. Screwdriver Set
Tools/Components/Items (Aliexpress):
  1. Battery (Nut & Screw)
  2. Screwdriver Set
Specifications:
  • Brand: YOSHIPOWER
  • Battery Type: YTX7A-BS, Maintenance Free
  • Voltage: 12
  • Capacity (AH): 6
Video:


That all from me. If you have any suggestions, please write in the comment section. Thank you for your time 👷.