Continued from: A
remote control system part 1, which gives
details of the radio transmitter and receiver modules.
The first part of this article in Electronics in Meccano issue 11 explained how radio transmitter and receiver modules can be used to send a signal. The signal from the receiver module was capable of switching on and off one device, so how can we make it control more than one?
The answer is to send a train of pulses serially using the transmitter, receive them using the receiver and decode them in order to switch on and off several devices.
This is what the Holtek HT12E and HT12D ICs do - the HT12E is an encoder and the HT12D is a matching decoder.
Both ICs require a regulated 5V DC power supply because of the oscillator resistor values chosen for each IC.
The HT12E
Encoder
![]() |
HT12E Encoder Datasheet 927Kb |
The pinout diagram of the HT12E is shown in figure 2.
The D0 - D3 Data inputs (pins 10 to 13) to the encoder have been connected to two centre-off Single Pole, Double Throw (SPDT) switches as shown in the transmitter circuit diagram of figure 4. These switches will form the on/off/direction controls for the two motors that we will be controlling remotely.
There are eight inputs to the IC (pins 1 to 8) called the Address inputs. These tell the encoder which address to send. The decoder IC HT12D also has these inputs - the addresses on both ICs must match for the Data to be valid.
Each Address pin may be connected to 0V or 5V. In this project I have connected them all to 0V, so the address is set to 0d on both ICs. If you were to connect all the Address pins to 5V, then the address would be 255d - thus there are 256 possible addresses available. So, if you wanted to, you could set up switches to control one or more of the encoder Address pins, and then have several decoders, each set to a different address.
There are two more pins on the encoder. Pin 14 is an input called Transmit Enable (TE). Only when it is connected to 0V will the encoder send a transmission. We always want it to send a transmission, so it is permanently connected to 0V.
The final pin, pin 17, is Data Out (DOUT) which is the serial stream of pulses containing the address and data. This is connected to the Data Input of the radio transmitter module.
Click to enlarge
The
HT12D Decoder
![]() |
HT12D Decoder Datasheet 326Kb |
The pinout diagram of the HT12D is shown in figure 3 and is in many ways the opposite of the HT12E pinout.
As mentioned previously, the eight Address inputs are present. Pin 14 is now Data In (DIN) and is connected to the Data Output of the radio receiver module.
Pin 17 is now called Valid Transmission (VT) and goes high (to 5V) when ever there has been a valid transmission received by the IC. This will be useful later on.
Pins 10 to 13 are the Data Outputs which we will use to control two motors. When a Data In pin on the HT12E is taken high, its corresponding Data Out pin on the HT12D will also go high.
Losing the signal
The Data Outputs of the HT12D are known as ‘latching outputs’ because even if there is not a valid transmission, they will stay in the same state as they were from the previous valid transmission.
This behaviour poses a problem in our remote control application: Supposing you have just turned on the power to your Meccano model car. The motor turns and the car moves away from you. The car moves out of range and the radio receiver cannot pick up the radio signal. You transmit the “Stop” signal, but the receiver cannot pick it up and the HT12D output to the motor stays latched on. The car crashes!
What is needed is a way to cut the power to the motor if there is no valid transmission.
This facility is provided by the VT pin, which will be continually pulsing when there is a radio signal being received. However, it can’t do the job on its own because the duration of each pulse is too brief.
We will use a 555 monostable (see EiM issue 4) that will be continually triggered by the VT pulse so that its output is always high when there is a radio signal being received.
Because the 555 is triggered when its trigger input goes low, the pulses from the VT pin need to be inverted. We could use a NOT gate from a 4069 (see EiM issue 6), but the other five gates in the IC would be wasted. Instead, a NOT gate has been fashioned from a single BC108 transistor.
Driving the motors
ICs can’t normally power devices such as motors directly, and the HT12D is no exception. In fact, its Data Outputs can only supply 1.6mA - not a lot of current!
We could get the outputs to switch on relays via a transistor driver, but since this part of the project will be powered by batteries, normal relays will probably be too power hungry.
A more elegant solution is to use reed relays, so we shall take a look at them before going any further...
Reed relays
A reed relay is a reed switch (see EiM issue 6) surrounded by a coil. Current passing through the coil produces a magnetic field that is large enough to move the small contacts of the reed switch.
Advantages of reed relays
Their coils have a large resistance and can therefore normally be powered directly from TTL logic gates. A typical resistance is 500Ω which means the current needed to drive it (at 5V) is 10mA - unfortunately still too high for the Data Outputs in this project.
They are quieter in operation.
Disadvantages of reed relays
Their switch contacts cannot handle currents as high as normal relays. The single-throw reed relay available from Maplin can pass up to 1A. The change-over type available from Farnell can only pass 250mA.
Double-pole types cannot be used for changing the direction of motors because there will be momentary shorting of contacts across the power supply. Reed relays do not like this because their contacts become welded together!
Back to Driving the motors
So, if you wish to change the direction of a motor that requires no more than 250mA, you can use the change-over type reed relay available from Farnell, connected as shown in figure 5a.
If you wish to simply switch a motor or another device on and off, you can use the 1A single-throw reed relay available from Maplin, connected as shown in figure 5b.
If you want to buy all your components from Maplin, you could use the Maplin single-pole single-throw reed relay to switch on a standard change-over relay, as shown in figure 5c. You would need two reed relays and two standard relays to control the direction of one motor.
In all cases, the reed relays are switched on and off by BC108 transistor drivers and the 0V side of each reed relay coil passes through another BC108 transistor. This implements the signal loss cut-out mentioned before, since the BC108 is switched on and off by the output of the 555 monostable.
Click to enlarge
The
following lists the electrical parts that are discussed in the
articles. Prices and order codes given are taken from the current
Maplin catalogue, which is the probably best source of electronic
components for the hobbyist in the UK, and the Farnell catalogue, a supplier to
the electronics industry.
If you have access to a company account with Rapid Electronics or RS Electronics you may find these companies are cheaper.
|
Maplin charge £2.50 for delivery
on orders under £30.00 ex VAT.
Prices are taken from the September 2000 - August 2001 Maplin
catalogue, and include VAT at 17.5%
Contact their order line on 0870 264 6000 or visit one of their shops.
Their customer service line is 0870 264 6002 and
they have a website at www.maplin.co.uk where on-line ordering is
available.
Farnell have a £10.00 minimum order charge for
non-account holders.
Prices are taken from the May 2001 Farnell catalogue, and include VAT at 17.5%
Contact their order line on 0870 1200 200 or visit their website at www.farnell.com/uk
www.eleinmec.freeserve.co.uk |
Electronics in Meccano April 2001 -- Issue 11 Edited by
Tim Surtell |
| Home | Contents of Issues | Index | About | Letters | Printed Edition | Wizards | SELMEC | Links |