Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

Capacitance Measurement
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

by mikewitt on Tue Mar 20, 2007 11:30 pm

The code has been updated. Now there are no leading zeros on the display, and capacitance is (somewhat) autoranging (insofar as the math involved, 1 uF displays as 1 uF and not as 1000000 fF).
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by Olaf Marzocchi on Mon Mar 26, 2007 5:59 am

Mike, I just set up my compiling environment and I tried to compile your sources, just to be sure to get similar results.

Well, they are not similar.

I installed avr-gcc 4.0.2, avr-binutils 2.16.1, avr-libc 1.2.5 under Mac OS X and I found, after disabling the -gdwarf-2 flag ("cap_src_2313.c:1: error: target system does not support the "dwarf-2" debug format"), a compiled hex file bigger than yours: 3,478 vs 3,147 bytes.

Which development environment do you use? I mean, software versions. About 3 hundreds bytes more for the same code, with even debugging disabled (but I'm not sure if it affects the hex file size), is *a lot more*...

I heard gcc 4.X produces bigger x86 code than 3.X, but this would be a big problem with avrs.
Olaf Marzocchi
 
Posts: 73
Joined: Mon May 08, 2006 3:29 am

by mikewitt on Mon Mar 26, 2007 11:13 pm

I use WinAVR (which, I would assume, does not run on OSX). The things I would try to remedy this would to be, first and foremost, go into the makefile and change '...=ihex' to '...=srec' This will change the output format to a Motorola Record Table, instead of Intel Hex (I've got no idea if this will remedy the problem, but I do know that it programs correctly with the srec format). If that doesn't work, look at the makefile again, and find the line that says dwarf-2, and change it to one of the other options (they're directly above, commented out).

Even with a bigger hex, when you program, it should be only ~1383 bytes while the hex is bigger. So that three hundred bytes might equate to anywhere from 0 to 100 bytes extra (in my experience, which is limited, the program size is about a third of the hex size) because it might be padding, compiler directives, etc... For example, when I was first starting to write my code, at the end of the main() sub, I found that if you put a "while(1);" at the end of the sub, the final program size is actually 8 bytes smaller than without that extra code. Basically I'm saying that I don't know why the code is bigger, but I wouldn't worry too much about it, because our environments are very different, so it could be any or all of a number of things.
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by Olaf Marzocchi on Tue Mar 27, 2007 7:54 am

Thanks for the details, they are very interesting. I will now experiment a bit.

WinAVR uses gcc as compiler, could you tell me which WinAVR version you use? I find 20070122 as the latest on sourceforge, it is based on gcc 4.1.1, while the previous one probably has 4.0.X as compiler version (what I'm using now).

if you go to the command prompt and type

avr-gcc --version

followed by the return key you will get the value I need. Unfortunately, I don't know how to get the avr-libc version, but I will discover it by myself (and then report here) if you tell me the WinAVR version.

Thank you again.
Olaf Marzocchi
 
Posts: 73
Joined: Mon May 08, 2006 3:29 am

by mikewitt on Wed Mar 28, 2007 9:30 am

I know that I'm using the 20070122 build of WinAVR, but I'm away from my computer (at least the one with AVR dev stuff on it) right now, so I won't be able to be any more specific till Sunday.
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by Olaf Marzocchi on Wed Mar 28, 2007 2:24 pm

That's enough. Now I compiled avr-gcc 4.1.2, the latest version, and I'm trying to compile libc 1.4.5, but I have some problems.
Olaf Marzocchi
 
Posts: 73
Joined: Mon May 08, 2006 3:29 am

by remmelt on Mon Apr 02, 2007 6:02 am

Hey! I just noticed this tread. I've been meaning to build a capacitance meter for ages now, since my Ebayed Fluke doesn't measure capacitance or frequency. Home made looks cooler anyway.

I also found this thread: http://www.geocities.com/dariuskrail20/PICCapMeter.html via http://www.makezine.com/blog/archive/20 ... capac.html

that one says it can accurately measure F up to 2600uF. For me that would be useful, since guitar amps sometimes use large caps. Not quite 2600uF, but 16uF is not unusual. I would like to use an IC that supports in-circuit programming though... What's with the 555's noise that makes it tough to read higher values?

remmelt
 
Posts: 4
Joined: Wed Aug 10, 2005 7:35 am

by mikewitt on Mon Apr 02, 2007 4:27 pm

In the places I've looked, it seems that the 555 is just noisy (I think that it's because it's an oscillator, but I don't know why any further than that). Just put the biggest cap (in terms of value, preferably low ESR) you can find between Vcc and Gnd.

When I get my samples, I'll be making my meter with two Digital Pots, so it'll be able to autorange the resistors around the 555, and _should_ be able to measure up to about .006F (that's pretty big).

I'll be using an SPI Pot, from microchip: P/N: MCP41010-I/P.

They're 10K pots.

If you have any other questions, I'll be happy to answer them.
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by mikewitt on Wed Apr 04, 2007 6:38 pm

Ok, I have a question for all those out there following this:

How many people would be interested in a kit to make this (everything included, would have the adjustable pots, PCB, IC sockets, ICs, etc... everything needed to make this project: with or without the LCD.) I've been thinking about it for a while now, and I think that I could sell the kits for ~$15 USD (plus S/H, w/o LCD, ~$27 extra for LCD)

How many would be interested? The more people there are, the cheaper the kit, so please reply to this thread or PM me.

Weather or not people buy the kit, I'll be posting brd and sch files when I make them (although the sch is just out of date right now).
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by mikewitt on Fri Apr 06, 2007 1:48 pm

The updated schematics are here:
http://witt.michael.googlepages.com/555Capacitance.sch

I received my samples today (of the digitally controlled pots), and hope to have them working soon.
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by mikewitt on Fri Apr 06, 2007 9:33 pm

The board is here:
http://witt.michael.googlepages.com/555Capacitance2.brd

It's small enough that it should fit nicely behind the LCD I use, so you could have a relatively small hand held capacitance meter. You could probably even put it in the form of a set of tweezers.

After getting the specs for it, it looks like it'll cost people $5 for JUST THE PCB (plus shipping, PM for actual costs). It would be another ~5-10 for components (no lcd, shipping extra) and if I get at least ten people, it will be ~$22.46 (up to a dollar or two extra, cover s/h costs from SparkFun) each (before shipping).
mikewitt
 
Posts: 111
Joined: Thu Jan 04, 2007 9:18 pm
Location: KB9YJY, Wilmette, IL

by Olaf Marzocchi on Sat Apr 07, 2007 4:27 am

Why don't you ask ladyada to put it up on her website? this is your project, but born in this forum, it shouldn't be a problem for her (or so I think).
You would surely reach 10 people and the project would be more visible.
Olaf Marzocchi
 
Posts: 73
Joined: Mon May 08, 2006 3:29 am

by adafruit on Sat Apr 07, 2007 12:38 pm

A very good question. For some time i've been wondering how best to provide a "space" for people to put up projects and stuff.

Right now the best suggestion I have is to use the Wiki, which is actually not there for this reason but hell it'll work and its good for mucking about so i dont know, do you want to maybe put it up there?

www.ladyada.net/wiki

just make a new page, and upload the files using the 'uploader' and ill figure out the rest :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

by guess_who! on Sat Apr 07, 2007 10:21 pm

ladyada wrote:For some time i've been wondering how best to provide a "space" for people to put up projects and stuff.

Right now the best suggestion I have is to use the Wiki, which is actually not there for this reason but hell it'll work and its good for mucking about so i dont know, do you want to maybe put it up there?

www.ladyada.net/wiki

just make a new page, and upload the files using the 'uploader' and ill figure out the rest :)

That sounds great!
Now I can REALLY go to town on this site...
guess_who!
 
Posts: 49
Joined: Thu Mar 08, 2007 4:20 am

by adafruit on Fri Apr 13, 2007 5:35 pm

mikewitt wrote:The board is here:
http://witt.michael.googlepages.com/555Capacitance2.brd

It's small enough that it should fit nicely behind the LCD I use, so you could have a relatively small hand held capacitance meter. You could probably even put it in the form of a set of tweezers.

After getting the specs for it, it looks like it'll cost people $5 for JUST THE PCB (plus shipping, PM for actual costs). It would be another ~5-10 for components (no lcd, shipping extra) and if I get at least ten people, it will be ~$22.46 (up to a dollar or two extra, cover s/h costs from SparkFun) each (before shipping).


Your timing is impeccable, or at least you reminded me to get off my ass and start working on this project again...woooo

http://www.ladyada.net/wiki/doku.php?id ... h:lcrmeter

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Please be positive and constructive with your questions and comments.