Case Study 2

This project investigates a WiFi-hotspot key-ring device given to me a couple of years ago. It's designed to detect Wireless Access Points (WAPs) which conform to 802.11 b/g specs. These wireless base-stations operate in the Radio-Frequency spectrum at 2.4-GHz.

The key-ring WiFi detector in the picture is powered by a pair of 3.6-volt coin-cell batteries and it indicates wireless signal-strength by lighting 1 to 4 LEDs. Although the design rejects interference from mobile-phones and microwave-ovens, it didn't work very  well - after a short time it refused to switch on. Even with fresh batteries installed it would only last a few weeks. I suspected poor battery contacts. It did work fine, however, as a key-ring  -  and for that, it's been in daily use. Until now ...

The WiFi hotspot-detector is held together by 2 screws.
A small circuit-board is inside. The batteries are underneath.
Lots of surface-mount components, including 4 tiny LEDs, are packed onto one pcb.

There looked to be some potential ... if the LED signals were fed into a PIC-chip, and the data sent into fleXYlog running on the Newton ... then it might make a handy WiFi-logging device.


I added a temporary 5-volt supply to replace the 2 coin-cell batteries and made some measurements. The circuit draws 20 to 30-milliAmps, so it's quite power-hungry. My digital meter showed that the main processor activates each LED with a 5-volt signal. And the LED design is quite normal: there's a 560-ohm resistor in series with each one. It's also a very robust circuit: it works on 5 volts, instead of 3.6, and it survived having its 5-volt supply reverse-wired for several minutes when I forgot to check the polarity of the contacts!

Processor-chip is the multipin item in centre.
A 2.4-GHz antenna-track runs across the top of the pcb.

It was quite easy to attach a short length of thin blue wire-wrap wire to each LED-resistor, soldered using a fine-pointed iron under a magnifying lens.

The 4 new wires feed through a hole to a socket. The socket will plug into a pcb carrying a PIC chip.
Underneath, 2 more wires pick up the power-supply contacts.

The original push-button switch needs to be jumpered.

For extended use in logging, I decided to use a 9-volt PP3 battery (feeding a 5-volt regulator), all housed in a plastic box so it could be carried in a jacket pocket.

Here's my circuit design:

Simplicity itself. Each LED signal runs direct to a PIC pin. There's a spare PIC pin too - it might be useful as some WiFi-detectors use 5 LEDs instead of 4. The TTL serial-output will light an LED to show that the circuit is running.

The PIC chip is programmed to read the state of the four LED input pins, and output a corresponding serial data value.
This is the PIC-Basic Code:   wificode.

FleXYcad was used to lay out the few components needed: a 12F675 8-pin PIC-chip, a voltage regulator, capacitor, resistor, serial connector, and LED. The project-box had 4 mounting-posts at the corners and it needed a pcb 24 x 21 holes in size. Final fleXYcad component layout:

Top-left is a switch, with multiple solder-points to accommodate different switch sizes.
Top-right are the battery terminals. Bottom-left are the serial-LED terminals.
Serial connector is a 9-pin male, ground on pin-5, transmitting on pin 3.

The fleXYcad circuit text is here: wificct-text.

Newtons running OS2.x can save the scaled component-layout in the NotePad. When printed, trimmed, and placed inside the project box, it can help position the components for drilling holes etc.

The first prototype was a slightly different design, in a different box, with a different serial-connector and with an external switch:

It worked well, but the connector wires are messy and there's no serial LED indicator.

The design was easily revised using  fleXYcad.

Final pcb-Layout generated by fleXYcad for printing to a laser-printer and making a pcb:

The original WiFi-detector board sits on 2 nylon pillars, marked by the single solder-points.

The working, neater, version is seen here, without its cover. It has an integral switch and serial-LED indicator.

Various problems cropped up. The four LED circuit-tracks on the WiFi-detector pcb were not in a logical order and the PIC-code output incorrect values until I rewired the connector plug. The serial-LED in the corner was obstructed by one of the thicker top-cover lugs that closed over the thinner lower-box mounting-post. The final pcb-layout shifts the LED further away. And the switch position still isn't ideal. Although protected by the serial cable, it can be accidentally switched on (but not off) in transit. But shifting components is quick and easy with fleXYcad.

Making the earlier prototype circuit-board is shown here: etching-process.

Logging Results:

Field tests gave very useful results.
FleXYlog on the Newton was configured: Speed: 1200, Chr: 2, Y-axis max: 100, Y-axis min: 1, Y-axis div: 5.

In the logging plots, 1 LED (lowest signal) has a value of 20, 2 LEDs is 40, 3 LEDs is 60. 4 LEDs (highest signal) is 80.

This fleXYlog 'scope plot shows the WiFi signal increasing as the logger approached a British-Telecom WiFi-enabled telephone-kiosk outside the Science Museum in London. 10 yards away the signal is on its lowest useable reading of 20.
The signal-strength increases towards the kiosk, jumping from 20 to 40 to 60 and then to 80 as I entered the kiosk.
The signal drops away rapidly leaving the telephone-kiosk.
Time duration across this plot is 233 pixels x 300mSecs = 1 minute 27 seconds, roughly.

Walking away up the street and then across Hyde Park produced this next plot.
The BT kiosk is the largest spike on the left-hand side. FleXYlog was sampling every 10 seconds.

The WiFi-logger used here is actually the prototype circuit (named 'm-wave'). When this detector scanned and found no signal, the readings jumped rapidly between values of 10 to 20. The final version is much better and jumps from 5 to 10, giving a clearer distinction between no signal (= scanning) and the lowest signal, 20 (= 1 LED).
Plot-duration in this example isn't accurate, as the logging had stopped and started a few times near the end.

Other results with the revised Newton WiFi-Logger, scanning around my workplace:

A B C D are various teaching buildings as the logger traversed between them (different buildings in each plot).
In the first picture, point B is a department with no wireless.
In the second picture, point C represents a 2nd-floor location which was covered by several distant WAPs (sited in location A and nearby buildings) and where the various overlapping signals were all weak and unusable for a laptop with a wireless card.

This small WiFi logger seems quite accurate.

Extra surprise:

In my limited tests, the WiFi detector was immune to mobile-phone or microwave-oven interference.
One household device, however, produced a surprising reading.

Lying unused for several years has been a wireless doorbell transmitter. Probably from an unfinished DIY project, lost in the mists of time. I wondered whether it would generate interference. It shouldn't do, as it operates on 433-MHz, well outside the WiFi RF spectrum. But lo and behold, held at a distance less than 12 inches, it produced a strong signal.

Doorbell transmitter next to the uncovered WiFi detector.

When the doorbell is turned on and held close to the receiver, a maximum WiFi signal of 80 is detected.
I guess the doorbell is generating harmonics.

One final question: I wasn't sure if the WiFi receiver was being muted, placed inside a different box.
Using the doorbell as a signal-source provided an answer: with the WiFi receiver uncovered, and then put inside its new plastic box there's another surprise - the WiFi receiver is *more* sensitive when the lid is on !!

Thanks to a post in http://www.newtontalk.net/archive  (February 2007):
for a supplier of the WiFi key-ring in the USA, try http://www.mobileedge.com
and follow the link to accessories, or use http://tinyurl.com/3534dc
Item: WiFi Signal Locator, Part No. MEASL1