Antenna Handbook

*SCAP' AVR Programmer

 By Michael Gaus (Germany)

Many newcomers to AVR programming would love to build their own low-cost programming device, but they face a chicken-and-egg problem: many of the designs themselves use an AVR microcontroller; this needs to be programmed, and so they first need to make a programmer...

This is where the SCAP (Serial Cheap AVR Programmer) can come in handy. It is a very simple programming device using a minimum of components, and it can be connected either directly to a PC's RS-232 interface or to a USB interface via a USB-to-RS232 converter.

The circuit includes a nine-way D-sub socket (K1) which can be connected to the PC's serial port or to the USB-to-RS232 converter. The circuit takes advantage of the internal protection diodes on the AVR's I/O pins to V cc and GND, and the two series resistors R1 and R2 are thus needed to limit the current flowing through these diodes. The values are chosen to keep this current below 1 mA. The RS-232 interface can be as high as ±15 V. At -15 V the AVR's internal protection diode to GND limits the voltage on the I/O pin to a minimum value of -0.7 V, while at +15 Vthe protection diode to V cc limits the pin voltage to a maximum value of V cc +0.7 V. Now, because the values of the series resistors R1 and R2 are relatively high, the charging and discharging of the AVR's input capacitance is considerably slower than if it had been driven directly by a push-pull stage, and this limits the maximum permissible frequency on SCK for reliable operation. The wiring of K2 corresponds to the standard six-way Atmel ISP connector.

The well-known open source program AVRDUDE is an essentially universal programming tool that can very easily be configured to work with SCAP: see [1] and [2]. The configuration file avrdude.conf needs to have the following section added to it:

This adds a new programmer called 'scap', which can then be selected as the device to be used for programming using the command-line option '-c scap'.

Even though the reset pin of the microcontroller is tied permanently to GND in the circuit, it must still be defined for AVRDUDE. If AVRDUDE fails to establish a connection with the AVR device to be programmed, the power to the device must be interrupted briefly to cause it to perform a power-on reset. Here is a sample command to invoke AVRDUDE. We have assumed that SCAP is connected to COM1 with an ATmega8 as the taret device (this corresponds to the commandline option '-p m8') and thatthe hex file to be programmed istest.hex.


avrdude 300 -


-P coml -p m8 -c scap U f lash : w : test . hex : i


The instruction to slow down SCK is specified by the command-line option '-i 300', which gives a delay of 300 jlls. This makes the programming operation rather slow. Depending on the type of interface used (normal RS-232 or a USB-to-RS-232 converter) it may be possible to reduce the delay value to as little as 50, which will make programming faster. If SCAP is being used just to solve the chicken-andegg problem mentioned at the start of this article, then programming speed will not be of any great concern

Internet Links

[1] AVRDUDE:

www.nongnu.org/avrdude/

[2] AVRDUDE version for Windows: www.mikrocontroller.net/ attachment/69851 /avrdude-5.1 0.zip

A Few DC Solid-state Relays

 By Georges Treels (France) (Elektor Electronics)

Good old electromechanical relays are relatively expensive where any significant current has to be switched and switching times must be short. One solution is to go over to solidstate relays (SSRs). In DC mode, MOSFETs offer a very interesting solution, and the various manufacturers today offer devices at less than £4 with amazing performance, in terms of both current and low R DS ( on y They're relatively simple to use, in both monostable and bistable modes, so why stint ourselves?



The following circuits will let you switch 10-60 A (or even more if you use configurations with MOSFETs in parallel), with very short switching times. Several configurations are shown, monostable and bistable, capable of switching a load with one side returned to either ground (high side switching) or the positive rail (low side switching). In addition, the monostable configurations offer galvanic isolation and can be driven by signals from 5-24 V, DC or AC. The bistable SSRs are controlled using a simple push-button and a little bit of logic.



Let's start with the monostable SSRs. Bridge B1 makes it possible to accept any input polarity in the case of a DC control signal, and rectifies the signal in the case of an AC control signal. The network R1, R2, D1 limits the LED current in opto-isolator IC1 . The base of the phototransistor in IC1 is connected to ground via R3; its emitter is connected directly to ground.



In the case of a load returned to ground, the gate of T1, a P-channel MOSFET, is driven directly from the collector of IC1. If the load is returned to the positive rail, the gate of T1, this time an N-channel MOSFET, is driven via T2, which inverts the output from IC1 .


C2, C3, D2, and D3 protect the MOSFET in the event of loads that are not purely resistive. Both bistable configurations use the same power stages as the monostables, with an N-MOSFET for loads connected to the positive rail and a P-MOSFETfor loads connected to ground.


IC1.A is wired as a simple flip-flop: with the switching threshold set by PI , IC1 .A output will change state each time button SI is pressed. R1 and CI avoid rapid oscillations while SI is pressed. IC1 gates B, C, and D directly drive the gate of the P-MOSFET in the case of a load returned to ground. IC1 .B inverts IC1 .A output when an N-MOSFET has to be driven (load returned to the positive rail). In both configurations, the relay remains off at power-on (safety feature).


Concerning the MOSFETs, the table lists a number of possible types. This list is far from being exhaustive and new devices come out regularly. Give preference to a low value of R DS(on) (dissipation) and a good dv/dt specification in the case of 'dirty' loads. Pay attention also to the V DS . Even though most of these transistors can take 60 V, this is not the case for either the optoisolators or the bipolar transistors used.

If you are designing a PCB for this type of relay, pay attention to the possibility of heavy currents being carried by the PCB track. For example, three SUP75P03-07 wired in parallel can pass over 200 A! Bear in mind that a PCB track with a copper layer 35 jam thick (i.e. standard) has a resistance of 48* 10 5 x L/ Wohms, where L(ength) and W(idth) are in mm.



Wideband PC Radio

 

PC radios are certainly nothing unusual. However, unless you are prepared to spend a lot of cash you can't buy a wideband PC radio that receives short-wave signals — if you want one that will not break the bank, you will have to build it yourself. There's no need for a battery or power supply, since power can be drawn directly from the PC serial interface. The audio signal is fed into the PC sound card. The circuit diagram in Figure 1 shows this simple audion receiver. The transistor in the common-emitter circuit demodulates AM signals, thanks to its exponential characteristic curve. Since the base-emitter junction is already biased, RF potentials of a few millivolts are sufficient to achieve demodulation. For this reason, the audion circuit is significantly more sensitive than a simple diode detector.


So where is the tuning capacitor? It's not needed, since the receiver has an extremely wide bandwidth and (simultaneously!) receives all strong signals ranging from the 49-m band to the 19-m band. The coil is wound in two layers with 15 turns on a pencil. This yields an inductance of around 2 uH. The resonant circuit capacitance of around 100 pF is composed of the base capacitance of the transistor and the aerial capacitance. This places the resonant frequency at around 11 M Hz. The low input impedance of the transistor damps the resonant circuitto the pointthat its Q factor is 1, so the bandwidth is also around 11 M Hz. The receiver thus picks up everything between 6 MHz and 17 MHz. This complete elimination of the usual selection leads to surprising results.


Less is more. For communications technicians, this means: less selectivity = more bandwidth = more information. Indeed, here you dive into a sea of waves and tones. The special propagation conditions for short-wave signals cause first one signal and then another signal to predominate. You hear messages in several languages atthe same time, music ranging from classical to pop and folk songs from distant countries. Without the bother of the usual dial spinning, you can roam at your leisure through the entire short-wave region.


The supply voltage for the radio must be first switched on by using a program (HyperTerminal is adequate) to switch the DTR lead of the serial interface from -10 V to +10 V. If you want to avoid this trouble, you can use a PNP transistor. The alternative circuit diagram shown in Figure 2 shows some additional improvements. The coupling capacitor prevents the dc component from reaching the input of the sound card, and residual HF components are shorted out by the parallel capacitor. With these modifications, the radio is also quite suitable for direct connection to a stereo system, final amplifier or active speaker. In such cases, you can do without the PC and use a battery (1.5 to 12 V) instead. A downpipe from the eavestrough can be used as an aerial if it is insulated at its lower end (where it connects to the sewer system) by a rubber ring or concrete. If you are not so fortunate as to have access to such an arrangement, you will have to rig a wire aerial (at least 5 m long).

source : Elektor Circuit Collections 



Pressure Switch

 

A simple pressure switch with a range of 50 to 350 mbar can be made using a pressure sensor. If you can accept somewhat reduced linearity, the sensor can even be used up to 500 mbar. As shown in the schematic diagram, the circuit contains very few components other than the sensor. Dl, Rl, CI and D5 form a simple voltage stabiliser that holds the supply voltage for the sensor and opamps at 5 V The three diodes in series with the sensor provide temperature compensation (more on this later). The differential output signal from the sensor is amplified 30 x by an instrumentation amplifier composed of opamps ICla, IClb and IClc. 


The amplification factor can be adjusted if necessary by modifying the value of R10. The amplified output signal is compared to the voltage on the wiper of PI. If the voltage that results from the pressure being measured is less than the value set by PI, the output of comparator ICld is High and LED D4 is on. An external load can be switched via the open-collector output of T2. 

We used a Melexis MLX90240 sensor (www.melexis.com), but unless you work in the automotive industry, you won't be able to obtain this sensor. An Exar sensor (such as the SM5310-005-G-P; see www.exar.com) or a Motorola type can be used instead. If necessary, the circuit can bemodified as described below. Start with the sensor sensitivity specification from the data sheet (approximately 60 mV/bar/volt in our case). Since the supply voltage of the sensor is 5 V minus 3 diode drops, or around 3 V, the net sensitivity is thus 180 mV/bar. 

The range of the sensor is 0 to 350 mbar, so the maximum output voltage is 63 mV. The following amplifier has a gain of approximately 30, so the output signal ranges between 0 and 1.89 V. This voltage is compared to the voltage on the wiper of PI, which can be varied between 0 and 2.5 V. If the sensitivity differs from the nominal value, the amplification can be adjusted as necessary using R10. 

Finally, a remark on the temperature compensation. The sensor used here has a temperature coefficient of 2100 ppm/degree. 

Other types of sensor will have somewhat different values (consult the data sheet). The supply voltage should thus increase by 2100 ppm of 3 V for every degree, which is 6.3 mV per degree. The voltage across a silicon diode drops approximately 2 mV per degree, so the supply voltage of the sensor increases as the temperature increases. This compensates for its decreased sensitivity. With the indicated sensor, three diodes in series are needed to just about fully compensate for its temperature coefficient. Two diodes are sufficient for the previously mentioned Exar sensor.

PC Battery Charger

 Some workbenches can't help ending up looking like a rats nest of cables and equipment, so its always an advantage if a piece of mains equipment can be removed from somewhere to free up an extra mains socket. Here we are using the ubiquitous PC as a battery charger. An unused serial interface port can supply enough current to charge (or trickle charge) lowcapacity Nickel Cadmium (NiCd) batteries. You could for example, use the batteries in a radio and charge them during use.

The three serial port connections TxD, DTR, and RTS, when not in use, are at -10 V and can supply a current of around 10 to 20 mA (they are short-circuit protected). The circuit shown supplies a charging current of approximately 30 mA. If it is necessary to alter the polarity of the charging circuit then it is a simple job to reverse the diodes and using software, switch the port signals +10 V. Those interested could also write a software routine to automatically recharge the batteries.