Skip to main content

Posts

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...

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 ...

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 (19...

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 ba...

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("                ");    ...

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 ...