Just XBee Left Wire

I finally got around to spend some time on this and got everything on a perfboard . I also included a temperature sensor (LM35) along with a button to select the LCD display mode.  If I had to change one thing, I would chose different connectors so I can disconnect the current and voltage sensing wiring without screwing on a terminal block. I removed the CT and voltage wiring to the terminal block in the picture.

IMG_2643

Given that I will be working with two current transformers any open circuit can be lethal. I will  add a switch that short circuits the secondary before I disconnect from the terminal blocks. The last piece to connect will be a XBee chip to send the data to the master. As stated early, I am using Modbus over serial as the protocol to communicate with the host.

One thing that did give me grief is that the temperature reading was erratic under certain scenarios.  I sampled the currents and voltage to get 2000 samples do some computations and then take a sample of the ambient temperature. If I did not perform the 2000 sample burst, I got a stable temperature reading. If I looped for sample 2000 readings then took a temperature, the temperature would be erratic.  I still don’t know why and my hunch is that it lies in the A/D mux in the Arduino.  What I did was take average 10 temperature readings with a delay of 20 ms between sample which led to a more stable temperature reading.

All that is left is to mount an XBee chip on the bread board and the hardware should be ready to stuff into an enclosure.

Hardware

Measuring Current

There are two ways I am willing to entertain for measuring current. One is via a current transformer and the other vial hall effect.

I combed the web to look for affordable devices in North America. It seems that Europe has access to cheaper current transformers.  I ended purchasing three  (3) current transformers and two(2) hall effect chips.

Two (2) revenue Grade Current Transformer Two from CR Magnetics to install on each side of my 200A pannel per each side  (CR8459-2000-N)

One (1) general purpose 0-20A for experimentation CR Magnetics  (CR8410-1000)

Two (2) Hall effect bases chips from Allegro ACS712ELCTR-20A-T

I ordered on-line via Digi-Key and found to have an excellent customer experience. I opted for one stop shopping for other goodies such as zigbee chips and other odds and ends. I also wanted something Canada friendly so I picked a place that operates in both Canada and US.

I entertained the idea of spit-core transformers to facilitate wrapping around the wire. I could not find some at a cheap rate and figured some higher quality ones could be used for permanent installation. I’ve done enough wiring to feel comfortable inside the panel box. I would not recommend venturing in high voltage areas without a good understanding what can harm you. Get an electrician to wire those if you have any doubts.

Measuring Voltage

I have a bunch of AC transformers lying around so I plan on using those to measure the AC voltage.  120:10 volts p-p will do as that is all I have in stock.

Embedded System
I entertained the idea of using a multi-tasking OS such as The FreeRTOS Project and finding a board to host it. The KISS principle forced me to focus on deploying hardware to perform specific tasks and avoid creeping elegance. I only want a device that at will feed into the mesh network. No sense over engineering things. I can use the FreeRTOS for a data concentrator later on. There were many choices out there e.g.  PIC and Micromint. I opted for simplicity and went with the Arduino Duemilanove.

I purchased my Aduino from spikenzielabs along with the following to help me get ball going.

  • Arduino Duemilanove w/ Atmega328
  • XBee Explorer USB
  • Adafruit Proto Shield for Arduino
  • Basic 16×2 Character LCD – White on Black 5V
  • Breakout Board for XBee Module

power parts

Time to plug things in and see what happens.