Right now we are offering more than 200 click boards. The majority of them have a single chip or module that carries the functionality of the entire board, but this time we have something really unique compared to all other click boards.
C Meter, Ammeter and R Meter clicks (the last one yet to be released) can be observed like helping tools for electronic fans. They can be used for fast measurement when the highest possible level of accuracy is not required. Very simple click boards from the point of programming so they can be a good solution for building up your own quick and cheap measurement tool needed in every electronic garage.
C Meter click
C meter click as its' own name says measures capacity. It is constructed as astable multi-vibrator circuit which generates the impulses with frequency which depends on capacity at the input. The only thing we should do is count the number of interrupts on INT pin in one second and then with a little math, calculate the capacitance connected to the input. The click board has high accuracy for capacitors in range ( 100ρF - 10μF ).
The click board generates the impulses when there is no capacitor connected to the inputs and that value can be used to calculate the capacitance of the built-in capacitor which is already on the board and it is necessary for proper functionality. The capacitor that we connect to the inputs will be in parallel connection with the built-in one and as the rule for capacitor says, parallel connected capacitors act like one capacitor with the same capacitance, ( like the sum of the two ). This means that the value that we measure represents the sum of the default capacitor and capacitor connected to the inputs.
Taking a closer look to the example might give you an idea on how to implement the algorithm. First of all, the timer interrupt on every second is needed, you can also choose some other value and basically greater time means better accuracy but also longer measurement. Then we can count number of external interrupts on INT pin between two timer interrupts and calculate the frequency which is the number of interrupts in one second. After that we can calculate the capacity on inputs like :
T = 1 / f // Period
C = T / 77616 // Capacity
You might be wondering what is the significance of 77616. That is, let's say, a constant which depends on resistors Ra and Rb. That number will always be the same if you haven't made some replacement of resistors on the click board.
The calculated capacitance when there is nothing being input represents the capacitance of the built-in capacitor, and when we calculate capacitance when we have connected a capacitor at the inputs, the final value will be the difference of the two capacities.
Ammeter click
Measuring of the current with Ammeter click is even more simpler than the previous one. There is no interrupts - very avoided by newbies inside the embedded development, but also by more experienced developers. Compared to the previous one this click board provides two possible ways to get the measurement. It can be read through the SPI bus from MCP3201 analog to digital converter, or by the reading voltage on AN pin and then converting it with the MCUs ADC.
The possibility to measure the current on the AN pin is allowed for cases when your MCU has higher ADC resolution than 12-bit provided by MCP3201.
After we measure the output on AN pin or through the SPI using the simple formula, we can calculate the current. Better precision can be achieved by measurement of more than one sample, for example the average of 10 measurements is more accurate than 1 measurement. It is important to notice that this click board has its' own electronic circuit, and may not be powered from the same source which we are measuring. Result will not be correct in that case. Also it can be used to measure AC current. Limit for current is 1 A in the case of AC, for peak to peak value.
R Meter click
Just like Ammeter click, this click board also has a method to read voltage from AN pin or to use MCP3201 and read raw value from ADC. There is one more addition which improves the range of resistance that can be measured with this click board. This click board has an additional 74HC4053 multiplexer which makes auto-selection between three possible resistors depend on resistance that we are measuring. General range of resistance that can be measured is from 0 Ω to 1 MΩ.
It is the same in the case of Ammeter to improve the precision of the measurement we can take more than one measurement on some period of time and then calculate the average value which will be used for final calculation.
Summary
These were three very simple but at the same time very useful click boards. Full implementation of functionality can be done in a few minutes. Everything is based on analog electronic so the schematics might give you an idea on how to construct your own cheap measurement tool.