Build Your Own Total System Power Analyzer

Overall Score

Building an all inclusive single PCB device incorporating the sensors, A/D system, and power distribution for those components is no small task but turns out to be relatively cost effective. The entire project can be constructed in the $100 to 150 range, but will require significant time if you are not experienced with microcontroller programming, soldering, and PCB design. Here we will provide a parts list and describe in general how to build this one, we have not yet built a unit using this approach so it is left up to you, the reader, to climb the learning curve.

Parts list/Costs

The above list is not comprehensive, but more or less what one can expect. The total bill comes to roughly $135 to $140 depending on choice for PCB supply. The choice of the ATMega1280 over the ATMega168 occurs for a couple of reasons, the 1280 has 16 rather than 8 A/D inputs which lends some more flexibility and, ultimately, 8 more digial lines to that can be used to measure voltage for each rail, in addition to the 8 A/D channels for extracting current. The second reason is that the ATMega1280 (as well as the 168) are well supported in the open hardware community, and have straightforward programming environments. In fact, prototyping for XCPUs version is currently using the open source Arduino Mega development board.

Task list

Step 1

The first task is to generate the PCB and this is no small feat. It is this and the physical soldering that puts this project into the realm of the advanced hobbyist. First, download Eagle Cad and draw out the schematic for the PCB, you will need to wire up the MCU, all 8 of the sensors, the 16 MHz crystal (which times the MCU), the FTDI USB to Serial controller, programmer header and the USB header. The sensor wiring pins are documented in the reference Allegro spec sheet.

For the sensor, the particlur PSU input to be measured will input on the IP+ (1,2) side and exit to the load side through the IP- (pins 3,4). The diagram shown above shows a capacitor between pins 5 and 6, this sets the effective bandwidth (and reject high frequency noise), however with the A/D sampling rate afforded by the MCU, this capacitor can be left out entirely without affecting the measurement quality. If you choose to use a capacitor, Allegro recommends on the order of 50-100 nF. Pin 5 is a common ground, which can (and should) use the USB bus ground (this will be the ground for all components on your PCB). The capacitor shown Cbyp is only there to decrease the noise on the input line. A better approach would be to utilize a filter on the system supply of the USB supply. The USB voltage on the USB bus (which will ultimately provide power to the entire device) is actually pretty good depending on what computer system you connect it to, but it is a good idea to put a capacitor on this supply to quiet the line noise.





The wiring diagram for the crystal, power for the MCU can be found here. We use this because a) we have not yet developed our own schematic, b) we have done a much easier build of the prototype system, and c) this section is intended as a guideline and not a complete how to. The schematic linked actually contains much more than you need. You want to ensure you include the crystal connections, the FTDI (which pin RX/TX to pin 63,64 of the MCU, as well as the V(out) from the Allegro sensors to a A/D channel.

When laying out your PCB in Eagle CAD, make sure you take into account the gauge of wires, the density, and the max current rating (to be safe), submission of your PCB to a prototype company should also specify 2 oz Cu with appropriate pad widths to handle the current.

Step 2

The second step, is, of course to physically build it. The difficulty residing in the fact that both the sensor and the MCU are surface mounted which requires advanced skill with a soldering iron. Nonetheless, if you are one brave enough to attempt it more power to you, once the PCB is constructed you must now program the MCU to perform the A/D acquisition and send the digital result to the USB port. There are a few ways to do this, the most flexible is to simply program a simple loop which reads all 8 A/D channels and reports them back to the host, software on the host computer can then do the conversion to volts/amps/then power, or you could program the MCU to do the conversion. Doing the conversion on the MCU will slow down data acquisition rates, but for the purpose of this project it probably would not matter. Aside from programming the MCU, you will also need to write a client application for a personal computer to receive the information from the MCU and store/plot it. The client PC application is actually not difficult, any progamming language that can control a serial com port can be used to create the software.

Step 3

The final step is to calibrate the sensors. You will need to run current through each sensor of known amperage, then correlate this back to the measured voltage produced by that sensor. This is a tedious process, but the quality of the sensors yields more than adequate results.


  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati

Leave A Response