Fixing a Watchman Plus Oil Level Monitor

After the recent round of enjoyable bass guitar fettling a much more mundane thing needed fixing.

The little gadget in the pic is the monitor unit for a Watchman Plus domestic heating oil tank level monitor. This is a little module that looks something like a wall-wart mains power supply. On the top is an antenna that communicates to a sensor unit that is buried inside a domestic heating oil tank reporting back the oil level.

This is quite an old and obsolete model now, but it has worked perfectly for years until this summer when it started periodically losing the tank signal (the little red led at the bottom right flashes and the display indicates “r”).

Step one was replacing the battery pack in the tank transmitter as it was at least 5 years old and that is around the usual battery life. This was quite fiddly and awkward to do as the pack was buried in between the inner and outer shells of the tank and could only be reached blind at arm’s length. The results were promising at first, but after a few hours the signal was being lost again. Very annoying!

Especially annoying since the transmitter battery pack was about £331 and I really didn’t want to fail to fix it having spent that much.

Time to get dismantling! The pic on the left is the circuit board after I had extracted it from the plastic case by levering the case open2.

Now what?

Fortunately, I have a superpower3. My first career was in Electronics design and I specialised in embedded systems. What that means is that I can look at a gadget like this and work out enough about it to deduce how it works and stand a good chance of fixing it as long as it isn’t completely toasted.

The first thing that struck me was that there was no mains transformer or evidence of a switch-mode power supply. Oh, oh – that means a capacitive reactance voltage dropper … which also means the circuit is live to mains with no isolation. That makes the board pretty dangerous to work on and hard to test as there is no simple way of getting a ground reference to measure things4. My thought was to try and trace the power supply part of the circuit and see if I could reason about the fault based on the failure modes I was seeing5.

This is the power supply circuit:

Because the circuit is mostly surface-mount it is pretty hard to work out the values of some of the components, or even what kind of components they are. That is where the professional experience comes in – I know what type most surface-mount components are just by the look of them and I can reason out what the mystery ones are based on how the circuit must work6. There are various capacitors that have mystery values, but they are not important in determining how the circuit works.

The key component in this circuit is C1, a 330nF mains rated (X2) capacitor. In normal operation this presents a capacitive reactance of around 10k7 at 50Hz meaning that very roughly 24mA flows through it and is split between the zener diodes and the current drawn by the circuit through the 5V voltage regulator. That is pretty consistent with the PIC microcontroller and a 433MHz receiver module – I’d bet they take 10mA-ish @ 5V.

So far, so good. I’d already had a bit of a google for failures of these oil monitor units and I found a link8 suggesting that the mains rated capacitor can fail. This was enough of a clue that I went looking for failure modes of mains rated metal film capacitors. They couldn’t be failing open-circuit as the unit still worked intermittently, nor could they be failing short-circuit as this would cause a large over-current and blow the unit to bits.

It turns out that the clue is in the “X2” rating which means that the capacitor can survive over-voltages and is safe to connect directly across the mains between Live and Neutral. The way it survives these over-voltages is by self-healing, which crudely means that if the insulation between the capacitive plates fails, the current that flows vaporises the metal film immediately around the failure. This cunningly clears the short-circuit and the capacitor continues operating. Sneaky.

However, there is a snag. If this happens often enough, quite a lot of the metal plate material can be lost resulting in the capacitance value getting smaller as time goes on. If this happened the capacitive reactance would rise, and if the capacitance got too low there would not be enough current flowing for the voltage regulator to work properly if the mains voltage dropped slightly – the 5V would dip9 and cause the microcontroller to reset. This was exactly what I was seeing happen.

So, enough theory – let’s remove the 330nF capacitor and see what it measures…

…and there we have it, 0.177uF10 – just over half the proper value. That capacitor is stuffed!

The rest is routine – buy and solder in a new 330nF X2-rated capacitor (22.5mm radial pitch, costs 29p from RS components), stick the case back together and the monitor is repaired.

I tested it in situ and it ran happily indicating the tank level for a weekend without resetting or doing weird things.




(See here for someone else who found the same problem in a little mains timeclock and made an interesting video about it.)

Fixing my Yamaha BB1100s Bass (Part 2)

This is the part 2 of resuscitating my old Yam bass that was in a rather filthy and corroded state.

So, because I’m not quite as exacting with my own guitars as I would be with someone else’s and only had a few hours to get this thing playable again, I took a shortcut in cleaning the frets. If I was being thorough I would have taken the neck off, adjusted the truss rod until the neck was dead straight, checked all the frets for levelness1. Then (probably) skimmed them with a levelling beam, re-crowned all the frets, masked the fingerboard with masking tape and polished the frets using wet&dry sandpaper in progressive grits from 400 to 2500, then micromesh and metal polish until I could see my face in the frets. Then cleaned and oiled the fingerboard.

It would have been lovely… but this takes about 3 hours to do properly and I didn’t have time. Pragmatism rules – so off came the strings and I used a metal fingerboard protector and polished a fret at a time with 1200 grit wet&dry. Then cleaned up the fingerboard with naptha2 to get the worst of the gunk off – and voila, the picture shows the result. It’s not perfection, but it’s easily good enough to play again3.


Next step is to restring it and get the neck relief sorted out.

The pic shows the truss rod adjustment with the neck screws slackened and the neck tilted up. It’s a M6 threaded truss rod with a buried nut in the neck heel that takes an 8mm socket. Theoretically this should be easy to adjust given the right tool – practically, it is a bitch because the rod sticks out of the nut a long way so it needs a (slightly) special tool that comes with the bass …but I never had this tool.

I had bought an 8mm truss rod socket tool to do the job, but it wasn’t deep enough until I drilled it out on a bench drill. That fitted, but only when the neck was tilted out of the pocket – hence the picture. That sucker took some cranking to flatten the neck, probably a turn or so by the time I had finished getting the relief down to 13thou4.

The rest of the action setup was pretty straightforward, I went with the Fender P/J-Bass “standard” numbers of 5/64in5 on all strings at the 17th fret. The first fret action was 20 – 22thou6 which is pretty much perfect, so the nut didn’t need touching.

So that was the basic playability sorted, light-ish, but nothing buzzes at my level of fumbling7. Result.

Next step – plug it in and make a noise … ouch! Not so good.


Snap, crackle and pop! The controls were very noisy so I had the back control plate off and squirted contact cleaner into everything and twisted the pots back and forth to clean all the dust and gunge out. That fixed it.

This is actually a switchable active / passive bass, but I prefer the passive sound so I didn’t bother putting a battery in and testing the active circuit. It worked last time I used it.

I’m not completely convinced the jack is making the best contact possible, so that may need to be replaced at some point. It’s OK for now though. Switchcraft replacements are about a tenner via Allparts.


The last problem was the tuning machine heads were really loose and prone to slip. These are special Yam tuners with friction tension collars that can be adjusted to set the “stiffness” of the tuners. As usual, these need a special tool to adjust …which I never had.

This tool is like gold-dust, people are always asking where to get them from on the vintage Yamaha discussion groups, but they can’t be bought so the only solution for me is to bodge it8. Molegrips with a bit of thin rubber on the jaws to avoid chewing the collar up was the dirty solution. Job done.


…and she plays a treat! Bassy goodness all round.

I’ve got a new set of strings to put on, the 45-105 round-wounds on there are very dead and a bit manky. I might also polish the frets a bit better and oil the fingerboard when I change them, but there’s no hurry now it plays properly again.


Fixing my Yamaha BB1100s Bass (Part 1)

After a bit of a work-imposed gap in hobby activities, one of my oldest pastimes has reared it’s ugly head again – music. I have been playing guitar and bass guitar for years, never getting very good, but enjoying myself and even playing in the odd band or two over the years. (on Bass)

My one bass, a late 80s Yamaha BB1100s, has been sitting in an unheated warehouse at work for almost 10 years. The poor old thing has been very unloved, which is a shame as it is a really nice instrument. I bought it s/h in preference to a Fender USA Jazz bass or P-Bass as it simply played and sounded better to me. Of course, a Fender of that era would have appreciated in value where my old Yam is more or less worthless9. Bah! I like it anyway.

So, what is wrong with it? Er … look at those frets:

They appear to have gone rather green and the fingerboard is filthy. In fact the whole thing is pretty grubby and rather …sticky. (where did I last play this???)

The neck is also bent like a banana. What should be a small amount of neck relief at maybe 12-14thou10 is more like 40thou11 at the 7th fret so it is clear the truss rod is waaaay out of adjustment. In fact, the playing action is massively high. Did I ever set this thing up? Not sure I even knew how to do that the last time I was playing this seriously. Or did it have uneven frets and buzzed if the action was set to a normal height??? Can’t remember.

So, it’s going to need some serious work to get this old thing playing again. Fortunately, I’ve learned a thing or two about guitar setups since then so I’m not daunted!

To be continued…

Message Notifications using PHP and Pushbullet

I’ve been amusing myself following through an excellent series on self-hosting WordPress by Ashley Rich. Mostly so I can experiment with Nginx, pinch the best ideas and use them myself 🙂

Everything had gone swimmingly on a test VPS running the latest LTS version of Ubuntu, but when I tried to implement some of the ideas on the shared hosting1 where this blog runs I ran into a bit of trouble. I was trying to get WordPress installation checksum verification2 and push messaging via Pushbullet working, but the https connect to the Pushbullet API would always fail. After some experimentation it turned out that the command line version of Curl was ancient3 and it wasn’t going to work. I already knew I was wasting my time asking the hosting company to upgrade the version; I had tried that before with another shell program that was obsolete and they (politely) declined4. So, time to get programming!

I already know that the python version on the hosting is ancient and doesn’t have SSL support at all5, ditto Perl, so I am going to have to use PHP. I won’t have a problem with that as there are versions up to 7.1 on this host and the SSL libraries are properly current too. Command-line PHP isn’t great, but it will work just fine for this application.

Here is the resulting simple program to send a notification using the Pushbullet API. This is called from a Bash script if the WordPress verification checks fail; the resulting warning message turns up on all my registered devices.

* PHP program to send messages to pushbullet.
* Usage: php message-pushbullet.php creds='...' title='...' body='...' [quiet] [headers]
error_reporting (E_ALL);

$url = "";
$type = "note";

if(php_sapi_name() == 'cli'){
    //convert cli params to GET params (chop off name of program which is 1st)
    parse_str(implode('&', array_slice($argv, 1)), $_GET);
//process parameters
$credentials = isset($_GET['creds']) ? trim($_GET['creds']) : "";
$title = isset($_GET['title']) ? trim($_GET['title']) : "";
$body = isset($_GET['body']) ? trim($_GET['body']) : "";
$quiet = isset($_GET['quiet']) ? true : false; //silent mode
$headers = isset($_GET['headers']) ? true : false; //show headers for debugging

if(!$credentials || !$title || !$body){
    echo "Usage: message-pushbullet creds='...' title='...' body='...' [quiet] [headers]\n";

$post_fields = json_encode(compact('type', 'title', 'body'));

$ch = curl_init();

$options = [
    CURLOPT_URL => $url,
    CURLOPT_HTTPHEADER => ['Access-Token: ' . $credentials, 
                            'Content-Type: application/json',
                            'Content-Length: ' . strlen($post_fields)],
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $post_fields,
    CURLOPT_HEADER => $headers,
curl_setopt_array($ch, $options);

$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    echo $result;
//check ok
if($status == 200){
    exit (0);

/* end */

Command-line parameter handling isn’t great as standard, so I cheat and turn them into GET parameters6. This handily means the program would work if used as a web script too with no further effort.

Oddly the API docs specify the parameters as JSON, but the version Ashley Rich created uses standard POST-style variables set using the CURL -d option and this works too. The Pushbullet API talks about maintaining backwards-compatibility to earlier versions, so I suspect there was a pre-JSON version at one time.

Most of the time was spent sorting out the Curl parameters needed 🙂