Scheduling Linux laptop to suspend and re-animate at scheduled time.

I recently created an automate script which search the internet for certain items and email me the search results. It’s currently running on HP Probook and I don’t want to leave the laptop running indefinitely.

So, I created a cron job to run this script to automatically suspend the laptop when there are no interactive user using the system. The script use rtcwake command to suspend the system in memory and it seemed to work pretty nicely.

To use this script, login as root and saving the following to a file /root/scripts/hybernate

if [ $# -gt 0 ]; then

# Put the laptop to sleep, if no interactive login and wake up later
if [ `who | wc -l` -eq 0 ]; then
/usr/sbin/rtcwake -m mem -s $SLEEP_DURATION

Change the script permissions:

chmod 755 /root/scripts/hybernate

Then add the following line to root crontabs:

# m h dom mon dow command
* * * * * /root/scripts/hybernate 1800 2>/dev/null


Making a simple crystal tester

Remember from my previous post in Restoring Heathkit IT-17 tube tester? Where I mentioned that I got a box of tubes for $20 buck!

Well, under this pile of tubes there are bunches these little crystal modules that was made for WWII radios communication equipment.

I wanted to get rid of them on ebay but I need some way of assuring that they are working and the frequency is still as accurate as marked before I list them.

After some research on Internet, I found couple of plans which can be build quite easily. I wanted to make some modification to the circuit to use 2N3904 since I have bunches of them on hand. After fiddling with it for a while in LTSpice, I got a working circuit.

I then use KiCAD to draw the circuit and create a PCB layout from it and here is the final circuit and PCB:

crystal_tester_plot PCB

Making the PCB

This time, I wanted to try the toner transfer method to create a polished and professionally looking PCB. However, my stupid Samsung laser printer keep on jamming and it is low in toner. The final laser printed PCB artwork has many flaws and some traces are spotty.

After transferring the toner to the copper clad, I have to manually use the permanent marker to cleanup these traces. After etching the PCB and installing the components, this is what I got.

IMG_9369 IMG_9367

Here the circuit is being used for the first time to test an unknown crystal, the green LED is lid to indicating that the crystal is working perfectly.


One down, plenty more to go. ๐Ÿ™‚


Restoring Heahkit IT-17 Tube Tester

I acquired quite a bit of old test equipments lately and some of them are based on old vacuum tubes. Most of the time during the restoration process, I am able to get them working without the need of the tube tester. So, a tube tester is on my wish list but it’s not a high priority.

Out of a blue, I stumbled up on a Craigslist listing of 10+ test equipments at really good deal. The piece that I am really interested in buying was the Heathkit IT-17, the rest are nice too but I have no use for them at the moment.

The seller listed it pretty early in the morning, so the chance of it still available when I saw the ad was pretty slim. So, I decided contacted him late in the night anyway.

Early next morning, I got a response back and they are still available. I was so elated when I heard the news. I immediately arranged the time to drop by and drove 50+ miles to Oxnard to pick them up. While I was there he also offered to sell me a box of tubes at really good price.

The Heathkit IT-17

The unit was really an ugly duckling and disgustingly dirty when I pull it out of the box. The back cover is dirty and the paint are peeling. The good thing is that the front panel is still in pretty good shape.

IMG_8862 IMG_8856IMG_8763 IMG_8762 IMG_8761 IMG_8760


With the case opened, I quickly examined all the soldering join and looking for burned components. Everything looks good. I went ahead and replaced all bad carbon resistors that are out of tolerance and cleaned all switches and pots with contact cleaner.

I initially followed the IT-3117 instructions, since I can’t find the original IT-17 manual anywhere on the Internet. The only thing I found was the IT-17 schematic and the two are quite similar in design. I proceeded to check the continuity from the switch to all the pins on each socket, they are all good. The filament voltage, however, it is really off and the line test is off-center but the unit is functional.


With the tube tester semi functional, I decided to give it a test run. With a box of unknown condition tubes at hand, I tried to test some of them. After going through 1/4 tubes in the box I got 2/3 of the tubes are bad and 1/3 are good.

With 2/3 bad tubes start piling up, I started to question the tube tester functionality because who would keep a bunches of bad tubes???

Manual Testing

I decided to do manual testing on 6L6 which was tested bad earlier.

  1. Connected pin 2 and 7 to external power supply the filament is glowing nicely at 6.3 DC. So, the filament is fine.
  2. When connected to the socket on the test tube. The filament is not glowing at all, 0V is measured between 2 and 7.
  3. When 6L6 is not installed, there is 6.3V between pin 2 and 7.
  4. I decided to plug 6L6 tube back in and use the alligator jumper wire and connect pin 2 and 7 to corresponding wire on the switch bank. The filament start glowing nicely. This confirm the socket is making clean contact, but the wiring is possibly bad.
  5. Measuring the resistant from the switch to pin 2, the wire has 50+ Ohm?? Note to self – Don’t trust the continuity beep!!!
  6. After some tracing, it appears that the original builder missed one solder join on one of socket. After fixing that the 6L6 filament start glowing again and the tube tested fine now.

Calibrating Tube Tester

All original instructions assumed that all parts are new and working to spec. So, some of these assumptions are no longer valid since the meter is old and not that accurate. This is true at least in my case, when the meter is zeroed, the reading are way off.

I have to come up with alternative way of calibrating it and ensuring that the tube tester result are some what usable.

Calibrating Line Test Indicator

  1. With no tube in any of the socket
  2. Set all switch to center position, then set A to bottom
  3. Set the filament to 110
  4. Connect a voltmeter black lead on pin 1 and connect red lead on any other pin so we can read the filament voltage. This is important, since the during line voltage adjustment, the meter is connected to 110V tap on the filament winding. At 110V the meter should be reading 50 or .5mA. If not check the 1K and 75K resistor and make sure they are within tolerance.
  5. Turn set line until the filament voltage reading is 110V RMS. Cut a piece of electrical tape in triangle shape and tape it to set line dial to mark this position. This is the correct line voltage for use with the tube tester.
  6. When set line voltage is properly adjusted, the filament voltage reading should be 110V. At this point the meter should be reading exactly 50 or .5mA. This is assuming that the 1K, 75K and your meter are good. If 1K and 75K are good but the meter is not at 50, the meter reading is off. In that case,insert an amp meter in series with the panel meter to get the correct reading, it should be around .5mA. Then adjust the panel meter so that it’s indicating the same reading by turning the zero adjust screw on the panel meter. Once that is done, your set line switch and meter is properly calibrated to show proper line voltage. NOTE don’t adjust the mechanical zero from now on it will screw up the reading.
  7. Next insert a known good tube and set the tube tester accordingly. Then the plate control is adjusted so that the meter is reading from 0 to 100, the measured value from amp meter still inserted in series with the panel meter is recorded at each point to produce a table and chart.
  8. From now on, after testing using the original instructions. Take the reading and use the table to map it to actual value in mA or multiply that by 100 to get % scale.


If you find this information helpful and would like to see more. Please support my future project.

Building a simple Programmer for ATMEGA8

Woke up pretty late this morning and feeling bored, so I wasted an hour this morning building a simple in circuit serial programming interface for use with the PonyProg software to program the ATMEGA8 micro-controller.

I intended to use this programmer for ATMEGA8 micro-controller which I recently bough from eBay. For now, I need to create the interface and do some testing with PonyProg to see how it goes.

The circuit that I used is based on one published here which is based on one published on here with some minor modification.

It’s quite simple to build but the challenging part is fitting it in DB-9 hood.


IMG_0164 IMG_0163IMG_0165



Handmade 8K Static RAM for Commodore VIC 20

Today I spent sometime cleaning up and reorganizing the garage. I accidentally unearthed an old artifacts which brought back many good memories of my early computing years.

As pictured, the 8K static RAM expansion adapter was made from 4 x 6116 (2K x 8 ) statics memory chip for my Commodore VIC 20. It was my personal home PC back then, before moving to C64, Amiga 500 and finally PC Clone. ๐Ÿ™‚

I recalled that I spend one weekend morning during my high school year, wiring them all up using point to point wiring technique. These memory chips were quite expensive back then. I’ve to beg for more allowance and saved just enough to able to buy those chips and related parts.

As you can see, I didn’t use wire wrapping sockets just to keep the down cost.


Now with the additional whopping 8K RAM, the possibility are endless. ๐Ÿ™‚

I recalled spending endless hours entering thousand lines of hex codes each month for new games and programs published in printed magazine article.

Restoring ESI 250DA Impedance Bridge

Recently, my wife and I started attending the swap meet at TRW parking lot in El Segundo California regularly on every last Saturday of the month. This is one of the things that we enjoy doing in the morning before we heading to Hong Long restaurant.

On this particular morning we spotted an ESI-250DA impedance bridge made in the 60’s from one of the vendor. I decided to make inquiry of the price and he was asking $20 for it, but the item has rust from water damage and missing the null indicator tube.ย  I was not willing to pay so much for it, so I made a final offer of $10 for the thing in part trying to give him some business. He agreed and now I am a proud owner of 1960 old relic.

Normally I don’t buy stuff in such a sad condition. However I hate seeing useful instrument going to the land fill and also this will keep my mind busy for awhile.

Day 1

I brought the unit home and open it up. The top part of the interior are okay, luckily no rust there. The bottom section however has large amount rust deposited at the bottom. Luckily the key components like standard capacitor, resistors and switches are in decent condition.

The first priority is to remove the rust on the transformer and the chassis. I didn’t bother to remove the rust on the case until the very end.

Day 2

Cleaned all the contacts and switches with contact cleaner and oiled the switches.

Day 3

Inspected all the capacitors and they are all bad and need to be replaced.

I went a head and replaced with all electrolytic capacitors with near equivalent, since exact replacement is impossible to find. As long as they are still within the original specified tolerance it should be okay.

img_0005 img_0003 img_0001

img_0019 img_0018

Day 4

There were a huge amount of white stuff deposited on the Selenium Diodes. So, I decided to replace them with Silicon diodes instead since, they are so old will fail anytime now.


Turned the unit on and the 150 Ohm resistor in the power supply section started smoking. I quickly turned it off but the damage was done.

Day 5

Replaced the 150 Ohms with 390 Ohm 5W and replaced 2.2K with 2.2K 5W resistor as shown below. When replacing selenium diode with a silicon diode, it is commonly recommended to use 300 Ohms or more in series with silicon diode to limit the surge current.


Turn the unit on and everything seem to be okay and the tubes filament start glowing amber. ๐Ÿ™‚

Attempted to measure some resistors, however the needle would not budge.

Day 6

Dissembled the galvanometer to take a look inside. The meter resistant tested fine, however the needle was frozen solid.

Wasted 1/2 hours tapping the tube to loosen the rusted innards. Finally got the pieces separated, the interior were badly rusted and huge amount ofย  metallic dust stuck on the magnet.

I carefully disassembled the magnet and gently clean up the coil and removed as much rust as I can. As seen below some rust still remain, I don’t want to clean it up too much since it’s very delicate and held together in place by a thin wires.

Finally sprayed some WD-40 on the part to remove any remaining rust.

img_0010a img_0009a img_0007a img_0006a

Here is the galvanometer cleaned and reassembled.


I reinstall the galvanometer and did some resistance measurement and the null meter seemed to work now.

Day 7

Did another series of checks to confirm the standard resistors and capacitors. All checked out okay and very close to specified values.


Once the above check was completed, I wanted to confirm the accuracy of Rx1 and Rx10 measurement. Did another series of resistance measurement, all are very close to what I am getting from a digital multimeter.

At this stage I have to stop working on it, since I can’t test inductor or capacitor with it because the 6U5 null indicator tube was missing. I found some used replacement tube but they are quite expensive on eBay.

More treasure hunting…

Day 8

Must be my lucky day, I found a 6E5 tube and another magic eye tube with no marking on it. The 6E5 tube that I got, it has bulging shape so it won’t fit into ESI-250DA.

After some Googling the unmarked tube could be a 6U5 or 6E5, which will fit it is a straight tube nicely. Since both tubes specs are quite similar, I guess it won’t hurt just to try it out. After some cleaning, I inserted the tube and turn on the unit. The magic eye start producing a nice green glow. Kinda exciting watching it actually.

img_0011 img_0010

Did another series of capacitance and inductance measurement and every thing seem near the ball park.

Day 9

Spend the morning adjusting the rheostats on D-Q dials to what specified in the service manual.


Day 10

A fully function unit

img_0013 img_0009

Misc photos

img_0021 img_0014 img_0015 img_0011 img_0009

If you find this information helpful and would like to see more. Please supportย  my future project.

%d bloggers like this: