I still have a few minor issues to work out with the ADE7763, but now I have my eyes back to the system design. I need to figure out how to build 30+ of the sensors and connect them up to a master data logging station.Hand building 30 circuits does not sound feasible. I think I will have to have some boards made. Someplace like ExpressPCB might work but the cost seems high. I think I will look into BatchPCB from Sparkfun. Here you buy spare board space on panels that Sparkfun is having built. Wait times are high, but the cost is very low.
Now the question is what to put on each sensor node. The basic items needed are:
- Crystal for ADE7763
- Anti aliasing filter for CT and voltage sensor
- Decoupling caps
- Status LED(s)
- Connectors for CT, Voltage Sense, SPI, and power
First question is how to connect 30 boards together. Point to point wiring would be absurd. I think that board to board connectors like the Arduino’s stackable header is the way to go. Then I can stack up two sets of 15 boards (one set for each power phase) and only have to wire each stack the master computer.
So going with stackable headers means all the interconnects must be bussed and not chained. This presents a small problem with the ADE7763 chip select (CS) line and interrupt (INT) lines. How to bus unique CD and INT to each board and how does a master not need a ton of IO pins to support 60 CS and INT pins?
Well the interrupts pin is not too bad. The ADE7763 only pulls the line low allowing many interrupt pins to be wire ORed together. If the ADE7763 had its interrupts disabled except when that chip had the focus, then you could get by with just one INT line.
The next problem is controlling each chip select line. Normally in the SPI code, you would assert the correct CS and then clock out/in the data and then deassert the CS. But with 30+ chips the number of IO pins needed would prevent a small micro from being the master. There are lots of port expansion solutions (shift registers and what not) that could give you all those bits, but it still becomes a problem on how to get a unique CS to each board on a bus.
One recommendation was to have each board take in a data line a clock to a simple flip-flop. The output of the flip flop and the clock line goes to the next board. This way you can clock out a bit and have it show up at the board you want. The issue here is that this does not work on a bus as it needs daisy chaining.
My next solution was to place down a small micro on each sensor board that would take in I2C commands (works great on a bus) and convert to SPI instructions for the ADE. This requires extra complexity and multidrop I2C may be just as much a challenge. It was then I realized that SPI was bus friendly as well. If the CS is not asserted, all the SPI bus lines are tri-stated on the ADE side. So we are back to how to get a unique CS to each ADE.
I think that the solution will likely be to place a small micro down on each board. It would take in a data and a clock line from the master. The master would clock in an address that would be compared to dip switches on the micros GPIO. If the addresses match, an output from the micro would enable a transceiver on the sensor board to allow the CS signal to get to the ADE7763. Now I am in search of a suitable micro (PIC?) and a bus switch.