Sudden S Meter

The Sudden S Meter has been implemented in Software and shown on the display; but it has not been implemented in hardware --as yet. This is on a list of things to do. So you will see the bar wiggle as proof that you can display a "wiggling bar" but not the final S Meter Data.

Lets talk first about how the S meter will work. Essentially one of the Analog pins is used as voltage input pin and then the code has to manipulate that voltage level and make it display.

We use a trick that tells the Arduino to display a long thin rectangle whose length is a variable related directly to the converted voltage level on the analog pin. Bottom line we keep drawing the rectangle each time through the loop and thus we will see a moving bar in sync with the system clock. In the code, as it stands right now, the Arduino is reading the random noise on the Analog Input pin and with some multiplication and some log functions creates a numeric call "val". This "val" in turn become the outer boundary of a rectangle whose other dimensions remain fixed --ie the starting location in x,y coordinates and the thickness (width) of the rectangle. The only unknown is the length which becomes a derived value. For now the S Meter moves.

The hardware part will involve sampling the output of the audio amplifier with perhaps some filtering. It may also involve additional amplification to get the signal to the proper level. There may also have to be some limits in the sketch that ignore the rock crushing signals that would othgerwise pin the S Meter. But those aspects may have to be determined empirically. This website will be updated with schematics and data sampling.

 

Just in case you are wondering here is what is driving the"pseudo S Meter" until we get the sensor circuitry installed and write a formula. It is a sub-routine called Check the S Meter (CheckSM). Every time through the loop the S Meter is checked. Pin A6 is the input Pin for the S Meter.

In the next to the last line you will see that the Arduino is instructed to draw a rectangle starting location x = 58 and y = 87 with a second point on the x axis being "val" and the width to be 2 units. Lest I forget --- fill the rectangle with the color YELLOW.

Elsewhere a larger rectangle with tick marks is drawn as a part of the display setup that appears as a bar type meter display. This never changes so can be permanently set up. The term in the second line is made up by me with no real math basis other than to take the value read and to perform some math actions, which gives it a non-linear output based upon what is read. Made up, yes; but probably not too far off as it takes much larger signals to move the bar much like db readings. The delay is so that the meter in effect has some "damping".

void CheckSM(){

adcval = analogRead(A6); //S meter routine


val= 15*log((adcval-200)/20);



display.fillRect(58, 87, val, 2, YELLOW);

delay(20);