Colpitts oscillator for detection of letter thrown into a mailbox

Thread Starter

Kevil

Joined Jun 28, 2020
4
Using a Colpitts oscillator, I would like to try to detect a letter thrown into a mailbox. For the detection I use C1 and C2 created on the PCB as copper areas. I assume this would slightly change the oscillator frequency 100 kHz temporary which I will measure by the Microchip ATtiny202 MCU. The Vcc is 3.3 Volts. How to fine tune the components values to get smooth oscillations? I can set the ATtiny202 analog comparator to 0.55, 1.1, 1.5 (default value) or 2.5 Volts.
 

Attachments

Alec_t

Joined Sep 17, 2013
11,640
Welcome to AAC!
How big is your pcb going to be? Methinks creating C1 and C2 with values of 33nF and 100nF will be a challenge.
 

Irving

Joined Jan 30, 2016
1,009
I doubt the letter will have much effect on your oscillator. The capacative change will be negligible <1% and an ATtiny Adc can't sample fast enough anyway. There are much simpler and tested solutions - mechanical balance, piezoelectric force/shock, accelerometer, opto-reflective, opto-interuptor, etc. etc.
 

DickCappels

Joined Aug 21, 2008
6,587
I remember seeing a project with a similar objective in about 1963, but it used an optical detector. Something like that might be more reliable.
 

Thread Starter

Kevil

Joined Jun 28, 2020
4
@Irwing

I know It will be not easy but I have a program for ATtiny202 running at 20 MHz ready which counts frequency well (for 100 kHz is the uint16_t period 200). I can use higher frequency for Colpitts oscillator when needed and use divider (e.g. 100, 1000, 256) to be able to measure the period by ATtiny202.
 

Irving

Joined Jan 30, 2016
1,009
The change in capacitance is not going to be detectable. If it shifts the frequency a few 10's of Hz it'll be a lot. The oscillator will drift by 10x that on temperature, noise and other random reasons alone. what you're trying to detect is too far down in the noise.
 

DickCappels

Joined Aug 21, 2008
6,587
The change in capacitance is not going to be detectable. If it shifts the frequency a few 10's of Hz it'll be a lot. The oscillator will drift by 10x that on temperature, noise and other random reasons alone. what you're trying to detect is too far down in the noise.
If you can get a large enough frequency shift you can watch the change of the frequency vs time and when it exceeds some threshold then you can signal that an even has occurred. In practice you might want a combination of some averaging in addition to the differentiation depending on the nature of any environmental disturbances and to only trigger on frequency shifts in one direction (lower in frequency).

A basic frequency meter setup would spare you the need to convert the frequency to analog and then back to digital. Microcontrollers can measure frequency much with less "jitter" and uncertainty and great resolution than they can measure voltage. You just need a controller with two timers, one of which can be triggered by the sense oscillator's output (I don't know about the ATtiny202 but many counters on AVR controllers can be driven by an external signal delivered to the on-chip comparator), and one to provide the time base for the measurement. Nothing exotic.

The reason I suggested optical is that I was involved with the development of a touch sensor like the one outlined above, and it was among the most difficult projects I have encountered because little things would have big effects (like the VP of engineering calling me) -mechanical issues (does anything vibrate or shift position at the wrong time?) and electrical issues (Why is there an interfering signal (the controller's clock?) that is causing the detection oscillator (your colpitts) to injection lock or cog on certain frequencies, thus becoming insensitive to small changes in capacitance).

Incidentally, the system was pretty simple in principle. The transistor and its collector resistor were later removed. The output of the Schmitt trigger was fed into one of the counters on the controller. See attached.
1593412701966.png
 

Attachments

Thread Starter

Kevil

Joined Jun 28, 2020
4
@DickCappels

I appreciate your advice very much. I am better in microprocessors than in analog circuits. The capacitance of two surfaces with dimensions 210 x 148 mm (paper format A5) with distance 50 mm in the air is 5.5 pF. I will test the Inverter Oscillator with C = 5.5 pF and R1, R2 = 1M Ohm which should oscillate at 101.4 kHz.

HCT Inverter Oscillator / Generator
 

Irving

Joined Jan 30, 2016
1,009
That's a really interesting patent document that Dick has posted and gives a great description of the difficulties of capacitive proximity detection that backs up what I've been saying. Articles with low density and little guaranteed electro-magnetic material content are very hard to detect with capacitive (electric field) based technology. Non-contact finger detection is hard enough - I know of several early 'touch-sensitive' products that worked well in dense urban areas but failed miserably in the middle of a field because the supposed electric field change detection was actually a result of background induced fields from power wiring, though the tech is well enough understood now that some microcontrollers, eg. ESP32, now have touch-sensing tech built-in.

I still have doubts that even dedicated hardware would reliably detect a letter unless the mechanical/physical aspects were very strictly controlled - so maybe you need to explain more just what you're trying to do and why? Indeed I can't find (admittedly it wasn't an exhaustive search) a commercially available proximity sensor for paper/card. Having said that, keeping an open mind, this research paper and this one suggest there is some possibility it could be made to work. Both papers also give a good background to electrostatic proximity detection. Note that this doesn't detect frequency change but the presence or not of oscillation.
 

Bordodynov

Joined May 20, 2015
2,660
I would do optical detection using an open channel optocoupler. Envelopes are usually white and reflect light better than mailbox walls. Surveys can be done rarely and thus can save battery power.
 

BobTPH

Joined Jun 5, 2013
2,538
50 mm distance between the plates of the capacitor? I guess this means the letter will be between the plates, right? If that is right, an optical detector would be far easier.

Bob
 

DickCappels

Joined Aug 21, 2008
6,587
50 mm distance between the plates of the capacitor? I guess this means the letter will be between the plates, right? If that is right, an optical detector would be far easier.

Bob
And more reliable. It would need to be able to accept some amount of light transmission through the envelope and ignore ambient light but that should not be an issue.
 
Top