Magazines: AutoSpeed  |  V8X  |  Silicon Chip  |   Property News  Shopping: Adult Costumes  |  Electronics  |  Cars  |  Fishing
Email Address:
Password:

Lost your password?

Article Search

Circuit Notebook

(1)Using DR Video MK2 To process NTSC Video; (2) Room Recorder (Simple Microphone Preamp); (3)An Accurate Reaction Timer; (4)Picaxe-Based Cable Tester;(5) How To Connect Two PC's Using Modems; (6)Picaxe Code Stops False Triggering; (7)Stepper Motor Controller.

 Advertisement
Advertisement 

Using Dr Video Mk2 to process NTSC video

Click for larger image

As described in the June 2004 issue of SILICON CHIP, our improved Dr Video Mk2 stabiliser is only suitable for processing PAL standard video signals. However, if you’d like to be able to use it for processing NTSC standard signals as well, it can be modified fairly easily to allow this.

The modification involves adding a switch to change the decoding of line counter (IC7), so that the start of the gating pulses for Macrovision ‘EOF’ pulses is changed to suit the different number of lines in an NTSC video field (525/2 = 262.5, rather than 625/2 or 312.5 lines in PAL).

Click for larger image

There are three inputs of decoder chip IC8 which need to be switched, as shown in the diagrams. This can be done fairly easily using a 3-pole double-throw miniature toggle switch, which can be mounted in the centre of the Dr Video Mk2 front panel. The existing tracks on the top of the PC board connecting to pins 3, 4 & 6 of IC8 need to be carefully cut as well, in the positions shown. This can be done using a small hobby knife.

The connections between the added switch and the PC board should be clear from the diagrams. Note that all of the wires connect directly to the pins of IC7 & IC8 on the top of the board. Make all of these soldered connections with an earthed low-power soldering iron and do the job quickly so you don’t overheat the ICs.

When the modification is completed, added switch S1 is used to set the Dr Video Mk2 for processing either PAL or NTSC video as desired.

SILICON CHIP.

Room recorder

Click for larger image

My wife was working on a doctoral dissertation and needed to do some field work involving personal interviews in various settings. What would be the best way, technically speaking, to record the interviews?

To pass a tape recorder or microphone back and forth seemed too awkward and clipping wired microphones to interviewees didn’t make for a particularly informal atmosphere. Radio microphones seemed overly expensive, too. After some thought, I can up with the "Room Recorder", an add-on microphone preamplifier circuit for use with a tape recorder.

While I don’t make any great claim to originality for the circuit, it has produced first class results over one year of interviews and might prove useful to anyone doing similar work.

The preamplifier was plugged into a Sony Cassette-Corder (any similar device will work) by means of a long, screened microphone cable and placed in a central location in a room or on a bench. The circuit will pick up every whisper, so background noise should be considered when choosing a location.

A 2-terminal electret microphone picks up the sound, which is then amplified by a TL071CN low-noise op amp. Note that the microphone’s negative terminal is connected to its case.

Negative feedback is applied to the inverting input through a 10kΩ resistor. Increasing the value of this resistor will increase sensitivity, and vice versa. For ease of use and quietness of operation, the circuit is powered from a 9V battery. The power switch is mounted on the case.

The circuit draws about 2mA and would therefore give about 10 days continuous service from a 9V alkaline battery.

Thomas Scarborough,
South Africa. ($25)

An accurate reaction timer

Click for larger image

Add a cheap stopwatch to this circuit to produce an accurate reaction timer. The circuit is wired in parallel with the start/stop button in the watch via a 2.5mm socket, which fits snugly in one corner of the casing.

The person conducting the test (the "tester") resets the stopwatch and turns on the reaction timer’s power switch (S3). The person being tested (the "subject") places his or her fingers near the "STOP" push-button switch (S4). Next, the tester covertly sets a delay time with VR1 and selects either the LED or buzzer alarm via S2.

To initiate the sequence, the tester then presses the "START" switch (S1). This triggers 555 timer IC1, which is wired as a monostable. Its output (pin 3) goes high for 2-12 seconds as determined by the setting of VR1. At the end of this delay pin 3 goes low and triggers IC2, another 555 timer in monostable mode.

The output from IC2 (pin 3) activates the alarm (buzzer or LED) for about 0.5s. After inversion by Q1, it also triggers IC3, another 555 monostable. The positive pulse from IC3 turns on Q2, briefly closing the start/stop switch circuit in the watch.

The watch starts to count up. After a short period, the subject reacts to the alarm and pushes the "STOP" button (S4), freezing the stopwatch. The reaction time can then be read off with 1/100th of a second accuracy.

Comparative reaction times could be measured when a subject is: rested or tired, silent or talking, before or after a night out, using a mobile phone, etc. For motoring realism, rig up dummy accelerator and brake pedals, with the brake switch making the stop contact. Or take it to your club and test people as they enter and after they’ve been "steadying their nerves" at the bar.

A. J. Lowe,
Bardon, Qld. ($40)

PICAXE-based cable tester

Click for larger image

This cable tester can test loose cables (where both ends can be brought together) and installed cables (where the cable ends are remote from each other) with up to three conductors.

For all loose cables and for installed cables where at least two conductors are working, it tells you exactly which pins of the cable are connected to each other.

The tester consists of two parts: (1) the local unit, which contains the PICAXE-08 and power supply; and (2) the remote unit, which is passive. Both units have one LED for each pin.

The tester indicates which pins are connected together by flashing the associated LEDs. The number of flashes is equal to the lowest numbered local pin of the group. For example, if local pins 2 & 3 and remote pins 1 & 3 are all connected together, the LEDs associated with those pins will all repeatedly flash twice.

The LEDs associated with any remote pins that are not connected to a local pin will remain off. Nevertheless, there may be connections between one or more of the remote pins. These can be found by swapping the local and remote units of the tester to the opposite ends of the cable.

The return link is used when a loose cable is being tested and both parts of the tester are close enough to connect together. Using this method, the tester will give correct indications for cables with any number of working conductors. Note that without the return link, no remote LEDs will light unless there are at least two separate conductors connecting the local and remote ends of the cable (it doesn’t matter which pins these connect).

As shown on the circuit, each local pin of the cable is connected to an I/O pin of the PICAXE-08. The PICAXE-08 program pulses the pins to flash the associated LEDs.

The program considers each local pin in sequence. If a pin has already been pulsed in the current round it is skipped, otherwise it is pulsed. However, the program cannot pulse each pin individually, because it could be connected to other local pins. This would drag its voltage to an indeterminate value. Instead, the program first identifies all other local pins that are connected to that pin (call them the "P" pins) and pulses them low in unison. The remaining pins ("non-P" pins) are held high during the pulse.

Operation of the remote LEDs is as follows: with the return link in place, +4.5V is applied to the anodes of the remote LEDs. If the return link is absent, diodes D1-D3 provide power to the LEDs instead, assuming at least one of the remote pins is connected to a local "non-P" pin. Each of the remote pins that connect to local "P" pins will be low and therefore the associated LED will light.

Following each pulse, the program sets all pins to be high outputs, turning all LEDs off. The best way to avoid being overwhelmed by all the flashing is to focus on one LED at a time and shield the others from sight.

It should be possible to expand the tester to deal with more lines by using a PIC16F84 which has 13 I/O pins, each of which can sink or source up to 25mA. Because each pin must potentially sink current for every LED, the LED current should be set to about 1mA. This can be achieved by replacing the 1kΩ
resistors with 3.3kΩ resistors. It would be advisable to use high-brightness LEDs at this current level.

Andrew Partridge,
Kuranda, Qld. ($45)

'-----------------------------------------------------------------

' PICAXE-08 Cable Tester

'-----------------------------------------------------------------

'

' Hardware:

'

' PIN1 (leg 6) is local pin 1

' PIN2 (leg 5) is local pin 2

' PIN4 (leg 3) is local pin 3

'-----------------------------------------------------------------

symbol zero = %00000000

symbol local_pins = 3 'number of local pins to test

symbol P = b1 'current pin (range: 1 to local_pins)

symbol count = b2 'count of pulses so far on the P pins

'(range: 1 to P)

symbol P_bit_low = b3 'bitmap with pin P low, other pins high

symbol P_bit_high = b4 'bitmap with pin P high, other pins low

symbol P_pins = b5 'bitmap: set of local pins connected to pin P

symbol yet_to_test = b6 'bitmap: set of pins yet to test

symbol test_bit = b7 'result of testing if P is in yet_to_test

symbol dummy = %00000000

symbol local1_high = %00000010

symbol local2_high = %00000100

symbol local3_high = %00010000

symbol all_high = %00010110

symbol local1_low = %00010100

symbol local2_low = %00010010

symbol local3_low = %00000110

symbol all_low = %00000000

loop:

let yet_to_test = all_high 'initially we are yet to test all pins.

for P = 1 to local_pins

' Skip pin P if already pulsed (ie, if it is not in yet_to_test)

' Set P_bit_high to a byte with the pin P bit high and all other pins low.

' The first entry in the table is a dummy because P is never zero.

' The second entry is for local pin 1, the third is for local pin 2,

' and so on.

lookup P, (dummy, local1_high, local2_high, local3_high), P_bit_high

let test_bit = P_bit_high & yet_to_test 'test_bit is non-zero if

'P in yet_to_test

if test_bit = 0 then skip_pin

' Set P_bit_low to a byte with the pin P bit low and all other pins high.

' The first entry in the table is a dummy because P is never zero.

' The second entry is for local pin 1, the third is for local pin 2,

' and so on.

lookup P,(dummy, local1_low, local2_low, local3_low), P_bit_low

' Find the set of pins connected to pin P.

' Do this by taking pin P low and leaving all others as inputs.

' Any inputs that then read low must be connected to pin P, so they

' are removed from the yet_to_test set.

let dirs = P_bit_high 'pin P is output, others are inputs

let pins = P_bit_low 'take pin P low

let P_pins = pins 'P_pins is the set of pins that read as low

let yet_to_test = yet_to_test & P_pins 'do not test the other

'pins that went low

let dirs = all_high 'set all pins to outputs

' Pulse all P_pins P times.

for count = 1 to P

let pins = P_pins 'take the group of connected pins low

pause 200 ' for 200ms

let pins = all_high 'take all pins high

pause 200 ' for 200ms

next count

' If all the local pins are connected together, pause a while

' longer so the end of the flashing sequence can be distinguished.

if P_pins <> all_low then no_pause

pause 800

no_pause:

skip_pin:

next P

goto loop

end

How to connect two PCs using modems

Click for larger image

Have you ever connected two PCs together via modems using a twisted pair cable and nothing happened? That’s because the modems are expecting a phone line with all the signals and voltages supplied by the local telephone exchange.

This circuit simulates the DC power and signal isolation but not the "dial tone" or the "ring signal". It suffices to connect two PCs together to communicate and exchange files using HyperTerminal.

The circuit is self-explanatory and needs only one power supply for both modem lines. Although 50V DC is the usual exchange line voltage, this circuit should operate down to 20V. A 600Ω line transformer (eg. Jaycar cat. MM-1900) provides signal isolation, while the resistors provide current limiting and keep the lines as balanced as possible.

When using this set-up with HyperTerminal, you should not select a Windows modem driver in the "Connect To" dialog. Instead, connect directly to the relevant COM port. Next, verify that the modems are working by sending information commands such as "ATI1" or "ATI3". If you don’t get a response using these commands, try resetting the modem(s) using the "AT&Z" command.

Assuming you do get a response, set one in originate mode using the "ATD" command and the other in answer mode with the "ATA" command. If all is well, you should now be able to type in one terminal window and see the results echoed in the second PC’s terminal window. To return to control mode, type "+++".

The advantage of using modems instead of a serial cable between COM ports is that the two PCs can be kilometres apart instead of a few metres. For example, you could connect the house PC to the workshop PC on the other side of the farm.

Filippo Quartararo,
Tranmere, Tas. ($25)

PICAXE code stops false triggering

Does your homebrew PICAXE project behave abnormally when you use long leads to connect to sensors and switches? If so, it could be due to electromagnetic radiation from the mains that occurs during appliance switching. This can induce large voltages across the sensor leads – large enough to false-trigger the high-impedance port pins.

Newcomers to the PICAXE micro may not be aware of one possible solution to this problem, which can be summarised as follows:

Assume that a program is waiting for a particular input pin to go high before performing a particular function. When that pin does go high, a short delay is executed and the pin state is read again. If it is still high, then the function is executed. If not, the original high is ignored; it is assumed to be "noise induced".

Below is a condensed section of code that demonstrates the method. In this case, an IR sensor and switch are wired up with long leads to PICAXE port pins 3 & 4.

Initially, the program determines day from night by reading an LDR connected to the ADC input. Assuming the result is night, pins 0 & 2 are driven low and the program reads the inputs on pins 3 & 4.

If the sensor tied to pin 3 reads high, the program branches to label both. After a pause of 200ms, pin 3 is examined again. If it is still high, the program continues, otherwise no action is taken and the program simply loops back. The same method is used to de-glitch pin 4. Depending on the application, you may need to shorten the delay time so that genuine pin changes are not ignored.

Paul Walsh,
Montmorency, Qld. ($20)

'--------------------------------------------------
' Example code to reject noise-induced
' state changes on PICAXE port input pins.
'--------------------------------------------------
main:
  readadc 1,b0
  if b0>50 then daylight
  if b0<=50 then night

night:
  low 2
  low 0
  if pin3 = 1 then both  
  if pin4 = 1 then light
goto main

both:
  pause 200  'wait awhile
  if pin3=0 then main 'ignore pin change
   'if not still high
  high 2    
  high 0
  goto main

light:
  pause 200  'wait awhile
  if pin4=0 then main 'ignore pin change
   'if not still high
  high 2    
  goto main

Stepper motor controller

Click for larger image

This circuit improves on a typical PWM (pulse width modulated) stepper motor driver by reducing the drive current to the motors when they’re not in motion. The result is a significant reduction in motor heat and driver dissipation.

Stepper motor controllers, such as the L297 in this design, utilise PWM chopper circuits to control motor current. When there is no activity on any axis, considerable heat is generated by the holding current of the motor. Switching the motor off for the duration of inactivity is not the answer as it is quite possible to lose position under these circumstances. The solution suggested here simply involves reducing drive current a short time after each step command.

The L297 senses peak motor current via two 0.47Ω resistors connected between pins 13 & 14 and ground. The peak level is regulated according to the reference voltage on pin 15, which is instrumental to this design.

Normally, a fixed reference voltage would be used here to match the current rating of the motor. However, this design can apply two different reference voltages with the aid of a MOSFET switch and a little extra circuitry, as follows:

During normal operation, pulses on the "STEP" input command motor movement via the L297s "CLK" pin. In this design, the "STEP" input is also used to trigger a 555 timer (IC3). The 555 is configured as a monostable, with its period determined by the 10MΩ resistor and 220nF capacitor connected to pins 6 & 7.

The output pulse from the 555 is inverted by transistor Q1 and applied to the gate of a MOSFET switch (Q2). A VN0106 type MOSFET is used here but just about any device with a low drain-source "on" resistance would be suitable.

In operation, the MOSFET gate is pulled down near ground potential for the duration of the monostable pulse width (about 2s), holding it off. In this state, the reference voltage to the L297 is determined solely by trimpot VR1.

When the monostable expires, transistor Q1 switches off and the gate of Q2 is pulled up to +5V via 4.7kΩ & 10kΩ resistors. This switches Q2 on, connecting a second trimpot (VR2) in parallel with the first.

The end result is two adjustable reference voltages, generating two different motor currents. With no step pulses on the input, the reference voltage is reduced by the second trimpot, thereby reducing motor current.

A single axis prototype was build using this circuit with excellent results. There are no missing steps, the heatsink for the L298 full-bridge driver stays a lot cooler and there is much less heat in the motors when stationary.

Peter van der Velden,
Flagstaff Hill, SA.

Share this Article

 RSS  |  Privacy Policy  |  Advertise  |  Contact Us

Copyright © 1996-2012 Silicon Chip Publications Pty Ltd & Web Publications Pty Limited. All Rights Reserved