Peripherals Behind The Iron Curtain

The article Home Computers Behind the Iron Curtain sparked a lot of interest, which made me very happy. Therefore, I decided to introduce more computer curiosities from the Iron Curtain period, especially from the former Czechoslovakia (CSSR).

As I mentioned in the previous article, the lack of spare parts, literature and technology in Czechoslovakia forced geeks to solve it themselves: by improvisation and what we would today call “hacking.”  Hobbyist projects of one person or a small party was eventually taken over by a state-owned enterprise, which then began to manufacture and deliver to stores with some minor modifications. These projects most often involved a variety of peripherals that could only be found in the Czechoslovakia with great difficulty.

Much like the production of components, the production of peripherals was also distributed throughout the eastern block so that each country was specializing in certain types of peripherals. For example, East Germany produced matrix printers, and Bulgaria made floppy disks drives. This meant industrial enterprises had to wait for vital computer parts, because the production in another country was not sufficient to cover even the local requirements, let alone the home user.

Continue reading “Peripherals Behind The Iron Curtain”

Logic Noise: More CMOS Cowbell!

Logic Noise is an exploration of building raw synthesizers with CMOS logic chips. This session, we’ll tackle things like bells, gongs, cymbals and yes, cowbells that have a high degree of non-harmonically related content in them.

Metallic Sounds: The XOR

I use the term “Non-harmonic” in the sense that the frequencies that compose the sound aren’t even integer multiples of some fundamental pitch as is the case with a guitar string or even our square waves. To make these metallic sounds, we’re going to need to mess things up a little bit, and the logic function we’re introducing today to do it is the exclusive-or (XOR).

An XOR logic gate has two inputs and it outputs a high voltage when one, and only one, of its inputs is at the high voltage level. When both inputs are low or both inputs are high, the output of the XOR is low. How does this help us in our quest for non-harmonic content? It turns out that the XOR logic function is the digital version of a frequency mixer. (Radio freaks, take note!)

Ideal frequency mixers take two input frequencies and output the sum and difference of the two input frequencies. If you pipe in 155 Hz and 200 Hz, for example, you’ll get out the difference at 45 Hz and the sum at 355 Hz.

Because we’re using square waves and an XOR instead of an ideal mixer, we’ll also get other bizarre values like 2*155 – 200 = 110 Hz and 2*200 – 155 = 245 Hz, etc. All said, the point is that we get out a bunch of frequencies that aren’t evenly divisible by one another, and this can make for good metallic sounds. (And Dalek voices, for what it’s worth.)

The 4070: Quad XOR

4070_pinout

Which brings us to our logic chip du jour. The 4070 is another 14-pin wonder, just like the 40106 and the 4069UB and the power and ground pins are in the same places. Since an XOR gate is a three-pin deal, with two inputs and one output, only four XORs fit on the 14-pin chip instead of six inverters.

By now, you’re entirely used to the 4000-series logic chips, so there’s not much more to say. This is a great chip to add sonic mayhem very easily to your projects.

Frequency Modulation with XOR: More Cowbell!

Let’s make some metallic noise. The first step is to mix two oscillators together. Whip up two variable-frequency oscillators on the 40106 as we’ve done now each time, and have a listen to each individually. Now connect each output to the inputs of one gate of an XOR in the 4070. As promised, the resulting waveform is a lot more complex than either of the two inputs.

Now tune them around against each other and listen to all the strange frequency components created as the sums and differences slide in and out. Cool, no? Here’s a bonus video that you can skip, but that demonstrates what’s going on with the frequency mixing.

Two-diode VCA

After a couple of minutes playing around, you’ll start to realize that this sounds nothing like a cowbell. We’ll need to shape the volume of the sound in time to get anywhere, and this means another step in the direction of “traditional” synthesizers. We’ll build up a ghetto voltage-controlled amplifier (VCA) and drive it with the world’s simplest envelope generator.

An active VCA takes its input signal and either amplifies or attenuates it depending on the control voltage (CV) applied on another input. When the control voltage is high, more of the sound gets through, and when the CV is zero, the output is ideally silent. Building a general-purpose VCA is a bit out of scope for our needs, so let’s just cobble something together with a few diodes.

This circuit works by cheating, and works best with digital logic signals like what we’ve got. When the input from the XOR is low, diode D1 conducts in its forward direction and all of the control voltage signal is “eaten up”, sunk into the output of the XOR chip.

Conversely, when the XOR is high, diode D1 is reverse-biased and blocks the CV, leaving it nowhere to go except through diode D2 and out to our amplifier. The resistor needs to be large enough that the XOR can sink all of its current, but otherwise the size is non-critical.

cap_square_to_pulesNotice what’s happened here. The voltage at the output is no longer the GND to VCC of our logic circuit, but instead ranges only from GND to the control voltage (minus a diode drop). So if we want to make a quieter version of the XOR input, we just lower the control voltage. It’s a simple voltage controlled attenuator. Now we just need to create a voltage signal that’s got something like the amplitude contour of a cowbell.

Remember how we converted square waves into trigger pulses by adding a series capacitor? The resulting voltage had this steep rise and exponential trail-off.

If we add in another capacitor, we can lengthen out the decay. And then while we’re at it, we can add in a potentiometer to control the rate of that decay.

diode_vca_with_envelope_no_diodes

Capacitor C1 converts the square wave into a pulse and charges up C2 very quickly, applying the positive voltage to the input of our VCA. The charge on C2 drains out through the variable decay potentiometer.

This simple circuit actually works well, but has one shortcoming. For long decay times, as illustrated above, the decay gets cut off when the control square wave goes low. If you only want short percussive hits, the simple circuit is enough. If you’d also like longer decays, you’ll need to add a couple diodes to chop off the negative part of the control voltage spikes.

diode_vca_with_envelope_sustain_no_diodes

Now that only periodic positive spikes are getting though to our decay capacitor, we have a nice variable-rate exponential decay voltage envelope. Here’s how it looks on the scope (with some extra capacitance slowing down the attack — envelope_with_xor_drumit might have been connected to the laptop soundcard). You can clearly see the control-voltage envelope chopped up by the diode action and the XOR’s output.

Putting the XOR frequency-modulated sounds through the two-diode VCA that’s driven by our quick and dirty envelope generator gets us a percussive metal sound.  But it it cowbell?  We still have to tune the oscillators up.

The classic, love-it-or-hate-it, cowbell sound of the 1980’s has to be the Roland TR-808. And if you look through the 808 service manual (PDF download) you’ll see that it uses two square waves from a 40106 chip simply mixed together. We’re improving on that by XORing, but we can still learn a bit from Roland. In particular, they tune their oscillators to 540 Hz and 800 Hz.

Because we’re XORing two oscillators together, our peaks come in at the sum and difference frequencies. This means that we’ve got to solve X + Y = 800 and X – Y = 540. Grab pencil and paper, or just believe me that you’ll want to tune up the individual square wave oscillators to 130 and 670 Hz respectively. At least, to get something like that classic cheesy cowbell sound.

Amplification Aside

We’ve been trying to stick to the use of purely CMOS logic chips here, but this session we broke down and used a transistor. The reason is that the audio input on our laptop insists on a bipolar, centered audio signal. In contrast, the output of our “VCA” sits mainly at zero volts with very short peaks up around one volt. The input capacitor in the laptop is charging up and blocking the VCA’s diode output. Boo!

Indeed, we can’t use our old tricks with the 4069UB as an amplifier here either. The 4069UB works great for signals that are centered around the mid-rail voltage, but distorts near either GND or VCC. Unfortunately, we’d like our quiet drum sounds to taper off to zero volts rather than the mid-rail, so we’ll have to use something else to buffer our audio with.

quick_and_dirty_transistor_amp.sch

The solution is to buffer the output with something suited to this unipolar signal, and the simplest solution is a plain-vanilla NPN transistor hooked up as a common-emitter amplifier common-collector amplifier. This configuration is a very useful analog buffer circuit; it puts out almost the same voltage as the input, but draws directly from the VCC rail and will certainly handle any sound card’s input capacitor. We used a 2N3904, but a 2N2222 or BC548 or whatever will work just fine.

Cymbals

Cymbals and similar metallic percussion instruments were pretty tricky to synthesize in the early days of drum machines. Until the LinnDrum introduced sampled cymbals, most just used a shaped burst of white noise. The aforementioned TR-808 used six 40106 oscillators linearly mixed together to approximate white noise. Again, we’ll improve on that by running it all through XORs with the result being somewhere between many oscillators and pure noise depending on how you set the oscillators up.

The inspiration for this circuit is the fantastic Synbal project (schematic in PDF) from “Electronics & Music Maker” magazine in 1983. It’s a much more complicated affair than what we’re doing here, but if you look at the left-hand side of the schematic, that’s the core. (If you’re copying the Synbal’s fixed frequencies for the oscillators, note that he uses 0.01 uF capacitors and we use 0.1 uF caps. Divide the feedback resistors by ten accordingly.)

cymbals.schThe trick to the cymbal circuit is making a lot of oscillators. We’ll hook up six of them, finally fully fill our 40106 chip. Then combine any pair in an XOR, take the output of that XOR and combine it with another oscillator. You’ve now got a complex oscillator that’s used up three 40106 oscillators and two XOR gates. Repeat this with the remaining oscillators and XOR gates and you’re nearly done. Connect the final two XOR outs through resistors to the output.

As with the cowbell circuit, this circuit can be made to sound “realistic” by picking the different component frequencies just right and tweaking the decay. We think that it makes a pretty decent hi-hat sound with a couple of the oscillators pitched high (1 kHz and up). On the other hand, if you’re into noise music you can skip the VCA altogether and tune the oscillators to similar, low frequencies. You get a vaguely metallic, almost rhythmic machine drone. Not to be missed.

Extensions

We’ve snuck it in under the guise of making a cowbell sound, but the quick-and-dirty VCA here is also useful for modulating most of the synth voices we made in the first few sessions. We went for a percussive attack by using a capacitor to couple the driving square wave to the VCA, but there’s no reason not to use a variable resistor in its place to charge up the capacitor more slowly. If you do this, note that the attack and decay potentiometers will interact, so it’s a little quirky, but what do you want for two diodes anyway? Also note that any other way you can think of delivering an interesting voltage to the junction of the two diodes is fair game.

The XOR-as-frequency-mixer technique is pretty great, but you can also get a lot of mileage by using the XOR as a logic chip. Combining different divided-down clock outputs (from a 4040, say) with XORs makes interesting sub-patterns, for instance. And we’ll get more use out of the XORs in two sessions when they’re coupled with shift registers.

Next Session

We’ve got a whole lot of possibilities by now. We’ve got some good, and some freaky, percussion voices. We’ve got a bunch of synthesizer sounds, and if you recall back to the 4051, we’ve got a good way to modulate them by switching different resistors in and out. It’s time to start integrating some of this stuff.

If you’re following along, your homework is to build up permanent (or at least quasi-permanent) versions of a couple of these circuits, and to get your hands on at least two 4017 decade counter chips. Because next week we’ll be making drum patterns and introducing yet one more way to make music.

Open Hardware for Open Science – Interview with Charles Fracchia

Open Science has been a long-standing ideal for many researchers and practitioners around the world. It advocates the open sharing of scientific research, data, processes, and tools and encourages open collaboration. While not without challenges, this mode of scientific research has the potential to change the entire course of science, allowing for more rigorous peer-review and large-scale scientific projects, accelerating progress, and enabling otherwise unimaginable discoveries.

As with any great idea, there are a number of obstacles to such a thing going mainstream. The biggest one is certainly the existing incentive system that lies at the foundation of the academic world. A limited number of opportunities, relentless competition, and pressure to “publish or perish” usually end up incentivizing exactly the opposite – keeping results closed and doing everything to gain a competitive edge. Still, against all odds, a number of successful Open Science projects are out there in the wild, making profound impacts on their respective fields. HapMap Project, OpenWorm, Sloan Digital Sky Survey and Polymath Project are just a few to name. And the whole movement is just getting started.

While some of these challenges are universal, when it comes to Biology and Biomedical Engineering, the road to Open Science is paved with problems that will go beyond crafting proper incentives for researchers and academic institutions.

It will require building hardware.

Continue reading “Open Hardware for Open Science – Interview with Charles Fracchia”

Time for the Prize: Big Water

I inadvertently started a vigorous debate a few weeks ago with the Time for the Prize post about a shower feedback loop. That debate was on the effect of curbing household water since households make up a relatively small percentage of total use. I think we should be thinking of solutions for all parts of the problem and so this week we’ll be looking for ideas that can help conserve water in large-scale use cases. Primarily these are agricultural and industrial but if you know of others feel free to make your case.

According to the United States Department of Agriculture, about 80% of all ground and surface water is used in agriculture. I’m not particularly interested in hearing a debate on water rights and the like (there’s a rather interesting article here if you want more on that). The agriculture industry produces food, and employs a lot of people. The conflict is of course long growing season versus lack of water compounded by severe drought. Even if we could move our food production elsewhere it would be a monumental undertaking to also relocate the infrastructure supporting it. Of course we need to look to the future, but can we leverage our engineering prowess now to conserve the water that is being used right now?

Enter with an Idea

Write down your ideas for agricultural and industrial water conservation as a project on Hackaday.io. Tag the project 2015HackdayPrize. Do this by next Monday and you’re in the running for this week’s awesome prizes.

You aren’t necessarily committing yourself to finishing out the build. At this point we want to get the idea machine rolling. One good idea could spark the breakthrough that makes a real difference in the world.

This Week’s Prizes

time-for-prize-prizes-week-3

We’ll be picking three of the best ideas based on their potential to help alleviate a wide-ranging problem, the innovation shown by the concept, and its feasibility. First place will receive a DSLogic 16-channel Logic Analyzer. Second place will receive a an Adafruit Bluefruit Bluetooth Low Energy sniffer. Third place will receive a Hackaday robot head tee.


The 2015 Hackaday Prize is sponsored by:

Build a Phased-Array Radar in Your Garage that Sees Through Walls

Until recently phased array radar has been very expensive, used only for military applications where the cost of survival weighs in the balance. With the advent of low-cost microwave devices and unconventional architecture phased array radar is now within the reach of the hobbyist and consumer electronics developer. In this post we will review the basics of phased-array radar and show examples of how to make low-cost short-range phased array radar systems — I built the one seen here in my garage! Sense more with more elements by making phase array your next radar project.

Phased array radar

In a previous post the basics of radar were described where a typical radar system is made up of a large parabolic antenna that rotates. The microwave beam projected by this antenna is swept over the horizon as it rotates. Scattered pulses from targets are displayed on a polar display known as a Plan Position Indicator (PPI).

Block diagram of a conventional radar system using a parabolic dish.
Block diagram of a conventional radar system using a parabolic dish.

In a phased array radar (PDF) system an array of antenna elements are used instead of the dish. These elements are phase-coherent, meaning they are all phase-referenced to the same transmitter and receiver. Each element is wired in series with a phase shifter that can be adjusted arbitrarily by the radar’s control system. A beam of microwave energy is focused by applying a phase rotation to each phase shifter. This beam can be directed anywhere within the array’s field of view. To scan the beam rotate the phases of the phase shifters accordingly. Like the rotating parabolic dish, a phased array can scan the horizon but without the use of moving parts.

Continue reading “Build a Phased-Array Radar in Your Garage that Sees Through Walls”

How to Build a Thermocouple Amplifier

A Thermocouple is a terrific way to measure temperature. The effects of temperature change on dissimilar metals produces a measurable voltage. But to make that measurement you need an amplifier circuit designed for the thermocouple being used.

Linear Technology LTC 1049 Low Power Zero-Drift Operational Amplifier with Internal Capacitors
Linear Technology LTC 1049 Low Power Zero-Drift Operational Amplifier
with Internal Capacitors

While researching “Zero Drift Amplifiers” as a follow-up to my video on Instrumentation Amplifiers I noticed the little schematic the front page of the LTC1049 datasheet which is shown here. I thought it was an ideal example of an analog application where some gain and some “gain helper” were needed to accomplish our useful little application of amplifying a thermocouple probe.

In the video I don’t really talk much about the thermocouples themselves other than the type I see most of the time which is type K. If you’re not already familiar with the construction of these probes you can find an informative write-up on thermocouples and the different types on the Wikipedia page and you might also want to check out the Analog Devices app note if you would like to know more. What I will cover is a reliable and precise way to read from these probes, seen in the video below and the remainder of the post after the break.

Continue reading “How to Build a Thermocouple Amplifier”

Time for the Prize: Aging in Place

Aging in Place is a growing issue facing the world. As the population begins to live longer, healthier lives we need to continue developing assistive technologies that will facilitate independence and safe living long into our twilight years. That is the topic of this week’s Time for the Prize. Enter your idea for Aging in Place by starting a project on Hackaday.io and tagging it 2015HackadayPrize. Do this by next Monday and you’re in the running for this week’s awesome prizes.

What is Aging in Place?

I use the “define:” search term on Google all the time and for Aging in Place it turns up the Center for Disease Control’s definition:

“the ability to live in one’s own home and community safely, independently, and comfortably, regardless of age, income, or ability level.”

I love this definition. How easy is it to get behind the concept of better quality of life for all as we age? Still not getting the thought process flowing? After listing the prizes I’ll illustrate a couple of projects that will give you a good idea of what people are working on.

This Week’s Prizes

aging-in-place-prizes

We’ll be picking three of the best ideas based on their potential to help alleviate a wide-ranging problem, the innovation shown by the concept, and its feasibility. First place will receive a RE:load Pro programmable constant current load. Second place will receive a Sparkfun Microview. Third place will receive a Hackaday CRT-android head tee.

 Hacks that Help

pill-reminderrx-timer-capsThe easiest examples I can think of relate to medicine. A lot of the time people can be independent and high-functioning as long as they take the right medicine at the right time. The simplest way to ensure this is to use technology that helps track medication schedules. Pill reminders can monitor a pill case, sending reminders to you if you miss your schedule, and alertimg family or caretakers if you don’t respond to the reminder.

We’ve also seen technology built right into the cap of the prescription bottle. These caps have a timer that resets to zero every time the bottle is opened. But anyone who has taken several medicines on different time schedules can tell you that this can still be very confusing. We wonder if anyone can prototype a system that would use computer vision to verify and log the pills each time you take them?

Of course the prescription reminders are just one of a multitude of low-hanging fruit. Safety is another aspect. Here’s an entry that seeks to give peace of mind that the stove is off for those dealing with Alzheimer’s or memory issues.

Now you see what we’re getting at. What ideas do you have that can move the goal of Aging in Place forward?


The 2015 Hackaday Prize is sponsored by: