For a number of reasons, Jon and I are not happy with the powerline modem options. Chief amoung those reasons are that they are expensive and proprietary. Building them into our product seems to be too restrictive.
So, we decided to investigate the wireless options which seem to be improving in price recently. Bluetooth, Zigbee and Wifi are all comparably priced these days (<$10). However, Wifi seems to still require a somewhat expensive CPU to work and Bluetooth doesn't seem quite right for meshing networks. A closer examination of the Zigbee standard led us to believe that it is the cheapest and easiest low data-rate command network to deploy.
So, we decided to experiment with it by creating our own light switch dimmer. Since we might be abandoning Insteon, we will have to make our own dimmer/control panel for our product. Here is a picture of the layout:
- CPU. We are using the Freescale MC13224. This is a third generation 2.4GHz 801.15.4 SOC. In addition to an integrated antenna transmit/receive it also has two ADCs and many GPIO lines. O... and it is very cheap. This makes it an excellent choice for a low cost dimmer.
- Antenna. We are using the Planar Inverted F Antenna recommended in the application notes of the MC13224. This antenna has a very good omni-directional pattern and is low cost due to it being constructed from copper on the PCB. The antenna is designed to be a quarter of a 2.4GHz wavelength (124.0mm) and have a characteristic impedance of 50 ohms.
- Power. The entire dimmer design runs 'hot'. That is, it is not issolated from the main AC power lines. This is typical for light switches but does pose a safty risk for the developer (I have a power limited AC source in my lab for safty). The DC voltage rail is formed by clipping the 170V AC signal with a 5.1V rectifier. To limit the current (so the rectifier doesn't burn up), a 1uF capacitor is put in series with the mains. This acts like a 2.6K ohm resistor which limits the current entering the circuit to about 50mA. A 100mA 3.3V regulator is then used to stabalize the board power.
- Triac. We are using a 600V, 4A triac to control the power to the load. The MC13224 controls the duty cycle of the triac so that it is only on during part of the AC sinewave. This has the effect of varying the power to the load (thus, dimming it).
- Power Monitor. We have put a 0.050 ohm resistor in series with the load in an attempt to measure the current going to the load. The MC13224 has an integrated 12bit ADC so by measureing the voltage drop across the shunt resistor, we should be able to estimate the current. Since the curcuit also includes a zero-crossing detector, we should be able to calculate the power (including power factor) going to the load.
- Temperature Monitor. We decided to include another circuit to measure the voltage drop across a varistor that is sensitive to temperature.
DigiSpeaker Prototype VI hit a major milestone this week. The Prototype VI Controller and Amp boards were able to play a WAV file!
Jon wanted an amplifier that he could use to test tri-amping and room correction algorithms. We could have used our TAS5504 evaluation module but we wanted to gain some experience with Class AB amplifiers so we decided to make a board based on the National Semiconductor LM4765 audio amplifier. This is a dual amplifier package that can deliver up to 30W per channel.
The schematic is here.
- Power Supply.
Each amplifier can be configured for Inverting or Non-Inverting operation. Also, each pair of amplifiers (U1 and/or U2) can be configured for BTL operation. This lets Jon configure one LM4765 as the tweeter and the mid-range while the other LM4765 can be configured as BTL for the woofer. Roughly, this should provide 20W/20W/40W for the tweeter/mid-range/woofer.
We selected the PCM1690 from TI as the Digital to Analog converter. This part has excellent SNR (113dB) in a compact multi-channel package.
The Bill of Materials is here.
The LR44 batteries that came with the board lasted 48hrs. So I needed a permanent power solution. The simplest way to power a Raven board is via a USB cable. Cut the end off from it to get at the wires inside. Solder red(+5)/black(GND) to the PCB. Note that you hook power up on pins 1/2 of J401 - not where the power jumper is located. +5 on pin 1, GND on pin 2. Use a powered hub as a power supply and you can move the boards away from your PC.
The demo firmware that comes with the boards, is for.. demos. I quickly figured out that I needed to write new firmware. Of course I don't have any way to load this new firmware into the device. I have to get a JTAG that works with Atmel products like the AVR JTAGICE mkII. Lucky for me Arrow is running a half price sale on the JTAG unit. $150 plus $8 shipping is cheaper than you can buy a clone unit from China.
Now I need to start learning about 802.15.4, 6LoWPAN, Zigbee profiles, etc...
Siemens has started an open source Zigbee implementation for Linux. But as soon as I started looking at it I discovered that the license from the Zigbee alliance for using the Zigbee spec is incompatible with the GPL. A request has been made to the Zigbee alliance to fix their license so that it is GPL compatible. We don't have an answer back from them yet.
We are primarily focused on using Insteon in our product, but we are hedging out bets. There is another set of licensing complications around Insteon that we haven't resolved with Smart Labs.
The code for this driver has already been accept for the Linux kernel and it will appear in 2.6.31. AC97 and I2S are both implemented by the same PSC block on the SOC. This code will become the basis for the tri-amp Digispeaker I2S driver.
While I was at it I also implemented AC97 support for the Efika. The Efika is a $99 mpc5200 based development board available from Directron. The Efika was useful for driver development since it has USB and a PCI slot. The current version of the Phytec development system has now added these features making the Efika less useful. Note that it is hard to add custom hardware to an Efika since they didn't bring all of the pins out form the CPU.