Tag Archives: electronics

Desert Ratt 2 (First Build)

Paul Harden NA5N designed the Desert Ratt shortwave regen receiver in the mid-1990’s. It’s a popular radio for builders, and my choice was due to the excellent documentation and the fact that it was designed to tune using varactor diodes, rather than metal fin variable capacitors (that were used in the original Desert Ratt).

Here’s my construction journal:

March 4: Started with the LM386 and the transistor preamp, could not get it to chooch. Reverted to the breadboard. AA7EE has pin 7 unconnected. There’s a principle that you should start with the audio amp and work backwards; this doesn’t work as expected because (as I found out), I needed to bias the base of the transistor on the breadboard before I could get output.
March 6: Soldered a socket and completed the audio amp portion of the circuit. Hoping that it will work as advertised, now that everything is soldered in, once again.
March 7: Completed soldering all components. Result is motorboating. Check AA7EE: he switches pins 2 and 3 on the LM386, which I do, and it’s a relief. However, still no output from the radio. There should be around 2v on the base of the top left transistor, but it’s at ground.
My schematic drawing for the first build of the Desert Ratt 2.

March 8 (morning): Replaced the transistor, no change. Checked voltage again — tried removing various wires implicated in the issue, and found a copper ‘hair’ crossing from the ground plane to an island. Once I removed it, I started to get some fuzz indicating oscillation. Still lots of intermittent noise; soaked the board in alcohol and dried it. This is the last time I’ll cut out islands! There just isn’t enough dependable separation between the islands and the ground plane. Should I start over?

March 8 (afternoon): Popping noise seems to have gone away now that the board has dried fully. And with the evening, I start hearing stations. It chooches!
March 9 (evening): I switch wires for most of the pots as they were wired in backwards (as in loud to the left, quieter to the right). Frequency calibrated after removing a few turns from the main tuning toroid. A is 3.0-6.3 MHz and B is 3.1-7.8 MHz. Very good fidelity and dynamic range. I’m satisfied with this radio’s sound.

Building Radios

W1FB’s design for a VFO (Variable Frequency Oscillator): output on scope

I’ve not been posting consistently lately. The main reason is that I’ve been indulging my curiosity in radio technology. It started when I wanted to learn more about the wireless systems that I was building into my Arduino projects. The explorations and experimentation into radio have taken over, but I’ve not been able to answer in my own mind where this was taking me, until now.

So I’ve been building and playing with radio-frequency (RF) circuits, starting with oscillators, moving on to amplifiers and then simple radio receivers.

Some history might be helpful: A hundred years ago, when radio was new, experimenters built their own radio gear. The first radio transmitter was a device that made a spark, and a little later, sparks—which splashed energy promiscuously across a wide spectrum of frequencies—were replaced by narrow-frequency signals that could coexist with other signals with a radio that could select (or tune) into one signal and ignore the others. This signal is produced by an oscillator, which vibrates at a frequency of several million times a second.

Low power AM transmitter for test purposes

Wireless signals—whether they be wifi, Bluetooth, FM or your garage door opener—all use oscillators to carry information. So step one in anyone’s search for knowledge in this field is to build an oscillator.

Actually, there’s a step zero: in Canada, the electromagnetic spectrum is considered public property. You just can’t set up a transmitter and spew electric energy in all directions. You need to abide by a set of regulations set by Innovation, Science and Economic Development Canada, and above a certain power level for your transmitter, you may need to obtain a licence. In my case, I have a Basic with Honours amateur radio license VE1LEB, which allows me to experimentally transmit, using commercially-designed equipment, up to 250 watts in certain high-frequency bands. Unless I upgrade my licence to “Advanced”, I’m not allowed to employ a transmitter that I build myself — unless it’s a kit and/or I’m transmitting at a very low level.

Used as a buffer for AD9851 frequency generator

So when I build experimental oscillators, I’m only allowed to run them at very low power so that they can’t be heard more than a few metres from my house.

Here’s a practical example from last summer: I wanted to test the performance of a radio that receives signals in the AM broadcast band, between roughly 500-1600 MHz, but in Halifax, Nova Scotia, all of the AM broadcasters have vacated this band in favour of the FM band. So when you turn on an AM radio in Halifax (during the day, at least), you’ll get noise, hiss, static, but nothing intelligible to a human. So I had to build my own little radio station that would modulate an audio signal from a CD player with a carrier wave around 1000 KHz. Tune the radio to around 1000, and you should hear music (but only if the radio is sitting next to the modulator circuit).

Here’s another example from last Fall: this circuit is from a design by Doug DeMaw W1FB that combines an oscillator with an amplifier. It’s a VFO (variable frequency oscillator) with a buffer amplifier that can be used as a stage in either a transmitter or receiver. The circuit was built on a single-sided PC Board, with islands of copper cut out using a copper engraver’s burin—a tool acquired during my days as a Fine Art Major. The components are soldered onto the islands. The rest of the copper is known as a ‘groundplane’: reserved for connection to zero volts (ground).

Direct conversion receiver

After that, with an increase in confidence, I moved on to building simple radio receivers. The first one used an amplifier design from the book “Crystal Sets to Sideband” by Frank Harris K0IYE. It’s known as a direct conversion receiver, one that’s unusual from most radios we use today because it doesn’t make use of intermediate frequencies to step the signal down from it’s original frequency to audio frequency. The radio is composed of an oscillator an RF board and an AF amplifier.

Direct conversion receiver – close up

The radio signal is brought into the receiver via a coax cable gold connector at the top left. This signal is mixed with a sine wave signal at almost the same frequency as the one we want to tune to. By varying the frequency of the oscillator, we can tune into different frequencies, which will be displayed on the frequency generator unit. When these two signals are combined, the difference frequency is the audio from the radio station. This low-level audio is transferred to the lower board with a short coax cable to the audio amplifier, which drives small earbuds for listening. The battery pack at the top right delivers about 12 volts to the radio.

This report gets me caught up to late October 2016. My next post will introduce “regens“. I realize that I haven’t revealed where all this activity is taking me in my design research. It will come in later posts.


Introducing Media Circus

Media Circus is a scrolling marquee that displays amusing headline news mashups.

Although this project is not quite finished, it’s at a point where I can show it: what’s missing is the ability of the unit to automatically update the headlines (once every hour). Currently, this appliance needs to be manually updated.


Media Circus Concept Drawing

Media Circus is composed of several modules, starting with “Cutup”, a mashup generator which is a php script that retrieves rss headlines from two Canadian news services, recombines them and displays 20 of them in HTML format. This isn’t by any means a new concept: it’s actually an old dadaist party game. William Burroughs used cutups in his writing. Visit Publicassemblage, runme.org, and Cut-up Machine for more online examples of this technique.

From this list, a human operator chooses one or two and makes minor edits to prepare them for inclusion in the unit. For the time being, I’m the ‘human operator’, and my choices are regularly uploaded to the ‘generalxcentric’ Twitter feed. I use Hootsuite to schedule the tweets throughout the day.

I’ll be building Cutups for the USA and the UK, and in the more distant future, provide a Media Circus mobile app that will enable users to generate their own news headline mashups!

The Hardware

The marquee runs on an Arduino Duemilanove (ATMEGA328 microcontroller). Power is supplied by an LM317T adjustable voltage regulator configured to output 5v. The regulator delivers up to 1.5 amps current, more than enough to drive the four SURE 0832 displays, but you must attach a heatsink—the regulator gets very hot.

I specify the ATMEGA328 because it has 2k of internal SRAM memory, and in the case of this application, it’s important. This microprocessor has three types of random access memory:

  • 32k Flash memory, of which about 2k is used by the Arduino bootloader.
  • 2k SRAM (Static ram), which is used to hold variables created by the program at runtime
  • 1k EEPROM memory, available using the PROGMEM function

The Flash memory is the same technology used in USB thumb drives. It is relatively slow to write to and reasonably fast to read from. It’s non-volatile, which means that it doesn’t lose data if power is removed. The 2k SRAM (Static Random Access Memory) is used for temporary storage of variables. It’s fast with both reading and writing, but it’s volatile. The EEPROM (Electrically-erasable Programmable Read-Only Memory) is also volatile, and it is very slow to write to, and fast to read from. The Arduino IDE does not have a function to make use of this memory. If you need it, you have to load the avr/prgmspace.h library and invoke PROGMEM.

For the purposes of this application, I quickly ran into the 2k SRAM limit, for two reasons:

  1. Each headline uses about 70 characters, which means that if I want ten headlines, I need to reserve 700 bytes (30%) of my available 2000 bytes of SRAM. That’s just to create the variables. Then my program had to concatenate the headlines into a long string of characters to be displayed by the marquee sign. That’s about ¾ of my available SRAM. I solved the problem by moving the individual headlines directly into EEPROM space at program startup, freeing-up 700 bytes.
  2. What actually drives the marquee is Gaurav Marek’s brilliant HT1632 library for Arduino. Along with this library comes a 5×4 font file. As you may have guessed from the name of the font file, each letter uses a rectangle of maximum 4 pixels across and 5 pixels down. However, the SURE 0832 display has a height of 8 pixels, so I redesigned the font for larger letters. The disadvantage to the new font file is size: my new font uses about 20% more space in SRAM than the original.

These SRAM space challenges were surmounted in time by moving the individual headlines into PROGMEM, and limiting the number of headlines displayed to seven.

However the SRAM requirements were not settled, because my plan was to attach an Ethernet Shield to the Arduino. The shield has its own library (conveniently included in the Arduino IDE), which requires more SRAM. But when I attached the shield, the unit failed to run. I tried reducing the headlines to one that simply read “help” but the marquee remained blank. There’s probably some interaction between the HT1632 library and the ethernet library, but I’m not competent or patient enough to try to resolve that issue.

I had another Ethernet shield, this one from Nuelectronics. This shield uses a different chip and has different libraries, and is altogether a more challenging device to integrate into an Arduino sketch. Although the shield does work with the marquee sketch, I was unable to adapt the library examples to my uses. That will have to wait for later.

SURE 0832 Display

The 0832 comes with ribbon cables and dip switches, prepared to be linked to three other modules. It’s a fairly simple matter to connect one module to the next and at the left end of the array, this is where you connect the Arduino. This is the pinout chart for my system, which uses Guarav Maurek’s HT1632 library. It permits easy individual pin assignments—a very useful utility, since Ethernet shields often use particular pins that can’t easily be changed. The pins on the SURE modules are labeled clearly on the back of each board.

Source Files

Click here for a ZIP archive of the Media Circus Arduino sketch and modified ‘font_5x4.h’ file for larger dot matrix type.

Update September 4, 2011

You can view more photos from this project at General Eccentric.

Update April 19, 2013

The General Eccentric Book and updated final code and drawings are available here.