Sunday, 17 February 2019

Garage transmitter and receiver

Date of completion: 2018

We are lucky enough to have a garage, but we can't see the garage door from the house. To avoid leaving the door open I have installed a simple RF system which indicates indoors whether or not the door is still open. The door has a microswitch set into the frame, which is pressed when the garage doors shut.

Photos


The receiver attached to the bottom of the extractor fan in the kitchen!

Design

Both the transmitter and receiver circuits are powered from mains adapters and voltage regulators. The transmitter uses an LM2936, as this has a smaller dropout voltage than the 7805 used by the receiver. The transmitter has a 555 timer to produce short pulses (about 100 ms) every 3 seconds or so to drive the HT12E encoder connected to the 433MHz transmitter unit (cheaply available with a receiver unit on Ebay). The microswitch setting is inverted by a transistor and sent via the encoder. The receiver unit is decoded by the HT12D chip, which feeds a "transmission received" signal (flash) and the microswitch signal (continuously on or off) to LEDs via transistors to provide the required current (one of the transistors is not really needed - just there for historical reasons!) Each RF unit has a 17.3 cm long vertical aerial, corresponding to one quarter of a wavelength.

Circuit Diagrams

Tiny CAD (.dsn) files:  Garage transmitter   Garage receiver



Frequency Meter

Date of completion: 2008/2012

This was a fairly early attempt of mine to construct and program a reliable frequency meter using a PIC, based on the efforts of others published via the internet. 

Photo


Design

The power supply comes from a 9V mains adapter feeding a 7805 voltage regulator. The PIC is a (nowadays rather ancient) 16F84A and it is is connected to a 16-character LCD display. The input stage design came from the internet and it feeds into a resettable latch constructed from 4 fast TTL NAND gates (74HC132). The PIC is driven by a 20 MHz crystal, enabling highly accurate timing. The code is adapted from that of Barry Smith, who himself adapted it (in 2006) from that of Terry J. Weeder. It does work, but I can't tell you much about the design!

Circuit Diagrams

Tiny CAD (.dsn) file: Frequency Meter 2012


Source code and other files

Freq2012.asm  All files (.zip)

Radio-Controlled Clock

Date of completion: 2010

I am a Time-Lord! My job is to keep the local church clock, built in 1850, chiming somewhere near the right time. I can hear the chimes from home, but our clocks in the house are generally only accurate to the nearest minute, at best. So I designed and built this radio-controlled clock to display the correct time digitally to the nearest second. Then I could judge how many seconds forwards or backwards I needed to adjust the church clock. The radio-controlled clock uses the LW signal (MSF) transmitted from a site in Cumbria, UK, containing time information from a caesium atomic clock and it is therefore highly accurate. The signal is, however, very weak (we are a long way from Cumbria.) So to avoid having to design and build a receiver tuned to the correct frequency, I deconstructed a cheap analogue radio-controlled clock from Ebay, i.e. I ripped out its receiver and used it here!

Design

The heart of the clock is a 16F628 PIC with a 16 character LCD display. The PIC and display are powered from a 9V mains adapter via 7805 voltage regulator, but I noticed that the MSF receiver needed a single AA cell. It turned out that the output from the receiver is sufficient to drive the PIC, if set up judiciously, and the cell has very little current drawn from it (so rarely needed replacing.)

There are actually two clocks here: the second is run by the PIC itself, which takes over if the signal from the receiver is too weak. An interrupt routine is triggered by the receiver and this decodes the basic information of time and date. Most of the rest of the assembly language program is concerned with formatting for display (hours, minutes, seconds, day, month, year) and error-trapping (as the signal is VERY weak, and the device only works near a window - or, better, outside!)

I no longer have the clock, as I have now constructed a GPS clock, which uses a rather more powerful signal from GPS satellites for time information. See "GPS Clock" for further details.

Circuit Diagrams

Tiny CAD (.dsn) file: Clock


Source code and other files

Clock.asm  All files (.zip)

Alarm Transmitter and Receiver

Date of completion: 2012

These are two RF devices to solve a problem! I live about 100 metres from the church where my wife is the vicar. The burglar alarm sounds from time to time, and, particularly at night, it is rather a nuisance to have to go and investigate it (it is almost always a false alarm!) The trouble is that it is difficult to distinguish the sound of the church alarm from car alarms, which also sound at fairly frequent intervals. This  transmitter/receiver pair is designed to indicate if the sound is indeed coming from the church tower.

Design

The RF frequency used is 433MHz (within a public band in the UK) using a transmitter/receiver pair cheaply available on Ebay and HT12E/HT12D encoder/decoder chips, also readily available. Both are powered from 9V mains adapters feeding through 7805 voltage regulators. They each have an aerial attached as vertically as possible of length 17.4 cm (quarter wavelength), which are JUST sufficient to work over the distance involved here,

The transmitter (mounted in the church ower) has a small microphone to detect the sound of the (very loud) alarm (the church bells are also picked up, but these are easy to distinguish aurally.) Its signal is fed through an op amp to amplify the microphone signal, and then another op amp without feedback to cause saturation (i.e. with its very large gain.) The square-wave output is fed via a switching transistor with a low-pass filter into a 555 monostable circuit, set to about 10 seconds. Another 555 timer is used as a multivibrator with a time period of about 2 seconds but an "on" period of only a few milliseconds. This second 555 drives the encoder to enable transmission for a very short time every 2 seconds. It transmits a signal indicating whether the monostable is on or not.

The receiver is simpler, feeding the "transmission received" signal from the decoder to a 555 monostable set to about 1 second, in order to flash a red LED indicating transmission received (every 2 seconds.) As the decoder latches its output, a green LED is simply connected to the data output indicating the content of the last transmission.

The receiver has now (2017/2018) been integrated into a GPS clock, so I have no photos for you!. See "GPS Clock" to learn about the latest development.

Circuit Diagrams

Tiny CAD (.dsn) files: Alarm Transmitter   Alarm Receiver



Saturday, 16 February 2019

Optical Fibre ADC and DAC

Date completed: 2014

Here are a couple of circuits I designed and built for teaching Physics. At the time of the "Big Switchover" from analogue to digital radio and TV, we were required to teach the differences between, and uses of, analogue and digital signals at GCSE. These little boxes encode an input analogue voltage into a digital signal of 8 bits, sends it along an optical fibre, and then decodes it back to analogue (which can be connected to a voltmeter). The whole process is demonstrated slowly with a flashing LED (in a straightforward binary code), or it can be done rapidly, so that a low frequency signal (say 200 Hz) can be sent and listened to via an amplifier and speaker.

Photo and School instructions

Design

These circuits are based around two PICs (different ones, just because those are the ones I had at the time!) Each pic has a quartz crystal to control the timing, and they are powered via 7805 voltage regulators from PP3 9V batteries. The optical fibre connectors were bought cheaply, the aim being to keep the whole setup as visible as possible. TS912N op amps are used to amplify the signals (again because I had some of these available - 741s would have done fine.) Diodes are used for over-voltage or reverse-voltage protection. The programming is in assembly language.

Circuit Diagrams

Tiny CAD (.dsn) file: ADC-DAC


Source code and other files

ADC: ADC.asm  All files (.zip)
DAC: DAC.asm  All files (.zip)