Pyroelectric detectors
21.07.2006 21:32
Pyroelectric sensors (elements used in motion detectors) are sensitive to mid and far infrared wavelengths. Most sensors also have an additional filter in front of the actual pyroelectric material that further narrows the band of detectable wavelengths. For example, sensors for body motion detectors (in security systems, automatic light switches, etc.) have peak sensitivity at 4.5μm (source - which, by the way, seems a bit strange as a black body at 37°C emits most radiation at 9μm according to Wien's law).
Now if you compare this to transmission curves for common types of glass you can see that such sensors do not work if they are behind a glass window.
Why is this suddenly interesting to me? Because I just spend two days building a casing for a device I made and now it turned out that its PIR sensor can't see through its nifty small glass window. And of course just about the only thing that is not easily removable is the glass (it's glued to its frame with silicone glue). Now it looks like the only thing I can do is to start breaking things apart...
Part of a Multivac?
22.06.2006 19:03
In a lot of science fiction stories Issac Asimov mentions Multivacs. They are usually described as a very large (read city-sized) analog or digital computer built with magnetic relays (and in later stories with vacuum tubes). Multivacs also had a lot of nifty properties (like being capable of learning and solving world's economic problems) that our present-day microprocessors still lack although they are probably an order of degree more complex than a city-sized relay circuit.
Anyway, when I saw this circuit I immediately thought of a Multivac. This is probably what a small piece of it would look like if anybody actually built one.
This is actually the lower part of a Wolkswagen Golf's fuse & relay box (Mk II, in production from 1983 to 1991 according to Wikipedia). It looks like this with the cover on.
Recycling old power supplies
28.05.2006 14:49
Power supplies from old PCs can be quite useful. They are a lot more powerful than anything you might build yourself (building line-voltage switchers isn't something you would want to do as a hobby and 200W transformers for a RC-rectifier aren't easy to find). Plus you can usually get them for free.
This old 200W AT power supply will serve as a four-voltage lab power supply from now on. The conversion actually didn't involve any work with electronics. I basically only cleaned the interior, painted the casing, drilled some holes and added connectors. It took a day of work and some 10€ worth of material (paint, connectors and an on/off switch).
The regulation isn't perfect of course. This type of power supplies only regulates the +5V output, so other voltages are a bit off if the +5V line isn't loaded.
Comparator tricks
17.05.2006 22:03
(from the what-have-i-learned-last-two-weeks-designing-that-switcher dept.)
Problem:design a circuit that will compare a voltage against a voltage reference. The circuit has to have a specific hysteresis. The voltage you have to compare has sharp positive and negative voltage spikes that are larger than the wanted hysteresis of the circuit.
Wrong solution:
You might think that R1 and C1 will work as a low-pass filter that will filter out the spikes. In theory, this is correct. However by adding C1 you practically removed any hysteresis for high frequency signals from this circuit. Why? Because R3 is usually in the order of megaohms (i.e. much larger than R1 and R2). This means that before the output signal from the comparator gets through R3 - C1 filter to provide positive feedback, another spike can flip the comparator in the other direction (and there will always be some spikes on the positive input of the comparator since there is no ideal low-pass filter).
Right solution:
So, the right way to handle this is to have a separate low-pass filter R4 - C2 on the input to reduce the voltage spikes below the circuit hysteresis. R4 is something like 10 to 100 times smaller than R1 and R2 to remove the effect of the filter on the hysteresis for high frequency signals described above. Also C1 (around 100pF) helps with any spikes that would make it through the filter by effectively disabling the comparator for a short time after it flips from one state to the other.
Spectrum dc-to-dc converter
10.05.2006 23:07
Sinclair Spectrum has a small DC-to-DC converter on the motherboard. Together with a standard 7805 linear regulator it provides -5V and +12V voltages required for various CMOS chips in the computer and is a little marvel of analog electronics of its own. It manages to perform its function with just two transistors and a couple of diodes, compared to hundreds in modern converters.
I haven't found any description of this type of converter on the web and I really think it deserves one, so I'm posting it here (it took me quite a while to figure it out):
Two voltages enter into the circuit: on the left edge is stabilized +5V from the 7805 and on one end of the right coil is an unstabilized voltage (around +9V) from the transformer in the power brick.
How it works? Let's say there is already a voltage on the +12V line on the top right. You can notice that the voltage divider R59 - R58 divides this voltage down to around +4.3V (also notice the big capacitor C74 - the divider also works as a low-pass filter and has a large time constant of around 5ms). From here, we can see that the PNP transistor TR5 works in the active region. Ueb is around 0.7V while collector has a relatively small resistance R60 in series. The constant collector current from the transistor charges C43 and C77 (you can ignore R61 for the moment). Let's say that the NPN transistor TR4 is closed at the moment. There is no current in the coils and the voltage on C43 and C77 is equal to the base voltage of this transistor.
When the voltage on the capacitors reaches around 0.7V, TR4 opens. Suddenly, there is a constant 9V of voltage on the right coil. The current in the right coil begins to rise linearly and, because the coils are coupled, a voltage of around +3V appears on the left coil (notice the ratio of number of turns and the polarity). This increases the base voltage and further opens the TR4. However, TR5 now can not provide enough current that is flowing into the base and C43 and C77 begin to discharge. When they discharge to around -2.3V, TR4 closes. Since current flowing in the right coil can not stop so quickly it flows through D15 and charges C44, which raises the 12V line a bit. With the TR4 closed, TR5 can again begin to charge C43 and C77 until TR4 again opens and the cycle repeats.
There is of course a negative feedback loop here: When the voltage on the +12V line increases, the voltage of the voltage divider closes TR5 a bit. This means lower collector current and slower charging of C43 and C77 and longer time interval between cycles. Voltage stabilized by 7805 basically works as a reference for the +12V line.
-5V line on the other hand is a standard charge pump. It uses the approximately square voltage on the TR4's collector to discharge C46 through D11 when the voltage is high and charge it into C47 when the voltage is low. Zenner diode D16 serves here as a voltage reference.
Why there is a -12V line marked here is a bit of a mystery for me, because the voltage on that line is neither constant nor negative.
How it starts? At power-up, +12V line is at +9V (charged up through the coil and D15 with TR4 closed). TR5 is fully opened and C43 and C77 quickly charge up. Transistor quickly opens fully and a current begins to flow through the coil. Here possibly R61 comes into play (I'm not entirely sure) and prevents TR5 from keeping C77 charged long enough for TR4 to close and raise +12V enough to close TR5. On the simulation below, you can see a large overshoot on the +12V line at start-up
At the end a few notes about failure modes (while this circuit is ingenious, it also seems to be the most common thing that fails in spectrums, according to various web forums I've seen): If for any reason the oscillator does not start TR4 will remain opened and will short-circuit right side of the coil. A couple of amperes will flow trough, destroying TR4 and possibly also the coil. How can this happen? My tests show that if the +12V line is overloaded (due to a shorted RAM chip, for example, or a shorted electrolytic capacitor), the circuit will self destruct. Another important thing to note is that this circuit will not work (and will again self destruct) if the supply voltage (voltage from the power brick) is higher than 12V. This is not such a remote possibility - I have here an original Sinclair power brick that gives out 15V and will happily destroy any spectrum that will be connected to it.
Unfortunately TR4 has to survive large base currents and large collector voltage spikes from the coil. It's not very easy to get such transistors on the market. I'm currently experimenting with a ST13001 transistor I got from old "energy saving lamps" and it seems to be working fine here (by the way: these lamps use a similar simple oscillator design, although they use rectified network voltage of around 300V instead).
Another point is that the -5V supply will work better on lower supply voltages (lower supply voltage, higher switching frequency due to less current pushed through D15 at each cycle. Charge pump can pump more charge if the frequency is higher).
I'm not quite finished with experimenting with this circuit. At the moment, I'm testing how tolerant the circuit is to different coil inductances. I have no idea what inductance the original coil in the spectrum has, but I tried did a guess at 100μH/900μH and the converter seems to be happy with it.
Update: TR5 works in active region, not saturation. I guess I got used to MOSFETs too much.
On switchers
09.05.2006 0:44
Past two weeks I've been working on a small step-up switching power supply for a solar cell powered device (maybe I'll write some more about that thing later).
The basic design looks like this: Small solar array (for cca. 10 Euro) charges two NiMH batteries. Switcher then converts 2.0V - 2.4V voltage from the batteries to a more or less stable 9V that are needed by the device (which draws 100mA or so in peaks a couple of times per day, and around 1mA otherwise)). I designed the switcher around MAX641 chip which turned out to be a really good idea so far. In contrast with other switcher controller chips it has no feedback loop that varies the duty cycle of the pulses (duty cycle is constant 50%). This way a lot of the usual stability problems disappear and I got the basic circuit working in no time. The drawback is the circuit never works in the continuous mode with such a design and you get larger output voltage ripple (but that is not really a problem here)
After some experimenting with different inductors I got the more or less constant efficiency of the conversion of around 80% at full power over entire input voltage range, which is not bad. Selecting the right inductor was tricky though. The formulas for calculating the inductance in the manufacturers application do not help: our shops with electronic supplies either do not sell ferrite cores or sell them, but do not know the properties of the material they are made of. Any calculations are therefore completely out of the question and you are left with trial and error. A thing I really should remember for the next time I'll be doing something like this is not to even consider cores without an air gap. It turned out that after cut an air gap into the core, almost anything resembling a ferrite works.
Anyway the thing that has been really getting on my nerves since the last weekend is that when the switcher is working, analog electronics in the vicinity seems to go completely nuts. For example a simple circuit for low battery voltage detection (needed to prevent damaging NiMH cells by deep discharge) is simply ignoring all common sense any refuses to work correctly no matter what I do. I already redesigned the circuit board layout two times to minimize interference between the switcher's power electronics and control electronics with no luck...
So a couple of minutes ago when I was looking for some ideas in the Art of Electronics I found this quote:
Switchers are noisy - they will ruin your life.
Encouraging, isn't it?
No, I won't fix your amplifier
14.03.2006 11:26
To all people sending me mail about the Kenwood KA-1000 amplifier: I don't know where you got the idea that I did any repairs on this type of amplifiers and that I'm offering you a free support line.
Chandra will be down for repairs
25.02.2006 20:57
My server that runs services at tablix.org will be down tomorrow for a few hours because of a number of hardware and software repairs. DNS resolving problems, bounced emails, unavailable web pages and all sorts of other weird phenomena can be expected.
It turned out that my EN-X temperature control circuit has a bug and can burn out one of the operational amplifiers if you turn the temperature setting knob too fast in either direction. This problem didn't look very serious when I first noticed it a few months ago because temperature regulation still seems to be working. However I'm not really happy with one of my machines running with a half-working CPU fan. And since I now also have a list of some other tasks that involve a reset (like a kernel upgrade and some UPS rewiring) I decided it's finally time to trow away those 200 days of uptime.
Heat pipes
12.02.2006 18:12
Microwave ovens
11.01.2006 15:44
This description of the microwave oven I found in the Slovenian translation of How things work by Steve Parker is terribly wrong.
It says that there is a fan with reflective blades that reflects microwave rays into the interior of the oven in random directions to ensure that the food is evenly cooked.
This can't be further from the truth. First, you can't even speak of microwave rays in this context. Microwave ovens operate at the frequency of 2450 MHz which means that the wavelength of the microwaves is around 12cm. This is large enough to be comparable with the dimensions of the oven. It means that propagation of radiation can't be modeled with rays at all as this is only acceptable when the wavelength is very small (for example for visible light).
In reality the microwave oven is designed so that the radiation inside behaves in a predictable pattern called a standing wave. This has something to do with better energy efficiency but also has the side effect that some spots in the oven will be heated more than others. In fact you can use this effect to measure the speed of light with chocolate cookies (there is a web page about that somewhere, but I can't find the link right now).
I know this is a book intended for kids, but I believe there is a big difference between giving a simplified explanation and giving a completely wrong explanation because children can't understand the correct one.
Funny noise
04.01.2006 13:07
I nominate popcorn noise for the best named phenomenon in the MOS field effect transistor.
Applied transmission line theory
17.12.2005 20:00
Microstrips are cool
29.11.2005 19:35
The PCB Trace Impedance Calculator is incredibly useful, even if you aren't into microwave circuits and transmission lines.
For example: I was worried that the guard ring and ground plate I made around the lines leading from quartz crystal to the CPU on my keylogger PCB will significantly affect the capacitance from these lines to the ground. So I've entered the correct geometry into the calculator and it returned that the parasitic capacitance to ground is around 2pF/inch. Since these lines are around an inch long the parasitic capacitance is well within the tolerance limits (Atmel says that the capacitance to ground must be 30pF± 10pF) and I can be sure the oscillator will work fine.
