Think before you leap - Embedded.com

Think before you leap

When you set out to write a program, always question conventional wisdom — the neck you save may be your own!

Swaziland is an absolute monarchy in a rather dry area of Southern Africa. As part of a United Nations project to irrigate sugar cane fields, a dam was built on a river that flowed from Swaziland to Mozambique. Because the water flowed across an international border, there was a bilateral agreement as to how much water was to be released from the dam. The amount to be released was also a function of the inflow to the dam.

In order to measure the water flow, a weir was built consisting of a concrete base with a stepped steel profile set into it. The water level, coupled with the cross sectional area of the weir, together with some hydrological tables determined the water flow. Of course, there were several rivers and streams to be measured. I was contracted to build the microcomputer that measured the water level and transmitted the data, via a repeater station on a nearby hilltop, to the central computer behind the dam wall in the control centre. The outstation was based around the 80C35 (an 8748 minus the EPROM) because — in those days — there were no complete single chip CMOS micros. The repeater was 8748 controlled.


Note the IC superstructure in the middle. National Semiconductor apparently never had access to EPROM technology, so they created the 87P50, which was an 8748 with a piggyback EPROM allowing from 1Kbytes to 4Kbytes to be plugged in.

The central computer (which I also programmed) was based on an Intel Multibus system running an 8085, which displayed the hydrological data on a Lear Siegler “dumb” terminal (all of this took place in the early 1980s).

In order to calculate the water flow, I created a lookup table, which was obviously finite. I asked the question as to what happened when the water rose above the maximum specified and what message should I display. I was told that this could never happen. In fact, I was told that this was so unlikely I could display the message: “THE KING IS A ****” (expletive deleted). Well, I was rather more genteel back in those days, so I opted to display “FLOOD!” instead.

At the time we completed the project, there had been a drought, and this continued until the area was hit by tropical cyclone Domoina in 1984. This incredible weather system dropped 50cm (20″) of rain in a 36-hour period. The 135 MCM (million cubic metres) Mnjoli dam went from 0 to 100% in less than 20 hours. The dam had an earth wall, and if water flows over the top of this structure, that that is the end of the dam. In the event, they evacuated the control centre when all eight stations were reading “FLOOD!” Fortunately, the design of the overflow channels managed to cope, and a greater disaster was averted.


The screen output during development.

In the aftermath, it turned out that all of the water level stations had been completely washed away and the whole system had to be replaced. If I had followed the original advice I was given, I wouldn't have been able to return.

Have you ever made the mistake of believing what you were told? And has any of your work been destroyed by major natural event?

13 thoughts on “Think before you leap

  1. “DavidnnLightning in Southern Africa is always a problem. I remember working on a fire protection (sprinkler) system in a aircraft hangar. If it started sprinkling (rather corrosive chemicals) and the aircraft engines were exposed, the engines would be w

    Log in to Reply
  2. “The cyclone was supposed to be a once in 200 year event. Surprise, surprise, when 2 tears later another cyclone hit and washed away the sensing stations again. At that point I was only supplying the software, but my friend made quite a it money building

    Log in to Reply
  3. “More derring-do for you, Max. Installation for some of the sensing stations involved avoiding crocodiles when doing the installation and testing.”

    Log in to Reply
  4. “davidn” I think Aubrey's will top mine – both technically and for exotic dangers….”nnI don't know- I am certainly envious of your time in the near-Antarctic on Marion Island”

    Log in to Reply
  5. “Aubery & David: Yes all your antics certainly smack of the exotic. nWhereas most of mine seem to involve not being able to run fast enough in tunnels where trains and a technician can not fit at the same time. It's amazing how real a track trolly loaded

    Log in to Reply
  6. “CrustynnI do have several more stories of the “exotic”, most of which (like this one) were published on MCC, but now lost- I will probably resurrect them over time. nnHowever none of them were ever life threatening, like yours. Seems the mundane (as

    Log in to Reply
  7. “Aubrey…Knowing the capriciosity (yes, it's a word, I just made it up) of African monarchs and dictators, your course of action was very prudent :-)nnMy story is of lesser consequence but equally alarming at the time. As a radio tech in the Rhodesian

    Log in to Reply
  8. “@Max… “…I'll just sit quietly in the background writing down your tales of derring-do.” I think Aubrey's will top mine – both technically and for exotic dangers….”

    Log in to Reply
  9. “@Antedeluvian… “Lightning in Southern Africa is always a problem.” Don't I know it. When I was renting terminals to travel agents (think RS232 up to 30 meters long) I was plagued by lightning blowing the 1488/89 RS232 driver chips. It was not then

    Log in to Reply
  10. “Aubrey…the worst thing that happened to me there was to have a jealous bull fur seal chase me (I think he thought I was trying to steal one of his harem). It was on a beach of large boulders and I had wellies on (Marion is full of bogs). I slipped and

    Log in to Reply
  11. “@Crusty…so there is not even space to lie down beside the track? Scary stuff. Anyway, glad you are still with us to regale us with these tales from the tunnels… :-)”

    Log in to Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.