Sunday, 15 January 2017

Synthesized Sidetone

The m0xpd bench is full of even more tangles of wire, associated with analog synthesis.


I realised this morning that my new system could be gated by any time sequence, such as that produced by my Morse keyer - it is Funky after all! So, I've made the most over-engineered sidetone generator ever.

Here's the beginning of a 'CQ' call...


The top trace is the keying waveform, sending the letters C and Q (identified in red for the illiterate amongst you). In the bottom trace is the resulting audio; a 600 Hz tone, produced by the VCO,  modulated by new elements on the bench.

Since last time, I've made several new bits of what I've decided will be a modular synthesizer. The voltage-controlled filter, which languished on a solderless breadboard, has now been proudly copied onto a piece of Vero stripboard. In fact, there are two of them in a dual configuration. The VCF is filtering the (square) VCO output to make a cleaner signal for our sidetone (analog synthesizers generally use 'subtractive', rather than 'additive' synthesis).

Next, I made a dual low-frequency oscillator on a piece of Vero, to save my trusty Heathkit AF generator from doing all the modulation duties. It isn't being used in this 'demo'.

More importantly, a look in the junk box revealed a nice crop of CA3080 Transconductance Amps - so a search on the web found ideas for a Voltage Controlled Amplifier, now implemented on another solderless breadboard. This is what is doing the modulation of the (audio) carrier you see in the image above to generate the 'CQ' sound.

Then, I've made a (dual) envelope generator, which makes exponential 'attack' and 'release' profiles at the beginning and end of gating pulses (or, alternatively, of triggers), which can control the VCA. This would usually be controlled by (e.g.) the gate output of a keyboard or sequencer - but in this silly 'demo', my morse keyer is gating the VCA.

Setting the attack and release times to take non-zero values allows the hard-switching of the audio seen above to be replaced by exponential gating...


The image above shows the output of the envelope generator in the middle (blue) trace.  This output is used as the control voltage for the VCA, which implements the modulation resulting in the trace seen at the bottom of the image.

Taking it too far, for example by setting an inappropriately long release time, reduces the modulation depth of the CW...


This 'soft-switching' of the sidetone takes away the hard, clicking edge associated with simple on/off switching, leaving the resulting waveform easier on the ear [for reasons directly analogous to those which motivate soft keying of RF to avoid spectral splatter]. Readers of long standing might recall that this is something I've played with before in building one of my keyers.

Here's a view of the modules of the synth in the making on the bench, with the modules and some other elements labelled...


You can see the Attack and Release controls. You can also see a small interface circuit to link between the (open collector) output of the keyer and the 12V positive logic required for the gate input to the Envelope Generator. This is a trivial single transistor.

The mess on the bench does allow half-way serious demonstrations of keying. But you just can't help applying frequency modulation to the CW and all sorts of other zany effects. There's music in there somewhere!

I've just come back from the West Manchester Club's Winter 'Red Rose' Rally. It used to be held conveniently close to my home, but now it has moved out to Lowton on the East Lancs. I was hoping to get some bits for the synth-to-be, but the Rally was a wash-out in more ways than one. No matter - I know where I can find lots of traders happy to send me all the pots and sockets and other hardware I need to put my circuits into Eurorack compatible modules.

...-.- de m0xpd

Sunday, 8 January 2017

Analog Synths

Cameron was talking about analog synthesizers last week and he got me interested.


I refer, of course, to my colleague Cameron and not to the former 'Prime' Minister. Don't expect any political comment or porcine quips - that really would be beneath me...


There's quite a lot of common ground between me and analog synths: electronics, music, signal processing, some of the particular technologies of radio (modulation etc) - I could go on.

Despite this affinity, I realised when Cameron showed me some YouTube videos last week that, whilst I know all about the technology underpinning Analog Synthesizers, I've never actually played with them. So - you can guess the rest.

Yesterday I made a new mess on the bench...


The heart of the story is a Voltage Controlled Oscillator, which makes square- or triangular-waves, whose frequency is controlled by a voltage (hence the name). Now - we've done things not a million miles different than this before - but this is an audio project!

There's lots of circuits for audio fequency VCOs on the internet, but I wanted something which was not just a voltage controlled oscillator, but rather the particular sort of VCO used in a 'real' musical synthesizer. These have oscillators whose output frequency is proportional to an exponential function of the controlling input voltage (because then, the input voltage will be proportional to the musical 'note' produced, which is itself the logarithm of the frequency). These are usually called 'one Volt per octave' oscillators, because of one industry standard (used by Korg, Yamaha, etc) of using a voltage change of one volt to signal an octave change in frequency (a 2:1 frequency ratio).
 
I took as starting inspiration a circuit found on this page. Here's my resulting VCO...


As usual, I had to make various changes to accommodate the contents of my junk box (the linear to exponential converter stage is built on a TL074 and the VCO proper is an LM324). Plus, the final output was rather more than one octave per volt, so I've added some trimming, as seen. There's a potentiometer to manually tune the oscillator and two inputs for control voltages (CVs) - which are additive signals (i.e. you can transpose by adjusting the tune control).

I soon confirmed I could test the oscillator with the manual tune control and apply modulation input from an oscillator to get vibrato effects. Throughout all the experiments here, my old Heathkit AF Sig Gen was serving as the LFO and modulation source...


I don't have any analog synths or 1V/8ve gear, so I programmed an Arduino to make a simple sequencer.

You can't use the PWM output produced by the 'analogWrite()' function (at least you CAN use it, but you hear too much of the PWM frequency to make the approach useful), so I added an MCP4922 DAC (which I've played with many times before) to give steady DC control voltages and to increase the available resolution to 12 bits.

With the 12-bit resolution, you can easily construct a table of the codes required to put out five octaves of semitones...


from which a simple look-up allows you to sequence a loop of notes or a random pattern. I even added an analogRead() of another external voltage to control the speed of the sequencer. This sounds interesting when you control it with an LFO - especially when it is playing a random pattern. Funny how the 5V Analog Ref of the Arduino works so nicely with the CV scheme of the Analog Synth world.

The simple VCO tracks well over a middle octave and is very stable (particularly as I've not yet taken ANY steps to ensure temperature stability), but isn't going to knock Moog off its pedestal quite yet.

Flushed with the success of the VCO, I built a Voltage Controlled Filter, taking my lead from Outer Space and making the appropriate revisions to accommodate the contents of the junk box (most importantly to work in the beloved 2N3819)...


The filter allows you to make all the expected 'Wah-wah' type sounds and more, controlled manually or - more importantly - by external control voltages. These allow either continuous modulation (e.g. controlling the filter from a free-running oscillator) or can be triggered by the sequencer (e.g. I've set the sequencer to set a digital line LOW every time the root note of a sequence is played, which allows the filter to emphasize that note and - hence - the tonality of the sequence).

Here are images of the filter response (to a square wave generated by the VCO, set manually to 100 Hz) with varying settings of the filter 'cutoff', at full 'resonance'...


So, with only two simple analog circuits and a sequencer made from an Arduino, a DAC and a few lines of code, I've had quite a bit of fun. I guess the next step (if I can be bothered to make one) is going to involve a VCA, an envelope generator and a homebrew MIDI : CV converter.

Alternatively, I might just follow Chick Corea's advice and condemn these horrible pieces of electronics to where they belong and play a real instrument (even if my 'Hammond' is a clone)...


Or, I could even get back on the radio - let's see if that contest has finished yet...

...-.- de m0xpd

Sunday, 1 January 2017

HNY

Don't know about you, but Winter Sports was a complete wash-out for me - perhaps due to a complete lack of snow


The snow-free picture above is the only ski area I can claim any familiarity with - located on the road to heaven and imaged in May, 2015. There was (of course) snow a few hundred yards further up the road.

I have had S7 noise (and more) all over the 40m band throughout the holiday period and the other low HF bands haven't been much better. I've not spent a lot of time on the radio - but I've been on every day. I've not heard a single person calling "CQ QRP" and when I tried, I didn't get an answer. Also, I didn't get spotted on the reverse beacon network until I got depressed and stacked on 10dB of power.

Of course, I've had some QRO QSOs. There (and whilst listening to other people's exchanges), I noticed that people weren't even bothering to spell out complements of the season but - rather - were resorting to a telegraphic version of text speak with the lazy 'HNY'.

Of course, we do it all the time with our Q-codes and the like - and for good reason. But, surely, this is the one time of the year when everybody has a little more time for longer and/or slower exchanges (like the faltering first CW QSO I enjoyed with a new Polish ham on 20m on the 23rd). Unfortunately, it isn't easy with (as now) S8 of noise on the meter and somebody banging out CQ TEST on 7030 kHz.

So, bear with me all you speed merchants, as I waste precious seconds of your lives, which you'll never recover, to wish you all a very

Happy New Year

...-.- de m0xpd

Monday, 26 December 2016

Santa Stopped Here

Unwilling to go to the trouble of watching out, not crying, not pouting and - worst of all - being nice rather than naughty, the kids round here resorted to posting stop signs, exhorting Santa to call at their gaffs yesterday.

Not wanting to be outdone by the little darlings, I joined in...


and - glad tidings of great joy - it worked!

I've never really had anything to complain about before, but Santa really excelled himself this year (aided and abetted by the XYL), providing the Rigol DS1054Z I've been sniffing around for a while...


Here are some proud boasts of a kid with a new toy first impressions, formed after opening the box and looking at some of the functions offered by this inexpensive instrument.

There's a great colour display and four input channels. There's the temptations of some software hacks to increase the available bandwidth above the cited 50MHz. There's also the promise of digital connectivity, which means an end to all those ugly oscilloscope screen photographs, which have blighted the pages of  'Shack Nasties' over the years.

Getting some screen images onto the computer was the first thing I tried - which involved downloading the two lumps of freeware which Rigol provide to accompany my new toy: UltraSigma and UltraScope.

With these pieces of code in place on the shack PC, I could hook up immediately to the new 'scope and see the screen. I achieved this first through the ethernet connection (just because I could) and then went back to the planned option of USB...


All of this was anticipated - I expected to be able to 'echo' the screen and its controls on the PC. What I didn't expect was that the PC display could provide different information to that presented on the (already more than adequate) seven inch screen of my new 'scope.

I can - for example - set up some measurements on the PC (making it do service as a multimeter and counter/timer)...


Here you can see that the sinewave I'm shoving into the 'scope to give you something to look at has frequency of 4.386 kHz and you can check its RMS value. You can do all sorts of other stuff as well - but we're only just getting started here!

Given the frequency content, it might be interesting to open an FFT window on the PC (you can do this on the 'scope too - but the bigger PC screen makes the additional graphical information easier to consume, whilst keeping up the conventional time-domain display on the instrument)...


Here (above) is the expected peak in the magnitude spectrum at the correct frequency. The FFT was being computed at something like 1 MHz sample rate, but I've changed the display to make things easier to see (which explains why the frequency resolution isn't so great). Here's the same signal, sampled at a lower rate (i.e. with the horizontal timebase slower), making the frequency resolution higher...



I've had this new toy for thirty six hours and I've been playing with it for a few minutes. It seems to me to be bursting with possibilities and it is absolutely amazing value for money. Plus, the XYL (who acted as Santa's little helper in this transaction) tells me that the UK agent was really helpful and good to do business with.

Here's one little boy who's been very lucky.

I hope you've been lucky too and I wish you all a very Happy Christmas,

...-.- de m0xpd

Friday, 23 December 2016

Forty-9er Shield

I've been tinkering with a quick lash-up of Wayne Burdick, n6kr's famous 'Forty-9er' receiver, implemented on an Arduino shield and tuned by one of my DDS systems.


Regular readers will remember how I tried running my Kanga / m0xpd Sudden-inspired receiver shield under the control of the new DDS on the Internet of Things board and found the latter to cause a lot of noise problems. I stripped out unnecessary active stages in the Rx shield to try to manage some of the receiver's susceptibility to the hostile EM environment generated by the ESP8266 and realised that I was left with something which resembled not only a Sudden but also any other SA602 / LM386 receiver - including the Forty-9er.

Interestingly, there's a guy in Asia who produces a CW transceiver with an ESP8266, available as a kit or as an assembled unit through our favourite auction site. This transceiver is rock-bound, and is offered with an app for an Android phone, which allows automated sending of CW. There's some implication that it was supposed to allow automated copying too but, from what I gather, that side of things isn't working too well. The transceiver is based on - you guessed it - the Forty-9er. (He also makes units based on Rock-mites etc.)

I figured that the combination of my beacon work (which does all the transmit side stuff) and my WiFi controlled VFO already adds up to way more than the simple CW transceiver mentioned above, which was what motivated me to investigate the IoT DDS / Receiver combo. But - as readers recall - I found it impractically noisy.

Well - if the commercial unit is offered and (one idealistically supposes) works with the Forty-9er, perhaps I should try the Forty-9er circuit too...

I found that I could take an empty prototype Sudden Rx shield PCB (with tracking for the DIL format 602, rather than the production version SMD) and bodge it for the Forty-9er circuit. The Sudden and the Forty-9er receivers are so similar that the PCBs can be re-worked to serve both roles with almost no effort.

Here's my new kludged Forty-9er receiver, atop the Sudden Tx prototype shield (which is only serving as a power supply, so most of the pins aren't connected) - the new ESP8266 / AD9834 board lurks behind the stack:


Here are details of what I've implemented on the shield:


Those familiar with the original Forty-9er will notice I've been forced (by the PCB) to deviate from the original recipe in a few ways:
  1. My input filtering network is implemented off-board
  2. I'm taking the output from the 612 OUT_B (pin 5), rather than OUT_A; simply an inversion
  3.  I'm applying the input to the 386 inverting input (pin 2) rather than the non-inverting input; another inversion
  4. I've added the 10uF capacitor between pins 1 and 8 of the 386; experiment showed I needed more gain to drive the speaker 
 All of these measures are not significant departures from the letter or spirit of the Forty-9er design (excepting 1 - which does have an impact which cannot be avoided in terms of layout).

The limited experiments to date show that the Forty-9er is better than the original Kanga / m0xpd HF shield (with its extra active stages) and possibly marginally better than the 'bare' Sudden. However, there is still a clearly audible clicking, which isn't yet - by any means - perfect. But, at least we're now at the point where I have a usable receiver.

I've not yet got a big enough inductor on the input to the 386 (the 'junk' box didn't stretch that far), so there is some performance gain to be expected in the original circuit when I get the correct magnitude inductance. Also, there is more to be done in experimentation with shielding / positioning, etc..

I've also searched the 'net for any mention of the clicking in discussion of the performance of the  lxqqfy.com receivers - but to no avail. These devices have a very narrow (crystal) filter on their input and may derive some benefit from that strategy. If any reader has any direct experience of these units - or can point me to any evidence - please get in touch.

Now I'm off to continue with the tinkering, to listen to more clicking and - in between it all - to get lost in last minute preparations for Christmas,

...-.- de m0xpd

Sunday, 11 December 2016

Homebrew WiFi Shield

Having just finished development of the new m0xpd / Kanga ESP8266 - AD9834 board, I find myself with a few WiFi components knocking about on the bench - so I figured it would be fun to try to make a WiFi shield for an Arduino...


Using an ESP8266 (in a module, such as an ESP-12) as a WiFi shield for an Arduino is a little like using the proverbial 'steam hammer to crack a nut' - but these modules are frighteningly cheap and I do want a WiFi shield (which are surprisingly expensive).

I have a spare ESP-12 module on a nice breakout board with 0.1 inch pitch headers, just crying out to be used once again (it having done service in the early stages of the development of the connected beacon etc)


This could be a great opportunity to press the module back into some useful work and to teach myself something new.

I found a nice page about Sparkfun's ESP8266 WiFi shield and realised I could easily make a cut-down version with the module. Here's my schematic...


All that's needed is a power supply to ensure the current demands of the ESP8266 (on transmit) don't frighten the Arduino and a level converter for the software serial interface.

Regular readers will recognise my old favourite level converter, originally used in the Si570 board and later developed in quad and octuple parallel versions (although this time I'm using the familiar 2N7000 device, as I did in the level converter for the display driver in Occam's Dirk, rather than the fancy surface mount BSS138). To be perfectly honest, I'm not absolutely sure this level converter is required (I've seen some folks doing without it ) but it only takes a couple of shakes to build it and it only costs two FETs and four resistors, so it may as well go in!

Here's the completed circuit taking up almost no space on a prototyping shield:


 and here's the shield with the actual ESP module plugged in:


I fiddled around for a while with the code and eventually got the Arduino UNO (underneath the shield in the photo at the head of this post) to serve up a very simple web page, via the WiFi shield, on which it reported the analog levels read at each of its six analog input pins:



The response above is produced with A0:A4 floating (open circuit) and A5 grounded (hence the zero).

This success was obtained using 'brute force' AT commands (I started from the code prototype given here). My attempts to use WiFi AT libraries - including SparkFun's, - have not yet been completely successful. I don't yet know why - given that the shield is obviously working.

All-in-all, an interesting exercise and a nice way of getting a WiFi shield for 'nothing'.

...-.- de m0xpd

Saturday, 10 December 2016

ESP8266 Kit Released

The m0xpd / Kanga ESP8266 - AS9834 board, 'A DDS on The Internet of Things,' is now available for purchase as a kit, with the three SMD devices supplied already installed on the PCB...


The kit is provided (as usual) by the board's co-developer, Kanga Products UK.

Although this board is no more complicated than any other of my Arduino shields, it is rather different in scope and application. As such, I have set up a small website to support the board. The site provides details of the board's hardware and how to go about assembling and interfacing it.

More importantly, it provides some support to help new users get going with applications of this board. There are instructions for integrating the ESP8266 into the Arduino IDE and some test and application code for the new board - including a basic version of the multi-mode QRSS beacon.

I wish to thank Kanga for their continued support and encouragement in bringing my work to a wider audience. I hope that this board will be of interest to many experimenters who wish to explore the interface between ham radio and The Internet of Things.

...-.- de m0xpd