element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog Forget Me Not - 5 - Designing a home automation add-on for the Pi [Part 1]
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kipe
  • Date Created: 25 Sep 2014 8:41 PM Date Created
  • Views 668 views
  • Likes 0 likes
  • Comments 3 comments
  • forget_me_not
  • raspberry_pi
  • iot_python
Related
Recommended

Forget Me Not - 5 - Designing a home automation add-on for the Pi [Part 1]

kipe
kipe
25 Sep 2014

Foreword

As I (might) have mentioned before, the initial reason why I got into home automation was the house my dad built in the middle of nowhere. The current system is based heavily on 1-Wire, which is pretty much a wired equivalent for EnOcean standard. 1-Wire bus uses only two wires and each device has an unique address, much like EnOcean.


My goal for the design is to create an add-on for the Raspberry Pi, which will include all the stuff needed for the current system, with the addition of EnOcean. As the house wasn’t originally designed for automation, wireless sensors bring a much needed addition to the system, as they’re easy to install.


I have managed to finish first draft of the add-on board schematic. This enabled the final go-ahead for the prize order, which I received today. I also managed to test (almost) all the functionalities described in this post today, so everything should be ok for ordering the PCB. I have designed the PCB already, but haven’t had time to double check it yet.


I’ll be going through the design piece by piece, explaining why I did it like I did. There’s also couple of renderings of the PCB and pictures from the test setup at the end...

Power supply

As I found out in my review of the Tektronix TBS1052B-EDU oscilloscope, cheap, Chinese DC-DC converters are enough to supply power to the new design of the Pi. As I need a higher power supply for relays etc, this suits powering the 5V for Pi and some other components very nicely. I did look into the possibility of implementing the same circuit myself, but noticed quite soon that it’s more expensive and would take the same space on the PCB anyways.


As the house isn’t occupied during weeks (dad working abroad) and temperatures reaching as low as -35C, the system needs to be rock solid. This is why I’ll power the Pi through a Texas Instruments TPS2034D. This allows me to implement a microcontroller (Texas Instruments MSP430G2152) to control the power supply. My plan is to send a “heartbeat” from the Pi to the microcontroller. If the heartbeat stops for any reason, the MCU will cut the power for couple of seconds and reapply it. Also, all other external circuitry will be connected to this, so everything is reset at the same time.


Of course the microcontroller is running on 3.3V instead of 5V, so I need a step-down regulator. I chose Diodes Inc. AP1117 for this, as it’s relatively small but can still supply a lot of power, just in case I want to add more devices to the 3.3V.

EnOcean

Initially I thought about implementing the EnOcean TCM 310 module to the board, it’s the same as in EnOcean Pi. It doesn’t seem too hard to design a circuit to hold it, but at the moment I just don’t have the time for it.

Instead, I’ll be using long pin headers for connecting the board to the Pi, (hopefully) leaving long enough headers for the EnOcean Pi to connect through the add-on board.

I2C

A lot of the stuff I’ll be using relies on I2C, some of which will be running from 3.3V and some 5V. Because of this I’ll need a level-shifter to translate messages across different voltages. For this purpose I chose NXP PCA9306D. It’s specially designed with I2C in mind, so it should do nicely.

Keeping time

Internet connection for the house is an external 3G modem, so it might not be reliable, especially in case of power failure. Correct timestamps are essential when checking through the backlog, so the system also needs a real time clock with battery backup (Pi doesn’t have one image ). I chose Maxim Integrated DS1307ZN+ for this, as it has quite good reputation and connects to I2C. All the external parts it needs are a battery and a crystal, so it’s quite easy to implement as well.

1-Wire

I chose Maxim Integrated DS2482S-100+ as interface from I2C to 1-Wire. This will basically be the heart of everything, as the system relies very heavily to 1-Wire. 1-Wire will take care of relay control as well as most of the temperature measurements.


The DS2482 will be connected to 5V, although it can also function with 3.3V. This is mainly because of wire lengths etc, so the bus voltage is high enough for long distances. Also, DS2482 uses active pull-ups for the network, so it should work reliably.

Controlling relays

The most important part of the system is relays, which is used to control anything from a heating boiler to lighting. The boiler heats the whole house, so the system needs to be designed so that in case of a failure, relays are switched to a predetermined state.


Interfacing between the Pi and relays will be done via Maxim Integrated DS2408, which connects to 1-Wire. As the voltage (or current) threshold of the DS2408 isn’t that much, I added a Texas Instruments ULN2803A to take care of the high voltage side. This allows me to use anything up to 50V for relays. However, I’ll be using the same voltage for supplying the circuit, so the input is capped to 40V because of the DC-DC converter. This is more than sufficient though, as the relays I’m using are 12V. These might change to 24V in the future, so it’s good to have a design that can handle it.

Wire connections

As with any system, I’ll of course need some wired connections. For these connections I chose a spring loaded connector, Phoenix Contact PTSA 1.5/10-3,5-Z. I did think about using a traditional terminal block, but these seemed like a good alternative and allow easy attaching and detaching of the wires. I chose the 1.5mm2 version of the connector, because we have some wiring done with 1.5mm2 wires already. Nothing in the design really requires such heavy wires, but it would be too much work to replace the wiring.


There’s also header for both, 3.3v and 5v I2C, so it’s easy to extend the board as needed. I have also added some pull-ups and pull-downs to the GPIO pins I haven’t used, this way it’s easy to add devices like IR-sensors, buttons etc to the system.

Summary

The board should be able to handle everything I (at the moment) need from home automation system. We’ll be testing the range of EnOcean sensors this weekend at the house, just to be sure that the range is sufficient. If not, we need to do some minor changes to the setup at the house, but nothing too major...


So far I’ve tested basically all the systems on a breadboard, excluding the functionality of the TPS2034D. This has to be tested before I order the PCB, as the whole reset functionality relies on it. I might add few small details still, but I’m fairly sure this is the design that will make it to the PCB.


Figure 1: PCB from the top.

image


Figure 2: PCB bottom side

image


Image 1: Test “setup”, more like an unorganized mess...

IMG_20140925_193710.jpg


  • Sign in to reply
  • kipe
    kipe over 10 years ago in reply to mcb1

    Yeah, I've been hoping for this feature a long time. There hasn't been any major problems in a few years though, but the system has failed a couple of times when temperatures haven't been critical. The failures have been caused (I think) by the ethernet driver crashing.

    MCU should take care of the problem, as not only can the heartbeat detect kernel panics etc, but I can also with the correct code make the system reset if network connection (to router) hasn't been active for a while...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago

    Nice work.

    I like the separate watchdog ... it gives reasonable peace of mind.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kipe
    kipe over 10 years ago

    Also, as a minor note: My scope broke (I think the EEPROM holding calibration data, serial number etc failed) and is now off to Germany for service. This did slow down the progress today a bit, as I got used to it already image

    I ran into some problems which could have been easily found with a scope, but unfortunately this wasn't possible...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube