Skip to main content

Posts

Showing posts from 2016

Electronic Signatures - Snake Oil

Electronic signatures are commonly used in the more advanced enterprises to sign documents - PDF files mostly.  Unfortunately, the implementation is broken and it doesn't work.  The broken implementation reduces it to snake oil. A typical IT system is set up and managed by one or two overworked computer geeks who clicked through a setup wizard to configure a key server on the company LAN.  The public and private keys are distributed on the company workstations and laptop PCs by Active Directory and GPG and once it looks like it is working and some users can sign a document, the whole universe shakes, angels and birds sing, flowers fall down from heaven and all is well... or is it? I wanted to be able to sign documents on my engineering laptop PC which runs Linux, not just my office PC, which runs Windows (and which usually has some problem or another).  So I asked IT for a copy of my Private key.  After a few months, they emailed me my Public key.  So clearly, the IT geeks

Grajcar Slovak Folk Band Does Metallica

Well, evidently good artists can play anything on any instrument.  Here is the Slovak folk dancing band Grajcar, playing Metallica on three violins, a double base, clarinet and cymbal. I recorded a minute or so of Nothing Else Matters , at Sheik Maktoum's Majles at the Emirates Golf Club in Dubai, during a Czech and Slovak party. (The horrid video quality is due to Google, not me!). Here is more of them in what looks like Bratislava: https://www.youtube.com/watch?v=126IpgNmA48 

Rover2: Serial Motor Controller

My new rover is supposed to be simpler than the first one and something that irked me with the first design was the motor controllers.  They worked, but they are ridiculously complicated.  So I bought a Sparkfun Monster Moto Controller and hooked it up - much simpler. The only hassles with it is that if you would plug another board on top of it, then it could short to the tops of the capacitors and the VIN connector could short to the Arduino ICS pins underneath it.  I stuck a rectangle of clear plastic cut from some screws packaging between the boards and snipped the ICS pins off - done. Serial Control Controlling a DC motor is straight forward, using two pins to switch the H bridge direction (INA1, INB1) and one for speed PWM (PWM1).  There is also a current sense input (CS1) that you can set to turn the motors off if they get stuck and the current increases too much.  You'll have to set the sense level with trial and terror. Here is an example for a serial motor contro

DSP on an Embedded Processor

Doing digital signal processing on a teeny weeny Arduino processor requires some trade-offs, since it is slow and doesn't have much memory.  However, bear in mind that today's embedded processors are faster than yesteryear's DSPs, so all you need to do, is use yesteryear's methods! What it mostly amounts to, is careful use of integers and shifts, instead of floating point numbers and multiplies.  If you can, limit multiplies, divides and buffer sizes to powers of 2.  That affords enormous speed optimizations. Circular Buffers For example, let's filter input from an 8 or 10 bit A/D on a little 16 bit embedded processor.  This usually requires a low pass filter.  A simple low pass filter is a moving average and to do that, you need to keep a buffer of old data values. If you are smart, then you will set up a circular buffer with 10 values, but if you are smarter, then you will use a buffer with 8 or 16 values instead - why? If the buffer size is a

Pleasant Random Jingle Generator

Beeping Computer Way back during the time of the dinosaurs, circa 1975, when one turned on a desktop computer, it would go Beep!   That fell out of favour once Microsoft figured out how to make a computer take 3 minutes to boot up, before finally being able to emit a simple beep.   However, it is still common practice to test a new little embedded controller by flashing a LED. Music vs Noise Now for those tinkerers who are a little more adventurous: How about pleasant sounding random noise?  There are two things that help to make noise sound acceptable: Use a tonal scale that everyone is used to. Avoid obvious dissonance. Scales We could use a Pythagorian scale with 7 notes per octave and perfect harmony, but then it will sound weird - like a Scottish bag-pipe and I don't have enough Scottish genes in my ears to prevent them from bleeding. The equal tempered (logarithmic) scale of Johan Bach ( Das Wohltemperirte Clavier, 1722) ), with concert pitch (1939), is us

Arduino Rover #2

My second rover is coming together.  The advantage of a ground rover is that it cannot fall out of the sky, so one tends to get rather more hours of amusement out of it than from a helicopter or fixed wing toy aircraft. The first rover worked, but it was too complicated.  The problem with all toy projects is that I tend to forget what I was doing with it and I like to 'work' on multiple things at the same time.  My shop currently has a glider, a valve guitar amplifier, a VU meter, multiple radio transceivers and this rover all in various stages of incompletion.  Therefore any project needs to be modular and simple, so that I can see what is going on at a glance.  Otherwise, it ends up in a corner, gathering dust, rather sooner than later. Rover #2 uses the Sparkfun Arduino Redboard for its brains and it is meant to be completely autonomous.  Addition of RC makes it too complicated and hard to maintain, so I ripped all that out (and it can now go back into the 2m electr

Arduino LCD Button Shield

The Sparkfun LCD shield works very well.  It has five buttons wired to a single analogue input, which is a neat pin saver.  However, the example code is much too complex to my liking.  Granted, it can handle multiple simultaneous button clicks, but who on earth will ever do that?  So I made something simpler: #include <LiquidCrystal.h> // LCD uses D4 to D9 and A0 for buttons LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 ); void setup() {   lcd.begin(16, 2);   lcd.setCursor(0, 0);   lcd.print("C'mon click it!"); } void loop() {   unsigned char key;   unsigned int sensorValue;     sensorValue = analogRead(A0);     if(sensorValue < 1000)   {      sensorValue = analogRead(A0);           lcd.setCursor(0, 1);      lcd.print("                ");           lcd.setCursor(0, 1);      lcd.print(sensorValue);      if ((sensorValue > 600) && (sensorValue < 620))      {        lcd.print(" Select");      }      if ((sensorValue > 840) &&

Minimalist Arduino GPS Parser

The Sparkfun Redboard and other toys can be a lot of fun indeed.  What I like about the Arduinos, is that the board support packages are very good and it is very easy to intersperse regular C with the simple Sketch code. Here is a minimalist on the fly parser for NMEA GPS data positioning that I've been playing with.  It receives and analyzes one byte at a time, so there is no delay.  You have the data the very moment it is available: // Minimal GPS Parser // Herman Oosthuysen, 2016 #include <string.h> #include <SoftwareSerial.h> // GPS serial: 9600N81 // Example GPS data capture //$GPGSA,A,3,11,31,27,14,,,,,,,,,2.09,1.85,0.96*08 //$GPRMC,155741.000,A,2413.4311,N,05541.2983,E,1.19,45.34,240816,,,A*5D //$GPVTG,45.34,T,,M,1.19,N,2.21,K,A*03 //$GPGGA,155742.000,2413.4313,N,05541.2985,E,1,4,1.85,263.9,M,-29.9,M,,*77 //Time, Lat, North, Long, East, Fix: //$GPGGA,155743.000,2413.4317,N,05541.2986,E,1, //Heading true, heading magnetic, speed knots, speed kph //$GPVTG,4

Audio VU Meter

I have a bunch of dinosaur era Magic Eye tubes which I got from the Tubes-Store in Chellyabinsk and was wondering what to do with these roughly 100 million year old little cathode ray bulbs.  An audio VU meter with a microphone pickup could make a nice magical flickering display as I originally described here: An Angel Dancing On a Pin Head . Audio VU Meter - The First Flickers The example Rusky circuit works, but it needs much more gain to work with a microphone, instead of a direct hook-up to the preamplifier of a guitar amplifier and it needs a power supply of sorts.  So, I dusted the old circuit off, hooked up a little triode as a preamplifier to drive the display tube and my prototype worked.   Moving the resultant rat's nest from the breadboard into a proper display case was another matter though. Eventually, I redesigned the whole circuit when I rebuilt it, and rewrote most of this article. Note that at audio frequencies, any old tube will work.  If you have a weird

FM Crystal Varicap Tuner

I like to keep things simple, but I also like to make things that are a little unusual. To go with my Valve Amplifier , I wanted to make a simple radio tuner.  Where I live, there is a powerful FM transmitter almost in my back yard.  It is very strong and overpowers all other transmissions, so the only FM station that I can receive is Abu Dhabi Classic .  That gets rather trying after a while, but why not turn it into an advantage? Since the radio transmission is very strong, it can be detected with a simple tuned circuit and a non-linear element - there is no need for a complex discriminator or PLL. For an intuitive explanation of how it is possible to demodulate FM with an AM detector: If you tune an AM receiver adjacent to an FM signal, then when the FM signal is closer, the AM signal will be stronger and when it dithers further away, the AM signal will be weaker - that way, a simple envelope detector can detect a FM signal.  Some call this a slope detector. Crystal sets

Twin Otter

If you ever visit British Columbia in Canada, then do yourself a favour and take a sight seeing trip with Harbour Air . They operate a large fleet of old and new De Havilland seaplanes flying out of lakes and harbours all over BC - providing a delightful experience. In this older plane, an original De Havilland, circa 1970, the upgraded turbine engine has about 50% more power, which provides seemingly effortless take-off and landings, while the cockpit is a museum piece with some essential updates.  Note the fuel flow indicator hose at the top of the panel - the ultimate in low tech! The planes are simple and reliable aluminium sheet metal constructions, supported by Viking Air , which is continuing the De Havilland mission.  Since 2010, Viking Air builds completely new Twin Otters. Yours truly, in the co-pilot seat. A view of Victoria, with the snowy peaks at Vancouver in the distance. You can literally fly from downtown Victoria, to downtown Vancouver, have a meet

Why Globalization Doesn't Work

One doesn't need to be a wizard to realize that when you take a large amount of wealth and divide it amongst four billion people, then nobody has anything. Globalization is a form of Communism.  It didn't work in the USSR or China and it won't work for the whole world. Recently, the Limeys voted to exit the EU - which confirms that although common sense isn't common, it usually prevails in the end . The multi-national companies seem to be the only entities that profit from globalization.  The rise of these behemoths are amazing and appears to be a rerun of the two East India Companies, which became so big, they had their own governments, money and armed forces.  Eventually the corruption ran so deep that they became indistinguishable from their parent countries (Netherlands and UK) and it took major wars to get rid of them.  Maybe one day there will be a real war between Apple and Amazon, with Pepsico running away with the spoils and all restaurants will become

Slackware Linux

One of the first Linux distributions I ever tried was Slackware , some time before the dinosaurs, circa 1995 - it was quite an adventure, since in those days, nothing worked the first time.  Yesterday, I gave the latest Slack a spin and it felt like donning an old frumpy jersey - for that comfy, warm, lived in feeling and nowadays, everything 'Just Works', TM . What hooked me, was that the ethernet port is named eth0, so all my old scripts work.  The boot loader is LILO.  The boot code is in the MBR.  The initialization system is in /etc/rc.d and rc.local works right off the bat.  SELinux is nowhere in sight.  The log files are plain text and I can watch my system with 'tail -f /var/log/messages'.  Systemd?  What is systemd??? Never heard of it, sorry... In short, everything works totally Olde Skool , the way the Fates intended and Slack is Fast . Slackware is the ultimate Long Term Support Linux, since for the better part of the past quarter century, it ha

Conventional Wisdom

Everybody knows that palm trees don't make branches, right? Uhm, yeah, well, no fine? There are many such trees actually.  This one is close to our home. If a palm decides to make branches, then there is no stopping it.  The city workers have to keep cutting the branches off, but sometimes, when it is nice and symmetrical, they let them grow. If this tree was at my old university, then I'm sure we would have used it as a catapult to shoot water balloons at passing cars.  Fortunately here water is hard to come by and it is usually too hot for anyone to do mischief outside. Have fun! Herman

Whole Disk Encryption

Many people, even card carrying computer geeks, do not understand why a computer hard disk must be encrypted and why a computer must be shut down for the disk encryption to be effective. This applies, whether you are using Bitlocker, Filevault, PGP, GPG or LUKS. Why Encrypt Your Disks? If the disk is not encrypted, then a miscreant can boot the computer with a USB stick or CD and read everything on the disk, or plant incriminating data on your disk , and then call the police, or wait for you to go through a border post where your machine may get searched - then watch you end up in the slammer. Also, if the disk drive controller would fail and you replace the disk and chuck it in the trash, then the data is still accessible, if someone would replace the drive controller from an identical disk bought on Ebay. If your laptop PC gets stolen, then it can end up on Ebay, with all your data and the buyer can empty your bank account, order a bunch of credit cards in your name, or se