Path: EDN Asia >> Design Centre >> Consumer Electronics >> Basics of designing a home automation system
Consumer Electronics Share print

Basics of designing a home automation system

10 Jul 2014  | Tushar Rastogi, Rahul Raj Sharma

Share this page with your friends

Figure 7 shows a complete home automation system design. The various components used include:

ADC: The ADC is used to take the readings from the temperature and gas sensors, sample the sensors, and provide a digital value which the CPU can use to make intelligent control decisions.

Thermistor: This component provides an API to convert the digital reading of the temperature sensor into temperature.

SPI: The SPI component directly interfaces with the various peripherals like NFC, Ethernet, etc. This interface uses an additional de-multiplexer to address multiple communication modules using a single host.

I2C: The I2C component interfaces to an RTC and can be expanded to connect to any I2C slave device.

Hex keypad: This is a custom component implemented inside the design environment. This component reads a key press detected in a 4x4 keypad using a state machine designed with UDBs.

IrDA Decoder: This component takes the signal from an IrDA receiver, decodes the signal, and provides the decoded result to the CPU for evaluation and action (figure 8).


Figure 7: Architecture for home automation system as shown in PSoC Creator.



Figure 8: IrDA decoder circuit diagram.


Internal circuit of custom components: SoC design tools provide developers with the flexibility to design custom components using common system blocks as well as hide the complex of circuits behind a simple-to-use block. The above design uses two custom components:

IrDA Decoder (figure 8): This block decodes infrared signals encoded using the RC5 protocol. An RC5 data packet normally has 14 bits, which are sent in the Manchester encoded format (figure 9).


Figure 9: Manchester encoded remote output.


The Bit Extractor block shown in figure 8 recovers the bit and the clock from the incoming signal from the TSOP IrDA receiver in the following manner: The first XOR gate recovers the buried clock from the signal. This signal triggers the PWM component with a period that is ¾ of the serial clock. When the PWM reaches the terminal count it triggers the second DFF to sample the inverted signal. This inverted DFF output signal is inverted once again before being transferred to the shift register. A Lookup Table (LUT) is used to count the number of bits received, and once the 14th bit is received, an interrupt is triggered. In this interrupt, the CPU reads the received data stored in the shift register.

Hex keypad: A Hex Keypad (figure 10) is a 16-button input divided into four columns and four rows to give (4 x 4 =) 16 unique keys. In the given component, one of the column pins is driven low and the rows are read.


Figure 10: Hex keypad decoder circuit diagram.


If a key press is not detected, then the next column pin is driven low and the previous pin is driven high. A key press is detected when a row pin goes low when the corresponding column pin is pulled low. Key press detection makes the 'valid' line go high. This valid terminal is used to generate an interrupt. Inside this interrupt, the CPU will read the 'Key Reg' register to get information about the pressed key.


About the author
Rahul Raj Sharma is an Applications Engineer at Cypress Semiconductors on USB devices. He has worked on PSoC applications and loves doing analogue and mixed signal designs.

Tushar Rastogi is an Applications Engineer at Cypress Semiconductors and has worked on PSoC based applications since 2012. His responsibilities include PSoC firmware programming, application development, technical support to customers with programming, boundary scan related issues, and technical writing.


To download the PDF version of this article, click here.


 First Page Previous Page 1 • 2 • 3 • 4 • 5


Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.


Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming


News | Products | Design Features | Regional Roundup | Tech Impact