Eco-Friendly Home Automation Controller

The 2012 DesignSpark chipKIT Challenge invited engineers from around the world to submit eco-friendly projects using the Digilent chipKIT Max32 development board. Manuel Iglesias Abbatemarco of Venezuela won honorable mention with his autonomous home-automation controller. His design enables users to monitor and control household devices and to log and upload temperature, humidity, and energy-use sensor data to “the cloud” (see Photo 1).

The design comprised a Digilent chipKIT board (bottom), my MPPT charger board (chipSOLAR, middle), and my wireless board (chipWIRELESS, top).

Photo 1: The design comprised a Digilent chipKIT board (bottom), my MPPT charger board (chipSOLAR, middle), and my wireless board (chipWIRELESS, top).

The system, built around the chipKIT Arduino-compatible board, connects to Abbatemarco’s custom-made “chipSOLAR” board that uses a solar panel and two rechargeable lithium-ion (Li-on) cells to provide continuous power. The board implements a maximum power point tracking (MPPT) charger that deals with a solar panel’s nonlinear output efficiency. A “chipWIRELESS” board integrating a Quad Band GSM/GPRS modem, an XBee socket, an SD card connector, and a real-time clock and calendar (RTCC) enables home sensor and cloud connectivity. The software was written using chipKIT MPIDE, and the SD card logs the data from sensors.

“Since the contest, I have made some additions to the system,” Abbatemarco says. “The device’s aim is uninterrupted household monitoring and control. To accomplish this, I focused on two key features: the power controller and the communication with external devices (e.g., sensors). I used DesignSpark software to create two PCBs for these features.”

Abbatemarco describes his full project, including his post-contest addition of a web server, in his article appearing in Circuit Cellar’s May issue. In the meantime, you’ll find descriptions of his overall design, power management board, and wireless board in the following article excerpts.

DESIGN OVERVIEW
The system’s design is based on a Digilent chipKIT Max32 board, which is an Arduino-compatible board with a Microchip Technology 32-bit processor and 3.3-V level I/O with almost the same footprint as an Arduino Mega microcontroller. The platform has all the computational power needed for the application and enough peripherals to add all the required external hardware.

I wanted to have a secure and reliable communication channel to connect with the outside world, so I incorporated general packet radio service (GPRS). This enables the device to use a TCP/IP client to connect to web services. It can also use Short Message Service (SMS) to exchange text messages to cellular phones. The device uses a serial port to communicate with the chipKIT board.

I didn’t want to deal with cables for the internal-sensor home network, so I decided to make the system wireless. I used XBee modules, as they offer a good compromise between price and development time. Also, if properly configured, they don’t consume too much energy. The XBee device uses a serial port to communicate with the chipKIT board.
To make the controller”green,” I designed a power-management board that can work with a solar panel and several regulated DC voltages. I chose a hardware implementation of an MPPT controller because I wanted to make my application as reliable as possible and have more software resources for the home controller task.

One board provides power management and the other enables communication, which includes additional hardware such as an SD card, an XBee module, and an RTCC. Note: I included the RTCC since the chipKIT board does not come with a crystal oscillator. I also included a prototyping area, which later proved to be very useful.

I was concerned about how users inside a home would interact with the device. The idea of a built-in web server to help configure and interact with the device had not materialized before I submitted the contest entry. This solution is very practical, since you can access the device through its built-in server to configure or download log files while you are on your home network.

POWER MANAGEMENT BOARD
To make the system eco-friendly, I needed to enable continuous device operation using only a solar panel and a rechargeable Li-ion battery. The system consumes a considerable amount of power, so it needed a charge controller. Its main task was to control the battery-charging process. However, to work properly, it also had to account for the solar panel’s characteristics.

A solar panel can’t deliver constant power like a wall DC adapter does. Instead, power varies in a complex way according to atmospheric conditions (e.g., light and temperature).
For a given set of operational conditions, there is always a single operating point where the panel delivers its maximum power. The idea is to operate the panel in the maximum power point regardless of the external conditions.

I used Linear Technology’s LT3652 MPPT charger IC, which uses an input voltage regulation loop. The chip senses the panel output voltage and maintains it over a value by adjusting the current drawn. A voltage divider network is used to program the setpoint.
You must know the output voltage the panel produces when operated at the maximum power point. I couldn’t find the manufacturer’s specification sheet for the solar panel, but the distributor provides some experimental numbers. Because I was in a hurry to meet the contest deadline, I used that information. Based on those tests, the solar panel can produce approximately 8 V at 1.25 A, which is about 10 W of power.

I chose 8 V as the panel’s maximum power point voltage. The resistor divider output is connected to the LT3652’s VIN_REG pin. The chip has a 2.7-V reference, which means the charge current is reduced when this pin’s voltage goes below 2.7 V.

I used a two-cell Li-ion battery, but since the LTC3652 works with two, three, and four cells, the same board with different components can be used with a three- or four-cell battery. The LT3652 requires an I/O voltage difference of at least 3.3 V for reliable start-up, and it was clear that the panel’s 8-V nominal output would not be enough. I decided to include a voltage step-up stage in front of the LT3652.

I used Linear Technology’s LT3479 DC/DC converter to get the panel output to around 18 V to feed the MPPT controller. This only works if the LT3562’s voltage control loop still takes the VIN_REG reference directly from the panel output. Figures 1 and 2 show the circuit.

Power management board

Figure 1: Power management board

Figure 2: Power management board

Figure 2: Power management board

I could have fed the chipKIT on-board 5-V linear regulator with the battery, but I preferred to include another switching regulator to minimize losses. I used Linear Technology’s LTC3112 DC/DC converter. The only problem was that I needed to be able to combine its output with the chipKIT board’s 5 V, either through the USB port or the DC wall adapter option.

The chipKIT board includes a Microchip Technology MCP6001 op-amp in comparator configuration to compare USB voltage against a jack DC input voltage, enabling only one to be the 5-V source at a given time. Something similar was needed, so I included a Linear Technology LTC4411 IC, which is a low-loss replacement ORing diode, to solve the problem.

To my knowledge, when I designed the board a battery gauge for two-cell lithium batteries (e.g., a coulomb counter that can indicate accumulated battery charge and discharge) wasn’t available. The available options needed to handle most of the computational things in software, so I decided it was not an option. I included a voltage buffer op-amp to take advantage of the LTC3112’s dedicated analog voltage output, which gives you an estimate of the instantaneous current being drawn. Unfortunately, I wasn’t able to get it to work. So I ended up not using it.

Building this board was a challenge, since most components are 0.5-mm pitch with exposed pads underneath. IC manufacturers suggest using a solid inner ground layer for switching regulators, so I designed a four-layer board. If you have soldering experience, you can imagine how hard it is to solder the board using only a hot air gun and a soldering iron. That’s why I decided it was time to experiment with a stencil, solder paste, and a convection oven. I completed the board by using a commercially available kitchen convection oven and manually adjusting the temperature to match the reflow profile since I don’t have a controller (see Photo 2).

Photo 3: Custom chipSOLAR board

Photo 2: Custom chipSOLAR board

WIRELESS BOARD
The wireless board has all the components for GPRS communication and the 802.15.4 home network, as well as additional components for the SD file system and the RTCC. Figure 3 shows the circuit.

Figure 3: The communication board schematic is shown.

Figure 3: The communication board schematic is shown.

At the time of the contest, I used a SIMCom Wireless Solutions SIM340 GPRS modem. The company now offers a replacement, the SIM900B. The only physical differences are the board-to-board connectors, but the variations are so minimal that you can use the same footprint for both connectors.

During the contest, I only had the connector for the SIM340 on hand, so I based almost all the firmware on that model. Later, I got the SIM900B connector and modified the firmware. The Project Files include the #if defined clause for SIM900 or SIM340 snippets.

A couple of things made me want to test the SIM900B module, among them the Simple Mail Transfer Protocol (SMTP) server functionality and Multimedia Messaging Service (MMS). Ultimately, I discovered that my 32-MB flash memory version of the SIM900B was not suitable for those firmware versions. The 64-MB version of the hardware is required.
The subscriber identity module (SIM) card receptacle and associated ESD protection circuitry are located on the upper side of the board. The I/O lines connected to the modem are serial TX, RX, and a power-on signal using a transistor.

The chipKIT Max32 board does not have a 32,768-Hz crystal, so Microchip Technology’s PIC32 internal RTCC was not an option. I decided to include Microchip Technology’s MCP79402 RTCC with a super capacitor, mainly for service purposes as the system is already backed up with the lithium battery.

I should have placed the SD card slot on the top of the board. That could have saved me some time during the debugging stage, when I have had some problems with SD firmware that corrupts the SD file system. When I designed the board, I was trying to make it compatible with other platforms, so I included level translators for the SD card interface. I made the mistake of placing a level translator at the master input slave output (MISO), which caused a conflict in the bus with other SPI devices. I removed it and wire-wrapped the I/O lines.

Another issue with this board was the XBee module’s serial port net routing, but it was nothing that cutting some traces and wire wrap could not fix. Photo 3 shows all the aforementioned details and board component location.

Photo 3: This communication board includes several key components to enable wireless communication with sensors,  the Internet, and cellular networks.

Photo 3: This communication board includes several key components to enable wireless communication with sensors,the Internet, and cellular networks.

Editor’s Note: Visit here to read about other projects from the 2012 DesignSpark chipKIT Challenge.

Member Profile: Scott Weber

Scott Weber

Scott Weber

LOCATION:
Arlington, Texas, USA

MEMBER STATUS:
Scott said he started his Circuit Cellar subscription late in the last century. He chose the magazine because it had the right mix of MCU programming and electronics.

TECH INTERESTS:
He has always enjoyed mixing discrete electronic projects with MCUs. In the early 1980s, he built a MCU board based on an RCA CDP1802 with wirewrap and programmed it with eight switches and a load button.

Back in the 1990s, Scott purchased a Microchip Technology PICStart Plus. “I was thrilled at how powerful and comprehensive the chip and tools were compared to the i8085 and CDP1802 devices I tinkered with years before,” he said.

RECENT EMBEDDED TECH ACQUISITION:
Scott said he recently treated himself to a brand-new Fluke 77-IV multimeter.

CURRENT PROJECTS:
Scott is building devices that can communicate through USB to MS Windows programs. “I don’t have in mind any specific system to control, it is something to learn and have fun with,” he said. “This means learning not only an embedded USB software framework, but also Microsoft Windows device drivers.”

THOUGHTS ON THE FUTURE OF EMBEDDED TECH:
“Embedded devices are popping up everywhere—in places most people don’t even realize they are being used. It’s fun discovering where they are being applied. It is so much easier to change the microcode of an MCU or FPGA as the unit is coming off the assembly line than it is to rewire a complex circuit design,” Scott said.

“I also like Member Profile Joe Pfeiffer’s final comment in Circuit Cellar 276: Surface-mount and ASIC devices are making a ‘barrier to entry’ for the hobbyist. You can’t breadboard those things! I gotta learn a good way to make my own PCBs!”

Member Profile: Tom Freund

Tom Freund

Tom Freund

LOCATION:
West Hartford, CT, USA

MEMBER STATUS:
Tom has been a member for four years.

TECH INTERESTS:
Tom says he enjoys machine learning; algorithm design; embedded, prognostic, and diagnostic systems; and eLua and C programming.

RECENT EMBEDDED TECH ACQUISITION:
Tom recently bought a Femtoduino board and a Texas Instruments TMP102 sensor breakout board.

PREFERRED MICROCONTROLLER:
His current microcontrollers of choice are the STMicroelectronics STM32 32-bit ARM Cortex and Atmel’s ATmega328.

CURRENT PROJECTS:
Tom is working on PicoDB, an open-source, NoSQL database tool for 32-bit microcontrollers written in Lua. (To learn more, visit www.lua.org/wshop12/Freund.pdf.)

THOUGHTS ON THE FUTURE OF EMBEDDED TECH:
Tom says when he thinks about embedded technology’s future, just one phrase comes to mind: “the Internet of things.”

“In 10 to 15 years time, we will look back and think of Facebook, Twitter, and (yes) even Google as the ’Model T’ days of global networking,” he says. “That is because everything will be connected to everything at various levels of security. We and our infrastructure will be ’minded’ by unseen digital butlers that help us cope with life and its unpredictability, as well as protect that which should be kept private.”

Member Profile: Dean Boman

Dean Boman

Dean Boman

LOCATION:
Chandler, AZ

MEMBER STATUS:
Dean has been a subscriber for about  20 years.

TECH INTERESTS:
Dean enjoys designing and building home automation systems. His current system’s functions include: security system monitoring, irrigation control, water leak detection, temperature and electrical usage monitoring, fire detection, access control, weather and water usage monitoring, solar hot water system control, and security video recording.

MOST RECENT EMBEDDED TECH ACQUISITION:
A Microchip Technology debugger.

CURRENT PROJECTS:
Dean is currently designing a hybrid solar power system to power his home automation system. “The power system will use a processor-controlled dual-input power converter design to harvest the maximum energy possible from the photovoltaic cells and then augment that with utility power as necessary to support the load,” he explained. “The system will be a hybrid between an on-grid and an off-grid system. The hybrid approach was chosen to avoid the regulatory issues with an on-grid system and the cost of batteries in an off-grid system.”

THOUGHTS ON THE FUTURE OF EMBEDDED TECH:
“As more and more capability is being made available to the embedded world, the design opportunities are endless. I particularly find it exciting that network connectivity can now be so easily added to an embedded system so various embedded systems can communicate with each other and with the outside world via the Internet. I am concerned that so many of the new embedded parts are designed with extremely fine pitch leads, which makes DIY assembly with hand soldering a challenge,” he said.

New Products: May 2013

iC-Haus

iC-Haus iC-TW8

The iC-TW8 is a high-resolution signal processor designed to evaluate sine/cosine sensors. Its automatic functions help minimize angular errors and jitters. The processor can be used for initial, push-button calibration and to permanently adapt signal-path parameters during operation. The angular position is calculated at a programmable resolution of up to 65,536 increments per input cycle and output as an indexed incremental signal. A 32-bit word, which includes the counted cycles, is available through the SPI.

As an application-specific DSP, the iC-TW8 has two ADCs that simultaneously sample at a 250-ksps rate, fast CORDIC algorithms, special signal filters, and an analog front end with differential programmable gate amplifier (PGA) inputs that accepts typical magnetic sensor signals from 20 mVPP and up. Signal frequencies of up to 125 kHz enable high rotary and linear speeds for position measuring devices and are processed at a 24-µs constant latency period.

The device’s 12-bit measurement accuracy works with one button press. Measuring tools are not required. The iC-TW8 independently acquires information about the signal corrections needed for offset, amplitude, and phase errors and stores them in an external EEPROM.

The iC-TW8 has two configuration modes. Preset functions and interpolation factors can be retrieved through pins and the device can be calibrated with a button push. No programming is required for initial operation.

The device’s functions—including an AB output divider for fractional interpolation, an advanced signal filter to reduce jitter, a table to compensate for signal distortion, and configurable monitors for errors and signal quality—can be accessed when the serial interfaces are used. Typical applications include magnetic linear displacement measuring systems, optical linear scales, programmable magnetic/optical incremental encoders, high-resolution absolute/incremental angle sensors with on-axis, Hall scanning, and the general evaluation of sine/cosine signals (e.g., PC measuring cards for 1 VPP and 11 µAPP).

The iC-TW8 operates on a 3.1-to-5.5-V single-ended supply within a –40°C-to-125°C extended operating temperature range. It comes in a 48-pin QFN package that requires 7 mm × 7 mm of board space. A ready-to-operate demo board is  available for evaluation. An optional PC operating program, in other words, a GUI, can be connected with a USB adapter.

The iC-TW8 costs $7.69 in 1,000-unit quantities.

iC-Haus GmbH

www.ichaus.com


ULTRASOUND RECEIVERS

Analog Devices AD9675

The AD9675 and the AD9674 are the latest additions to Analog Devices’s octal ultrasound receiver portfolio. The devices and are pin compatible with the AD9670/AD9671.

The AD9675 is an eight-channel ultrasound analog front end (AFE) with an on-chip radio frequency (RF) decimator and Analog Devices’s JESD204B serial interface. It is designed for mid- to high-end portable and cart-based medical and industrial ultrasound systems. The device integrates eight channels of a low-noise amplifier, a variable-gain amplifier, an anti-aliasing filter, and a 14-bit ADC with a 125-MSPS sample rate and a 75-dB signal-to-noise ratio (SNR) performance for enhanced ultrasound image quality. The on-chip RF decimator enables the ADC to be oversampled, providing increased SNR for improved image quality while maintaining lower data I/O rates. The 5-Gbps JESD204B serial interface reduces ultrasound system I/O data routing.

The AD9674 offers similar functionality, but includes a standard low-voltage differential signaling (LVDS) interface. Both devices are available in a 144-ball, 10-mm × 10-mm ball grid array (BGA) package.

The AD9674 and the AD9675 cost $62 and $68, respectively.

Analog Devices, Inc.

www.analog.com


LOW-VOLTAGE DIGITAL OUTPUT HALL-EFFECT SENSORS

Melexis MLX92212

Melexis MLX92212

MLX92212 digital output Hall-effect sensors are AEC-Q100-qualified devices that deliver robust, automotive-level performance. The MLX92212LSE-AAA low-hysteresis bipolar latch and the MLX92212LSE-ABA high-hysteresis unipolar switch are optimized for 2.5-to-5.5-V operation. They pair well with many low-power microcontrollers in embedded systems. The sensor and specified microcontroller can share the same power rail. The sensors’ open-drain outputs enable simple connectivity with CMOS/TTL. They exhibit minimal magnetic switch point drift over temperature (up to 150°C) or lifetime and can withstand 8 kV electrostatic discharge.

The MLX92212LSE-AAA is designed for use with multipole ring magnets or alternating magnetic fields. It is well suited for brushless DC electric motor commutation, speed sensing, and magnetic encoder applications. Typical automotive uses include anti-trap/anti-pinch window lift controls, automatic door/hatch systems, and automatic power seat positioning. The MLX92212LSE-ABA enables the use of generic/weak magnets or larger air gaps. It can be used in simple magnetic proximity sensing and interlocks in covers/hatches or ferrous-vane interrupt sensors for precise position and timing applications.

Both MLX92212 devices utilize chopper-stabilized amplifiers with switched capacitors. The CMOS technology makes this technique possible and contributes to the sensors’ low current consumption and small chip size.

The MLX92212 sensors cost $0.35 each in 5,000-unit quantities and $0.30 in 10,000-unit quantities.

Melexis Microelectronic Integrated Systems

www.melexis.com


POWERFUL SPI ADAPTERS

Byte SPI Storm

Byte SPI Storm

The SPI Storm 50 and the SPI Storm 10 are the latest versions of Byte Paradigm’s SPI Storm serial protocol host adapter. The adapters support serial peripheral interface (SPI), Quad-SPI, and custom serial protocols in the same USB device.

The SPI Storm 50 and the SPI Storm 10 support serial protocols and master up to 50 and 10 MHz, respectively. The SPI Storm 10 features an 8-MB memory, while the higher-end devices are equipped with a 32-MB memory.

The SPI Storm adapters enable system engineers to access, communicate, and program their digital board and digital ICs, such as field-programmable gate array (FPGA), flash memories, application-specific integrated circuit (ASIC), and

system-on-a-chip (SoC). The SPI Storm 10 is well suited for engineering schools and universities because it is a flexible, all-around access device for hands-on digital electronics. The 50- and 100-MHz versions can be used in mid- and high-end testing and debugging for telecommunications, medical electronics, and digital imaging industries.

The SPI Storm 50 and the SPI Storm 10 cost $530 and $400, respectively.

Byte Paradigm

www.byteparadigm.com


ANALOG-BASED POWER MANAGEMENT CONTROLLER WITH INTEGRATED MCU

Microchip MCP19111

Microchip MCP19111

The MCP19111 digitally enhanced power analog controller is a new hybrid, digital and analog power-management device. In combination with the expanded MCP87xxx family of low-figure-of-merit (FOM) MOSFETs, it supports configurable, high-efficiency DC/DC power-conversion designs for many consumer and industrial applications.

The MCP19111 controller, which operates at 4.5 to 32 V, integrates an analog-based PWM controller with a fully functional flash-based microcontroller. This integration offers the flexibility of a digital solution with the speed, performance, and resolution of an analog-based controller.

The MCP19111 devices have integrated MOSFET drivers configured for synchronous, step-down applications. The MCP87018, MCP87030, MCP87090, and MCP87130 are 25-V-rated, 1.8-, 3-, 9-, and 13-mΩ logic-level MOSFETs that are specifically optimized for switched-mode-power-supply (SMPS) applications.

The MCP19111 evaluation board includes Microchip’s high-speed MOSFETs. This evaluation board includes standard firmware, which is user-configurable through an MPLAB X IDE graphical user interface (GUI) plug-in. The combined evaluation board, GUI, and firmware enable power-supply designers to configure and evaluate the MCP19111’s performance for their target applications.

The MCP19111 controllers cost $2.81 each and the MCP87018/030/090/130 MOSFETs cost $0.28 each, all in 5,000-unit quantities.

Microchip Technology, Inc.

www.microchip.com


ELASTOMER SOCKET FOR HIGH-SPEED QFP ICs

Ironwood SG-QFE-7011

Ironwood SG-QFE-7011

The SG-QFE-7011 is a high-performance QFP socket for 0.4-mm pitch, 128-pin QFPs. The socket is designed for a

1.6-mm × 14-mm × 14-mm package size with a 16-mm × 16-mm lead tip to tip. It operates at bandwidths up to 10 GHz with less than 1 dB of insertion loss and has a typical 20 mΩ per I/O contact resistance. The socket connects all pins with 10-GHz bandwidth on all connections. The small-footprint socket is mounted with supplied hardware on the target PCB. No soldering is required. The small footprint enables inductors, resistors, and decoupling capacitors to be placed close to the device for impedance tuning.

The SG-QFE-7011’s swivel lid has a compression screw that enables ICs to be quickly changed out. The socket features a floating compression plate to force down the QFP leads on to elastomer. A hard-stop feature is built into the compression mechanism.

The sockets are constructed with high-performance, low-inductance gold-plated embedded wire on elastomer as interconnect material between a device and a PCB. They feature a –35°C-to-100°C temperature range, a 0.15-nH pin self inductance, a 0.025-nH mutual inductance, a 0.01-pF capacitance to ground, and a 2-A per pin current capacity.

The SG-QFE-7011 costs $474.

Ironwood Electronics

www.ironwoodelectronics.com