Monday, September 22, 2025

LED Fluorescent Tube Replacement

 The once ubiquitous fluorescent light tubes are gradually being replaced by the LED light.  The once popular compact fluorescent bulbs are already near extinct.  Two of my 3' fluorescent tubes are not working right: they do not light up fully.  They are the F30T12 rapid start type (30W, 1.5" diameter).   The ballast is rated at 120V 0.65A and has eight wires: white and black for neural and live AC input, two tubes share one pair of yellow wires and one pair of red and blue go to the other end of the tubes with the so-call "tombstone" holders.  While I'm not sure if the tubes are or the electronic ballast are bad (I do suspect the ballast since the tubes work sometimes), replacing with LED tubes is less expensive than getting new ballast or fluorescent tubes.  

An 18W T8 (1" diameter) LED tube costs about $7 (at quantities of a pack of 4); it can be installed plug-and-play (Type A) or with the ballast removed (Type B).  It is rated at 100-277V 0.18A.  It claims 45W equivalent and 2520lm 6000K, which would imply 140lm/W, a little high (as a comparison, a Philips 18W puts out 2000lm 6500K). The tube is made of two rows of LEDs, total 120 individual LEDs (laid out on a PCB with groups of 5 in parallel).  The back side is aluminum, where the LED PCB is mounted on, and the front is transparent plastic cover (not frosted).  The two pins at each end are shorted.  The tubes work when plugged into the existing fixture without modification, but I could notice some flickering and humming of the ballast.  There was a slight delay for the LEDs to turn on when starting cold; once warmed up, it started instantly.  When I measured the input current, I was surprised that it read 0.9A (that is over 100W), not only it exceeded the LEDs current by a lot (should be less than 0.4A) and but also more than the ballast rating.  Also the ballast seemed to fail completely after a few times.  I definitely need to try bypassing the ballast, which is straightforward.  Each LED tube draws only 0.135A, 16W (measured by the multimeter and the power meter); it is much better without the ballast: instant start, no humming and lower power (reduction of more than 50% with at least similar brightness if not brighter).

The common electronic ballast circuit is a resonant half bridge with a capacitor bypass.  Initially the current flows through this capacitor and heats up the filament; a higher strike voltage is generated to start arc discharge through the tube.  Afterwards the current through the bypass capacitor and the filament is reduced and the voltage across the tube is also lowered. A transformer feedback sustains the oscillation, which is over 10KHz. Some include power factor correction. The question is how the LED tube is able to tolerate the high voltage from the ballast.  One possibility is that it has a low-pass filter to attenuate the high-frequency voltage.

When I took down the ballast, it felt rather heavy, 3.5 lbs.  I realized that it is not an electronic ballast; it is the magnetic type.  The ballast is over 30 years old (possibly manufacture in 1991 based on a marking on the ballast). The inductance measurements are: black-white 390mH (10Ohms), yellow 47uH (0.4Ohm), blue 48uH (0.4Ohm), red 109uH (0.4Ohm).  The coils provide heating to the cathode.  The coils appear DC isolated.  When 120V AC is applied to black-white, about 4V AC on each coils, across yellow and blue is 226V and yellow and red is 5V (something seems faulty here).  Between blue and red is 1.4H, yellow and blue is 1H, yellow and red no inductance.  So there is an additional coil that is connected through capacitors; it functions like autotransformer to generate the high voltage.  So I suspect a broken capacitor.  Unfortunately, the ballast is completely potted.


Another question is, does a Type A only LED tube work without a ballast?  Testing confirms it does not work.  This is because this type of LED tube requires higher voltage provided by the ballast.  Other explanations out there make no sense. 

Friday, September 19, 2025

NVMe Speed Test

 The computer peripheral bus is eventually settled on PCIe and one small form factor expansion card is M.2 which provides up to 4 PCI express lane.   NVMe SSDs are now widely used and getting inexpensive.  Coming in size 2280/60/42/30.  M Key.


- Patriot Memory P310 NVMe PCIe M.2 Gen 3 x4 480GB $29.49 (6 cents/GB) 11/24

- Patriot Memory P310 NVMe PCIe M.2 Gen 3 x4 240GB $18.99 (8 cents/GB) 10/24

- Western Digital WD Blue Gen 3 x4 M.2 2280 500GB $49.99 (10 cents/GB) 6/22

- Lexar E-series 64GB Micro SD 100MB/s U3, A1,  $6.13 (10 cents/GB) each (for a pack of 3) in 10/24, 

- UGREEN 10Gbps M.2 NVME to USB3.3 Gen 2 $15.99 in 11/24

- ORICO M.2 NVMe USB3.1 Gen 2 (10Gbps) $18.99 in 6/22


ORICO + Patriot 480GB + Macbook Pro Linux

gnome-disks benchmark, 100MB 100 Samples
Average Read 458.4 MB/s
Average Write 417.6 MB/s
Average Access time 0.22 msec

dd if=/dev/zero of=/media/davex/Pat480G/dump.bin bs=1G count=100 status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 1696.78 s, 63.3 MB/s

dd of=/dev/null if=/media/davex/Pat480G/dump.bin bs=1G count=100 status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 242.579 s, 443 MB/s


UGREEN + Patriot 480GB + Macbook Pro Linux

exFAT

dd if=/dev/zero of=/media/davex/PAT480GXFAT/dump.bin bs=100M count=4K status=progress
429496729600 bytes (429 GB, 400 GiB) copied, 956.569 s, 449 MB/s

sudo dd if=/dev/sdd of=/dev/null bs=100M count=4K status=progress
429496729600 bytes (429 GB, 400 GiB) copied, 974.971 s, 441 MB/s

UGREEN + Patriot 480GB + PC Windows 10

exFAT

winsat disk -drive d
> Disk  Random 16.0 Read                       215.03 MB/s          7.8
> Disk  Sequential 64.0 Read                   642.06 MB/s          8.2
> Disk  Sequential 64.0 Write                  661.92 MB/s          8.2
> Average Read Time with Sequential Writes     0.190 ms          8.6
> Latency: 95th Percentile                     0.321 ms          8.8
> Latency: Maximum                             0.610 ms          8.9
> Average Read Time with Random Writes         0.192 ms          8.9

UGREEN + Patriot 240GB + Macbook Pro 

gnome-disks benchmark, 100MB 100 Samples
Average Read 458.5 MB/s
Average Write 420.8 MB/s
Average Access time 0.08 msec

dd if=/dev/zero of=/media/davex/Pat240G/dump.bin bs=1G count=100 status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 718.181 s, 150 MB/s

dd of=/dev/null if=/media/davex/Pat240G/dump.bin bs=1G count=100 status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 242.159 s, 443 MB/s


ORICO + Patriot 240GB + Macbook Pro Linux

NTFS

dd if=/dev/zero of=/media/davex/Pat240G/dump2.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 811.527 s, 132 MB/s

ext4

sudo dd if=/dev/zero of=/media/davex/Pat240G/dump.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 240.032 s, 447 MB/s

tr '\0' '\377' < /dev/zero | sudo dd of=/media/davex/Pat240G/dump2.bin bs=100M count=1K status=progress iflag=fullblock
107374182400 bytes (107 GB, 100 GiB) copied, 261.163 s, 411 MB/s

sudo dd if=/dev/random of=/media/davex/Pat240G/dump2.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 429.978 s, 250 MB/s

exFAT

dd if=/dev/zero of=/media/davex/PAT240GXFAT/dump2.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 250.026 s, 429 MB/s

dd if=/media/davex/Pat480G/Lux2e/Lux2e.vdi of=/media/davex/PAT240GXFAT/Lux2e/Lux2e.vdi bs=100M status=progress
124962996224 bytes (125 GB, 116 GiB) copied, 422.505 s, 296 MB/s

UGREEN + Patriot 240GB + Raspberry Pi 5

exFAT

dd if=/dev/zero of=/media/davex/PAT240GXFAT/dump2.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 415.082 s, 259 MB/s

dd of=/dev/null of=/media/davex/PAT240GXFAT/Lux2e/Lux2e.vdi bs=100M count=1K status=progress
124962996224 bytes (125 GB, 116 GiB) copied, 327.183 s, 382 MB/s

Patriot 240GB + Raspberry Pi 5 (nvme)

exFAT

dd if=/dev/zero of=/media/davex/PAT240GXFAT/dump2.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 297.226 s,  361 MB/s

dd of=/dev/null of=/media/davex/PAT240GXFAT/Lux2e/Lux2e.vdi bs=100M count=1K status=progress
124962996224 bytes (125 GB, 116 GiB) copied, 278.538 s, 449 MB/s


UGREEN + Patriot 240GB + Jetson Nano

exFAT

dd if=/media/davez/PAT240GXFAT/Lux2e/Lux2e.vdi of=/dev/null bs=100M status=progress
124970336256 bytes (125 GB, 116 GiB) copied, 561.616 s, 223 MB/s

dd of=/media/davez/PAT240GXFAT/dump.bin if=/dev/zero bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 1405.02 s, 76.4 MB/s


UGREEN + WD 500GB + Macbook Pro 

ext4

gnome-disks benchmark, 100MB 100 Samples
Average Read 456.6 MB/s
Average Write 329.8 MB/s   (start off at 420 MB/s , drop to 260 MB/s after half way)
Average Access time 0.21 msec

sudo dd if=/dev/zero of=/media/davex/SYSTEM/dump.bin bs=100M count=1K status=progress
107374182400 bytes (107 GB, 100 GiB) copied, 401.139 s, 268 MB/s


WD 500GB + Raspberry Pi 5 (nvme)

ext4

sudo dd if=/dev/zero of=/media/davez/SYSTEM/dump.bin bs=100M count=1000 status=progress
104857600000 bytes (105 GB, 98 GiB) copied, 321.092 s, 327 MB/s

sudo dd of=/dev/null if=/media/davez/SYSTEM/dump.bin bs=100M status=progress
104857600000 bytes (105 GB, 98 GiB) copied, 116.73 s, 898 MB/s


The file format block size has a significant effect on the speed; it is a tradeoff between the speed and disk space utilization.

Thursday, September 11, 2025

Quotes

"My Favorite Programming Language is Solder."
- Steve Ciarcia
Also atrributed to Bob Pease, Terry Pratchett, and others 
  
"Every year there are 200,000 Chinese engineering graduates, and they don’t know what we know. We can solve problems they cannot.” 
- Robert A. Pease, Analog Circuits: World Class Designs, 2008
 
"... there's no patent on intellectual capability."
- Jim Williams, Interview with Bob Dobkin and Jim Williams April 19, 2006
Silicon Genesis: Oral Histories of Semiconductor Technology
 
"I may be the only person at an electronics flea market who will pay more for the busted stuff!"
- Jim Williams, The Importance of Fixing,  
The Art and Science of Analog Circuit Design

"No one believes an analysis – except the person who did it.
Everyone believes a test – except the person who did it."
- ???

‘‘The best way to predict the future is to invent it.’’
 - Alan Kay

"... true knowledge can only be acquired piecemeal, by the patient interrogation of nature."
- Edmund Whittaker, A History of the Theories of Aether and Electricity

“Successful engineering is all about understanding how things break or fail.”
- Henry Petroski

"All science is either physics or stamp collecting."
- Ernest Rutherford

"The first time you go through the subject, you do not understand it at all. The second time, you think you understand it, except for one or two small points. The third time, you know that you do not understand it, but you are so used to the subject that it does not bother you anymore."
- Arnold Sommerfeld, about thermodynamics

"those who can, do; those who can't, teach."
George Bernard Shaw, Man and Superman

"engineering ... is the art of doing that well with one dollar, which any bungler can do with two after a fashion."
- Arthur M. Wellingtony, The Economic Theory of the Location of Railways

"Engineer - the man who can do for a reasonable cost what another would expend a fortune on"
- Rutherford Aris, Vector, Tensors and the Basic Equations of Fluid Mechanics 

“In God we trust. All others bring data.”
- Bo Lojek, History of Semiconductor Engineering

"Research is when you don't know what you're doing."
- ??? 

The cheapest, fastest, and most reliable components are those that aren’t there.
- C. Gordon Bell

"When you test you find something is wrong."
- Donald Trump (May 14, 2020, about the COVID tests)

I would rather have a general who was lucky than one who was good.

- Napoleon Bonaparte

"Perfect is the Enemy of Good Enough"
- Eric Johns (October 1988), U.S. Naval Institute Proceedings: 37

“If an expert says something can be done he is probably correct, but if he says it is impossible then consider getting another opinion.”
- Richard Hamming, The Art of Doing Science and Engineering 

People who are really serious about software should make their own hardware.
- Alan Kay

The management question, therefore, is not whether to build a pilot system and throw it away. You will do that. […] Hence plan to throw one away; you will, anyhow.
- Brooks, The Mythical Man Month (Page 116)

Brooks's Law: 
Adding manpower to a late software project makes it later.
 - Brooks, The Mythical Man Month

... this was going to be one of these Onion Syndrome deals - you peel off a couple layers, and cry; then you peel off a couple more layers, and cry some more.
- Bob Pease, What's All This Ground Noise Stuff, Anyhow?

Thinking is recommended. Heck, thinking is required.
- Bob Pease, Troubleshooting Analog Circuits

... a little known tenet of precision op amp circuits: Williams's Rule.  Williams's Rule is simple: always invert (except when you can't).
- Jim Williams, Analog Circuit Design: Art, Science, and Personalities


"Any idiot can count to ONE ..."
- Quoted by Samuel Wilensky in Analog Circuit Design: Art, Science, and Personalities
(maybe attributed to Bob Wildar)

Anyone can build a bridge that stands up, but only an engineer can build a bridge that just barely stands up.
- ????

In real estate, it is location, location, location.  In mathematics, it is notation, notation, notation.
- ????

"A user interface is like a joke – if you have to explain it, it's not that good."
- ????
 
In software, debugging is harder than writing code.  If you write the code as clever as you can, then you are not smart enough to debug it.
- ????

... where there is no confusion there is no prestige.
-Linderholm, Mathematics Made Difficult

All problems in computer science can be solved by another level of indirection, except for the problem of too many layers of indirection.
-????

... practicing what was called "the mushroom theory of management." ... defined it as follows: "Put 'em in the dark, feed 'em shit, and watch 'em grow."
- Tracy Kidder, The Soul of A New Machine

Hardware eventually fails. Software eventually works.
-Michael Hartung