#!/usr/bin/perl -w use strict; use warnings FATAL => 'all'; # # http://www.kpsec.freeuk.com/powersup.htm # # Smoothing capacitor for 10% ripple, # # 5 * Io # C = ----------- # Vs * f # # C = smoothing capacitance in farads (F) # Io = output current from the supply in amps (A) # Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC # f = frequency of the AC supply in hertz (Hz), 50Hz in the UK # my $current = shift || die 'Missing current'; my $voltage = shift || die 'Missing voltage'; printf "\nCurrent: %2s A\nVoltage: %2s V\n\n\nApproximate 10%% ripple electrolytic capacitor value:\n\n%.1f uF\n\n", $current, $voltage, (5 * $current) / ($voltage * 50) * 1000000;