I saw the topic for the current Project14 competition of Digital Fever and I reflected on what I might do. I remembered that I had a whole bunch of simple TTL logic ICs from over 40 years ago when I first started messing about with electronics. I have been intending to get rid of all those old electronic components and related stuff as I never use them and I want to de-clutter my garage. So I thought I might achieve two goals from the same activity: think of something to do with TTL logic and then once finished, get rid of everything. I put on my thinking cap and started to think. After a while I decided my thinking cap must have a flat battery as I was not having any ideas at all, not even bad ones. However, I persisted and eventually came up with the idea of using 74LS series ICs or anything TTL like, that I might have, to use a PIR to detect and count the cats coming into my garden. I have been attempting to create some kind of CatDogFox detector for some time, with a spectacular lack of success, so I thought, why not have another go and so Cat Counter MKIII was born.
Below is a photograph of my collection of old 3400 series, 5400 series and 7400 series logic ICs. Not particularly well sorted, some are recovered from PCBs, some are new purchases a long time ago, others I just somehow have.
The PIR sensor will produce a clock like signal from it's output under some conditions (that I have not been able to fully comprehend) which relate to the presence of a hot (hotter?) body in an environment. I could not get the PIR to produce a signal repeatedly, possibly because it needs some time between detections or maybe it is something to do with thermal gradients. Anyway, I knew that it would sometimes produce a pulse, provided there were longish intervals between detections so I decided that would do.
First device I needed was a display. I could have used LEDs, maybe a binary output but that is not a particularly friendly user interface. I remembered that at some point I had purchased some very early 7 segment LED displays and I thought I might have some left - and I did. They are MAN10A, mostly used in some old Fluke instruments I think and they make up each segment with a row of tiny little LEDs. They seem fairly high current (5 mA per segment) and compared with modern displays are mind bogglingly dim. . Sadly they do not have a BCD input so have to be driven from another IC. Nor do they do the full hexadecimal seven segment display font (0 to F) but instead decimal (0 to 9) plus some other made up characters, but that didn't matter as I only wanted 0 to 9 anyway.
I could not find my Texas Instruments TTL IC book (hopefully I still have it some where as it has sentimental value to me) as I disposed of all my printed books when I retired. Who needs actual books any more! I was randomly scrolling through the internet looking for a datasheet for the MAN10A when I saw one with a circuit showing binary to 7 segment using a 7447 IC. Having bought the MAN10A displays in the past I supposed that I might also have purchased/obtained some 7447 ICs as well. After looking through all my ICs I eventually found that yes! I did have a couple of 7447s. And at lease one worked.
So now all I needed was a 4 bit counter. I was sure I must have some, which I did and settled on the 74LS93 which is a decade/hex counter. I wanted hexadecimal even though I only wanted 0 to 9 - it was just simpler, so the 74LS93 was fine. Then it was a case of connecting everything together, as illustrated in the circuit diagram shown below.
I also had to add a 74L04 inverter as for some reason the PIR output would not drive the clock input of the 74LS93 directly but it would drive the input to a 74L04 inverter. It worked so I didn't bother finding out why. While trying to get all this circuit working I realised why I used microcontrollers now and I have decided to never again make any discrete logic circuits - it is just too much like hard work. The final assembly is illustrated below.
I used a 12V lead acid battery for a power supply as the circuit takes over 100 mA and I used a DC-DC converter with variable output, set to 5V to provide the 5V needed by TTL. To provide weather protection as the system was going to be placed outside overnight I used a plastic chocolate box container that seemed fairly watertight. Plus rain was not predicted so I hoped it would b OK. There is no ON/OFF switch, it is just plugged together and away it goes. Normally the 74LS93 counter powers-on with a value of 5 although other values have been observed so I just needed to wave my arm in front of the PIR sensor some unfathomable number of times to reset the counter to 15 - which actually turns all the LED segments off. I then setup the system outside in an area known to be frequented by cats, waved my arm one more time to set the count to 0 and retreated to the warmth of my house, see below.
Then all I had to do was wait until the following morning to see what, if anything, has been detected!
And, as can be seen, 6 instances of something were detected. I was a little uncertain of the number to start with as I was looking through the camera at a tessellated plastic box cover at a dim 7 segment display, without my glasses, while at the same time trying to avoid accidentally activating the PIR sensor. and I wanted my breakfast.
This video is cut short as the camera battery ran-out so it does end abruptly, but it shows that there were 6 instances where some warmer than the background body was detected. I do not think any of these were me as I departed and approached the system from behind. Regrettably the number 6 is all the information that I have: I don't know if all the detections took place at about the same time (a cat sniffing around at this new object), several different times (a cat setting off and then some time later returning), several cats, or just some random waving about of garden elements accidentally setting off the PIR sensor. It could even have been birds - are birds warm blooded enough to be detected? We do have pigeons and magpies hanging around in the detection area. Maybe even rats or foxes.
PS So now I want to make a Cat Counter MKIV that uses an Arduino Nano to record the time of each detection and maybe some better user interface such as an OLED graphic display. The cat detecting goes on!