The Single Pixel Webcam - Technical Details



The first stage of the webcam process consisits of an ORP12 LDR (light dependant resistor). It was felt that this should be mounted in some form of robust and permenant casing, so we stuffed it into a floppy disk box, which was the only thing I had to hand that was the right size (and also had a useful hole in the back, which saved cutting one). A photo of the sensor is shown below:



The LDR and a resistor (I don't particularly fancy dismembering the kit to work out what value, but I think it might be 10k ohms or so) are arranged as a potential divider across a 3.3V supply, provided by the analogue port of a BBC Master (if you're British and aged between 15 and 25 you should remember them from your school days). This looks roughly as follows:



The BBC is running a program (which I would include, but that would mean switching the webcam off to read it, which would disappoint the thousands of screaming fans. Ahem.), written in BASIC, that reads the relevent pin on the analogue port for half a minute, takes the mean of those readings and prints them onto the screen as a reading out of 255, in decimal and hex. These also go to the RS423 serial port (using *FX 3,5).

The BBC is then connected to a 386 PC by a (homemade) serial cable, where the numbers produced are read by a little bit of bash script, which produces a file called "brightness" with the current light level (in hex) in and a logfile called "brightnesses". These are saved onto an NFS mounted filesystem on the 386 (which is about all it can cope with really). This computer is shown below. The photo isn't that good, due to the lights in the room being switched off at the time, but you can just about make out the highly ammusing "Virus Free" sticker on the front of the processor box.



Annother script, running on athena (the JCN server, and not located in my room!), takes these inputs and converts them into the webpage. Note the cunning things that Graham thought up so that the graph could be viewed using a text-only browser... The NFS filesystem mounted on the 386 in my room is also mounted on athena, which makes the whole joba lot easier. It's also mounted on the webserver serving this page, which allows this script to write to the webpage directly. Eagle-eyed readers may notice the server-side includes...

So, there you are. I might at some point get round to producing a graph that shows the average light level per day. Or implement an archive. Or college's new great firewall / NAT / DHCP behemoth might kill the whole thing off altogether. Only time can tell...


Home - Webcam - Photos - Academic - Hull & Cambridge - Personal - Notes

This website was produced by Ross Church and, by causality, was last updated at some point in the past.

Any opinions expressed herein are completely and solely my own (although they might conceivably be shared by somebody
living somewhere in Mongolia). Except the ones on the quotes page, which are the opinions of the people
who said them. Nothing on these pages is sanctioned by, or represents the views of, either Jesus College,
Cambridge University, or the JCSU. Not intentionally, anyway.