Update: Memory usage reporting fixed in Analog PC Stats application

Updated PC Meter application

It was brought to my attention a couple months ago by mnedix that the application I developed for the Analog PC Stats Meter was not reporting the correction Memory usage. I looked into it, and it turns out that the PerformanceCounter I was using in C# ties into the page file, not just physical memory. Apparently it was close enough to the physical memory used when I tested the program initially, because I never caught it. I just released an updated version of the application today that get the actual physical memory percentage used (you can download it here). It utilizes the GetPerformanceInfo Windows API to do this, using code developed by Antonio Bakula. This post at Stack Overflow is what led me to his solution. As the screenshot above shows, it’s now very close to what Windows reports. It’s a little off, maybe due to rounding, I didn’t have a lot of time to dig deeper. It’s close enough, at least for me! In the screenshot, I’ve got a couple textboxes that display physical available memory and total physical memory for troubleshooting.

While I’m posting, I want to point out it’s been approximately a year since I last posted on my blog, but I’m still here. The last year-and-a-half has been quite hectic for me, but I hope to get back into working on projects and sharing them on here soon! I’ve heard from a few people who have enjoyed my posts and used the information I’ve shared to work on their own projects and it’s been great hearing from them. Thanks!

Vintage Stansi Ammeter

Vintage Stansi AmmeterThis was a random find on Ebay, just something I came across while looking for something else.  I really liked the look of it, and I needed something that could measure large currents anyways, so I bought it.  I have a Sparkfun digital multimeter, which is a steal at $15 and serves most of my needs as a hobbyist, but it’s best used for low current measurements, under 200ma.  It can do up to 10 amps, but only for 10 seconds.  It’s a useful feature, but sometimes I want to watch a circuit’s current for an extended period of time.  I don’t want to buy an expensive DMM when the Sparkfun unit serves 98% of my needs, so an analog ammeter seemed like a good compromise.  It may not be as accurate as a DMM, but it’s good enough for my needs.

Stansi meter dissasembledI don’t know much about the meter, other than it was made by a company called Stansi located in Chicago, and it has three ranges of measurement: 0-1.5 amps, 0-3 amps and 0-30 amps.  After receiving the meter, I tried it out, and found that the measurements it was giving all seemed to be significantly off.  I was disappointed; I liked the look of it, but I didn’t buy it to be an antique, I bought it to actually use!  I noticed that the connections on the underside of the meter were all corroded quite a bit, so I took all of the connections apart, cleaned all of the posts, washers, nuts and other bits and pieces with steel wool, and put everything back together.  After testing it some more, it seems that all it needed was a good cleaning, the measurements are all very close now when compared to the DMM.  Success!

Stansi meter measuring circuitIf you’re hobbyist like me, and need to measure large currents but don’t want to spend the money on an expensive DMM that you don’t really need, then an analog ammeter may be the solution.  A digital display certainly has significant advantages in terms of speed an accuracy, but if you buy a large meter, it should be easy to get a “close enough” measurement.  In the photo to the left you can see the Stansi meter connected to a BigClive.com RGB controller, and it’s clear that it’s pulling approximately 320ma of current.  It may not be as quick or accurate as a DMM, but there’s something about watching that needle bounce around that an LCD display can’t replicate, and for $20 and an hour of my time, it’s a good value.  I expect to get lots of use out of this meter.

pc meter header

Analog PC Stats Meter

Intro

At some point while researching microcontroller projects, I came across several people who had used Arduinos and PICs to drive analog panel meters so they would display computer stats such as CPU load, memory usage, etc.  It immediately struck me as something I just had to do.  Here it is.  My PC meter uses an Arduino microcontroller and receives the stats from a .NET Framework application I wrote in C#.Net.  It’s housed in a plastic enclosure and looks quite professional IMHO.  It was a fun project, and something I think most any computer/electronics geek would enjoy.  I love mine, and I look forward to building more.

Here it is in action:

Read on for details on the parts and tools I used, some info on the process of building the device (and the problems I ran into) and links to download the source code and meter templates.

(more…)