you hey there welcome back to another circuit basics tutorial I'm Scott and today we're going to build a few capacitance meters with the Arduino this is a really useful project I stumbled upon this after researching basically every time I wanted to do a project and I couldn't read the labels on my capacitors I have no idea what the codes mean so I'd find myself googling basically four times every hour just trying to look up what value a capacitor was so I decided to fill the capacitance meter and label all my capacitors in a way that I could understand and I hope you do the same because it's going to save you a lot of time so with that let's get started here I have a blog post about this at circuit basics comm and I actually graph the accuracy of the three capacitance meters we'll be building today just to figure out the range where each would be accurate none of the use really could accurately measure capacitance across the range of common capacitors that I was using so being the science geek that I am I had to find out which ones were accurate at which values and you can see that the high accuracy capacitance meter is accurate from about 180 micro farad's down to about zero point zero zero four seven micro farad's the Arduino dot CC capacitance meter is good all the way up to three thousand nine hundred microfarads add down to zero point one micro farad's and the two pin capacitance meter is good from about 470 micro farad's all the way down to zero point zero zero zero zero one eight micro farad's so now we can set up the Arduino in our circuit I'm using an LCD there's two ways you can do this you can output the readings to your serial monitor on your computer or you can output them to an LCD display I've included the code for each method in the blog post and I'll show you both ways right now so right now let's wire up the circuit so start by connecting a jumper wire from pin 13 over to a breadboard and then insert a resistor of 10 kilo ohms from that jumper wire and then connect the end of that resistor to pin a zero of the Arduino then from that connection answer a 220 ohm resistor and then take the end of that resistor and if you're using the LCD screen you want to connect it to pin eight of the Arduino and if you're using the serial monitor for output connect it to pin 11 now connect a jumper wire from the ground pin of the Arduino and bring it over to a rail on the breadboard now take your onion capacitor and insert it into the breadboard with the negative pin connected to the negative jumper wire and the positive pin connected to the rail with the two resistors now we can go back and get the code I've got the code in this blog post so go ahead and copy that and paste it into the arduino ide and upload it to the board and now it's reading our capacitor this is the serial monitor output in the first column we have the time that it takes for a capacitor to reach 63.2% of its charge that's the point at which the Arduino takes its measurement and in the second column we have our capacitance measurement taking a look at the LCD output it will alternate between the charge time and the capacitance reading so it's fairly accurate we have 465 micro farad's for a 470 micro farad capacitor not too bad alright that was the capacitance meter from Arduino dot C C which I found to be accurate from about 1 micro farad up to three thousand nine hundred microfarads now let's build a capacitance meter that's a little more accurate for smaller values from 180 micro farad's down to zero point zero zero four seven micro Fairs this is a high accuracy capacitance meter developed by Nick gammon and there's a link to his website and this blog post so go check that out if you have any how many questions or want to contact him for any reason alright so we'll go ahead and build a circuit I've got the diagram for it on the blog post if you want to check that out we need a 10k ohm resistor a three point 1k ohm resistor and a 1.8 km resistor and I don't have a three point 1 kilo ohm resistor or a 1.8 kilo ohm resistor so what I did was I took a two thousand ohm resistor a 1000 ohm resistor and a 100 ohm resistor wide those in series for the 3 point 1 kilo ohm resistor and for the 1.8 kilo ohm resistor I took a 1000 ohm resistor and for 200 ohm resistors and wired those in series so it gets a little bit messy here but bear with me so if you're using an LCD to output the readings take a jumper wire from digital pin 8 of arduino over to a breadboard if you're using the serial monitor for output take a jumper wire from digital pin 2 with arduino over to the breadboard now connect a 10 kilo ohm resistor from the end of that jumper wire over to another rail of the breadboard and take a jumper wire from the other side of that resistor and connect it to digital pin 6 of the arduino now insert your unknown capacitor now from the other side of that capacitor take a jumper wire and connect that to the ground pin of the Arduino and you can see we already have a capacitance measurement I'm using a 10 nano farad capacitor here and you can see that the capacitance reading that we're getting is 12 to the 13 nano farad that's not very accurate that's because we haven't set up the reference voltage circuit yet so let's go ahead and do that you want to connect a jumper wire from the positive rail 5 volt positive rail over to another rail on your breadboard so from that 5 volt jumper wire I'm going to make my one point eight kilo ohm resistor so I'm going to do a 1000 ohm resistor and for 200 ohm resistors all in series you and from the end of that series of resistors I'm going to add a jumper wire and connect that to digital pin 7 of the Arduino so we're making a voltage divider here I'll go more in-depth on that in the blog post so you might want to check that out if you're interested so now we need to make our three point 1 kilo ohm resistor so I'm going to insert my 2 K ohm resistor into that rail and then my 1k ohm resistor and then my 100 ohm resistor all in series and I'm going to insert the end of my last resistor into the negative rail so that's going to go to ground so I'm going to go back to the blog post and find the code here's the code for the serial monitor output and here's the code for the LCD output so I'll copy that and paste it into my arduino ide and upload it to the board so this is the output we get for the serial monitor I'm just going to show you both ways we have our capacitance it only gives you one reading capacitance and it will change from nano farad to Pico farad's to micro farad's automatically we're reading 10 down of farad's so that's pretty accurate and on LCD we've got 10 nano farad perfect so exactly what it said on the capacitor all right so now why don't we build the third capacitance meter this one had the greatest accuracy over the largest range of capacitors that I tested I found it was pretty accurate for capacitors with values from 470 micro farad's all the way down to 18 Pico farad's so this is a good one and it only uses two pins from the Arduino so as you begin just connect the jumper wire from analog pin 0 of your Arduino over to a breadboard then insert another jumper wire from analog pin 2 of Arduino and take that over to a breadboard and then insert your unknown capacitor in between these two leads so now we'll just go back over to the blog post to get the code and I've got serial monitor output code and LCD monitor output code I'm uploading the LCD monitor code right now but I'm just going to show you both ways I'm able to do this with the magic of video editing so just bear with me here I'm going to paste it into the arduino ide and upload it to the board and this is what the code will output for the serial monitor so it's pretty accurate 20 Pico farad's I was using a 20 picofarad ceramic disc capacitor that says capacitance value around 20 20 point six twenty point four Pico farad's and the value in parenthesis is the charge time in milliseconds that's our time constant and the output on the LCD display we have our capacitance reading and our charge time reading on the same screen all right well thanks for watching and I hope you found this one useful and I definitely recommend this one if you're having a issues reading all the different codes on the capacitors like I did so all right well don't forget to Like and subscribe and check out the blog post at WWE basics calm alright thanks for watching have a good day bye