Capacitance meter using 555 timer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am attempting to complete a PSoC1 project involving using a 555timer circuit as a capacitance meter. Essentially the resistor/capacitor network in the circuit directly relates to the 555timer output in that t = 1.1RC. I am fine with the circuit design, my problem is in writing the main.c file for it. I need to be able to read in the 555 output, have PSoC recognize the T value, and calculate for capacitance and display it to the LCD. Any help would be greatly appreciated.

16 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Measuring a time in PSoC1 is performed in different ways depending on the frequency of the signal:

   

When the frequency is high you count the number of pulses within a given time, which you generate with a separate timer or useing one of the VCs,

   

 

   

At lower frequencies you can use a counter that counts the pulses of a fixed frequency and which is enabled by the signal to measure.

   

 

   

At the end of the measure-cycle an interrupt is generated the value is read-out and the next cycle is set up.

   

 

   

For further information have a look into this application Note AN2283 www.cypress.com/

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Some useful reference material, attached.

   

 

   

Some questions -

   

 

   

1) Range you want of T / F measurement ?

   

2) Resolution of the measurment ?

   

3) Accuracy of the measurment ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

It looks like counting the number of pulses in a given time frame would be the best solution. I essentially now need to write a main.c file to see the square wave, count how many pulses in a given time, divide the number of pulses by time to obtain T value, have PSoC calculate C from equation T = 1.1RC, and display the result on the LCD.

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Here is a simple F counter project, attached.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

If you are using PSoC. why do you need the 555?

0 Likes
Anonymous
Not applicable

How would you suggest ommitting the 555?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

An LCR approach -

   

 

   

    

   

          www.wseas.us/e-library/conferences/2005cancun/papers/495-106.pdf

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

This is not using PSoC but should give you an idea.

   

http://embedded-lab.com/blog/?p=4400

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Some questions -

   

 

   

1) Range of C values to be measured ?

   

2) Accuracy of measurement ?

   

3) Do you need ESR value as well for the C ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

There is no real definative answer to those questions. The better the range and accuracy the better, but there is no real set guideline as to range and accuracy. This is really supposed to be a first step into PSoC. I only have a very basic knowledge of the material.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The nuances for the deep dive look into RLCZ measurement, attached.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Note Caps change C with bias, as much as 80% dependinmg on technology,

   

so the exponential and technique I showed using I source are inaccurate.

   

Reason why ac measurements more effective, like measuring phase shift of

   

RC network.

   

 

   

See attached.

   

 

   

Regards,. Dana.

0 Likes
Anonymous
Not applicable

You should define what is the goal of your project first. Then design the solution to meet your goal. Otherwise it is hard to give you proper suggestion.

0 Likes
Anonymous
Not applicable

Is there an AN2283 application available that has more comments in the code? The only one I could find had very minimal comments.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Not that I am aware of, however if there is a section of code you

   

need help on, eg functionality/explanation, forum can assist you.

   

 

   

Regards, Dana.

0 Likes