“Forget Me Not and Remember Me Always”
“Learn what you can do with the B+” I just can’t wait for the video!
Today EnOcean, Tomorrow the World!!
Figure: Playing Music from OpenHAB
Many thanks to all the sponsors who have put faith in me to participate in this RoadTest Design Challenge.
Raspberry Pi, OpenHAB, CadSoft EAGLE ,Tektronix, iot eclipse.org , EnOcean and Element 14!
Unlike the John Lennon’s saying that life is what happens to you while you’re making other plans, the challenge was both the journey and results. I had a challenging journey and obtained great results. The journey taken was far different to the one planned because of the current Radio Spectrum regulatory restrictions in Australia that prohibit use of the EnOcean wireless energy harvesting sensors’ base frequencies.
There were actually several concurrent journeys. One was discovering the world of OpenHAB, another was an in depth exploration of the Raspberry Pi and its features. These culminated in the creation and assembly of OpenHAB 1.0 system and supporting peripherals on Model B+ Raspberry Pis. Other journeys included a foray into CADSoft EAGLE’s new features and improvements to determine their advantages , road testing a Tektronix TBS1052B-EDU Educational Oscilloscope and finding the improvements from previous generation equipment and research into EnOcean’s Energy Harvesting wireless sensors.
openHAB & Eclipse SmartHome
Figure : My OpenHAB Controllers (Wireless and fancy free!)
I had never heard of let alone used OpenHAB prior to this Road Test Design Challenge. I was initially confused as to the difference between Eclipse SmartHome and OpenHAB as these terms were used interchangeably. I searched the net and found this link that fully explains it. http://kaikreuzer.blogspot.com.au/2014/06/openhab-20-and-eclipse-smarthome.html
After installing, using and coming to grips with OpenHAB 1.0 – I found it to be remarkably easy to use and configure. All one needs to know is how to configure the main elements to produce a system to suit one’s needs.
The main elements are;
Configuration File
Start Up script – The script used to launch OpenHAB
Bindings – The interface drivers between peripherals and the OpenHAB
Rules – Instructions for the OpenHAB
Sitemaps – User Interface Presentation Definitions
The main configuration file is to supply configuration information to OpenHAB. Amongst other things, it is used to pass on information such as IP addresses of devices to OpenHAB for communications.
The Start Up Script, Rules and Site maps are text based configuration files that are very easy to adjust. There are other elements present such scripts to provide additional functionality but they do not necessarily need to be used.
It is also not mandatory to use the additional GUI configuration tools. I found that I had no immediate need for them and successfully configured OpenHAB using just a text editor (nano). For less technical users these GUI tools do present a less daunting task.
The Start Up script is configurable to allow the easy interface of any system prerequisites. This may be the need to activate a peripheral’s service or library to make it available for an OpenHAB binding to operate.
Bindings are just copied across into the OpenHAB binding directory as needed. There is a large library of bindings available to facilitate easy integration with many existing Home Automation peripherals. There are even bindings for the EnOcean wireless sensor system to make them easy use. Depending upon the peripherals used you may need to install one or several bindings. Bindings are classified into action, binding, io and persistence to clearly articulate their purpose.
One great feature of OpenHAB is that there’s no need to design web pages to access your OpenHAB system. There’s an OpenHAB app available for both IOS and android devices to give you access to your OpenHAB system. Alternatively a Web browser can be used. These GUIs are defined by the Sitemap configuration files. These are easy to configure text files representing the organisation and displayable items for the GUI. This user interface is consistent across all device options.
Rule configuration files make it easy to define the behaviour of OpenHAB based upon encountered events. These event s can be based upon peripheral reaction and timing events. For instance, you can easily make a doorbell switch event trigger a picture from a camera and sending it off as an email or to display it on the OpenHAB UI or you can make a turn on and off lights according to a time schedule.
RASPBERRY PI Model B+
Figure: Model B+ and Pi Camera configured as a Network camera
The Raspberry Pi – what can I say that has not been said already? I think quite a bit. Thanks to Broadcom they’ve put together a highly integrated SoC using a POP (package on package) ARM processor coupled directly to ample RAM with a peripheral controller IC that provides a complete computing ecosystem with USB peripheral support HDMI and Ethernet Interface at an inexpensive price.
The Model B+ is an incremental update to the Model B Version 1 and 2 versions and its new features further extend functionality and convenience. The SD Card socket has been replaced with a MiniSD socket and RCA analogue video output connector has made omitted to make way for some additional improvements. The audio section has been improved, 2 additional USB ports have been added, 4 mounting holes have been provided to mechanically support HATs and provide a method to easily attach the PCB to a case and automatic self configuring HAT support has been introduced. In summary, a very convenient and useful upgrade.
Getting the Pi Cameras working is an extremely simple process. It was just a case of connecting the cameras and enabling the Pi Camera option in Raspi-config during the Raspian Wheezy installation. This provided me with the raspistill utility which provided all of the functionality required.
Installing additional software is so simple using apt-get. This program scans the net to obtain the desired packages. Apt-get also provides a simple way to update and upgrade packages. Where possible I limited my choice of software packages to the standard Raspberry Pi Set. This is to see what was possible with the Raspberry Pi in its most basic form.
Getting the GPIO, UART, SPI and I2C buses for application and user use is easy. It is just a matter of informing the operating system (Raspian Linux) via configuration files of their use and may be the installation of some additional apt-get support packages.
TEKTRONIX SCOPE
Figure: The mighty TBS1052B-EDU's display showing off it's fantastic quality!
Tektronix TBS1052B-EDU Oscilloscope – This is a truly great piece of entry level kit. It is remarkable how Tektronix have improved their test equipment and yet retain the same price point. This instrument boasts a high resolution rich colour display and makes waveforms appear very clearly. Unlike some other Oscilloscopes is operation is silent as I could not hear any annoying fan noise.
Its controls are very easy to use and the incorporation of a push button into the Multipurpose dial makes it even easier to use. You can now select the desired item by highlighting the option you want with the dial and pressing the dial down to select it. The front panel has convenient colour coding to associate the front panel controls with their associated channel.
The USB interfaces make it very easy to transfer screenshots and captured data to a PC workstation or printer and to upgrade its firmware. With the supporting PC software installed a screen capture is a simple as a click of a button.
The Maths functions are ever so handy. With them you can see the accuracy of sine waves with the FFT display function or with the Add functions check the net result of a differential signal for unwanted artefacts.
CADSOFT EAGLE
Figure: Hierarchical Schematic demonstration in action!
CADSoft EAGLE is a great Schematic Capture and PCB Layout program. It is highly configurable and in addition to just producing Schematic Diagrams and PCBs it also can be used to create accompanying SMD stencils. With Version 7 it now has hierarchical schematic diagrams. This feature is used to clearly articulate complex designs with sub assembly or multiple sub circuits. I produced a video to demonstrate this feature. The hierarchical schematic function requires a suitable EAGLE license. One that allows the use of multiple schematic sheets such as the Free Trial (Freemium), Hobbyist, Standard and the Pro license supplied for this challenge.
EnOcean Sensors
These are well engineered products that I really wanted to Road Test but to my disappointment I was unable to use them due to Australia’s regulations. The EnOcean Pi interfaces with a Raspberry Pi using its /dev/ttyAMA0 serial port. It also has bindings available for OpenHAB. I just can’t wait to use it when the regulations allow it (which will ll be some time after the challenge end date). In the interim I tried an alternative wireless product to find that its transmission scheme unreliable. Yes it did work but it required a substantial overhead to cater for its limitations negating any power savings required for Energy Harvesting use.
These sensors will be will be hooked up and tested the moment when the regulations allow them to do so! I just can wait to make a limitless range extensible EnOcean Sensor network!
MY SYSTEM
I have set up an impressive OpenHAB system that is ever evolving. It’s fully operational where I have many IoT devices that are accessible from Wireless Android and iPAD tablets. I can turn devices on and off, monitor sensors and display images captured from Network Attached cameras. It even sends alert emails (some with images) as necessary.
This system first started off as a standard run of the mill OpenHAB demonstration system. From this I developed my own system by creating my own custom sitemap to have my own GUI control panel.
To this I interfaced my SqueezeBox Media Player system. This consisted of downloading and copying the Squeezebox bindings into the addons directory, configuring squeezebox binding parameters in the configuration file and adding items to my own sitemap. I can now turn my squeezeboxes on and off, adjust its volume, mute and select the music track played.
I interfaced a COMPRO IP-750 PTZ network camera. It can be controlled using an HTTP interface so the http bindings were copied into the addons directory, added camera control and display items to my own sitemap. I can now pan, tilt zoom and perform snapshots on the camera from my OpenHAB control panel.
Figure: Compro PTZ Network Camera
I interfaced one of the OpenHAB Controller’s GPIO pins as a LED driver. This could be easily extended to drive an external light or device.
I interfaced one of the OpenHAB Controller’s GPIO pins as an input switch to act as a Doorbell switch. This could also be used as an alarm, panic, tamper or other purpose button.
I created my own remote network camera using another Model B+ Raspberry Pi and have it connected as a part of my OpenHAB system. I configured this network camera to operate in a similar fashion to the COMPRO Network Camera making it an HTTP controlled camera. Since the http bindings are already installed for the COMPRO Network Camera all that was required was to add this camera’s items and images to my sitemap file.
This particular camera deliberately does not have PTZ controls for security reasons because it is designed to specifically monitor the Cat Food bowl (and nothing else). PTZ and motion control detection and alerting can also be added as required.
Making a Raspberry Pi and Pi Camera into a network camera is a simple affair. All one has to do is to install Raspian, enable the Pi Camera, install the lighttps package, configure the lighttps application to support cgi-scripting, write the cgi-scripts take snapshot images upon demand, export the snapshot images and configuring the system security to ensure that the system works correctly.
This approach of using Raspberry Pis as remote network nodes greatly expands functionality and reach of OpenHAB systems. The Remote Nodes become responsible for administering and controlling its assigned set of resources and reporting back to the centralised OpenHAB controller.
You can create a large number of these remote network nodes to perform specific functions such as extending the range and increase the number of EnOcean Sensors by having the remote nodes manage their own set of EnOncean sensors and communicating back to the OpenHAB controller using the wired or wireless TCP/IP network.
This Remote Node approach is great for additional actuators and sensors. One feasible solution is to use a Raspberry Pi Model B+ with my Compact TOP HAT.
Time’s beaten me for the completion of my X10 gateway using the abovementioned approach but will have missed out on the deadline for this challenge. This gateway comprises of a Raspberry Pi with CM12 X10 computer interface that reports to openHAB using HTTP. This gateway will seamless allow OpenHAB to control the large variety of existing X10 equipment.
Figure: Compact TOP HAT prototype
My Compact TOP HAT is my method of simplifying connectivity to Raspberry Pi Model B+s. I made a prototype PCB to conform the Model B+ HAT specifications and dimensions complete with an HAT ID EEPROM and camera cable slot and LCD cable notch. The TOP HAT conveniently exports the Raspberry PI’s I2C, SPI an UART pins as separate connector ports. The SPI signals are exported through two PMOD module compatible ports allowing easy connection to existing PMOD devices. The ports also make it a very simple exercise to connect a PSoC to the Raspberry Pi for bespoke I/O interfaces.
The prototype TOP HAT has an onboard MCP23017 I/O extender and DS1317 Thermometer that are made available to the Raspberry Pi’s I2C bus. Other devices were connected to the TOP HAT I2C bus port to expand the Raspberry Pi’s flexibility. It included a 1-Wire Interface using a DS2482S-100+ and a HTU21D Humidity/Temperature Sensor. A larger DS2482S-800+ could be used to provide 8 independent 1-wire busses.
I’m working on a capacitive soil moisture device based upon a PSoC and its CapSense Technology. This is a little complex but has the advantage that the sensors are not in direct contact with the soil so there’s no problem with probe contamination or corronsion.
The system is so flexible and extensible.
The attachment of a SPI, I2C or PSoC thermocouple interface gives this system a large and relatively accurate temperature range.
The use of current sensor via a SPI, I2C or PSoC ADC can be used to monitor AC and DC energy usage.
The use of a light sensor can be used for applications not requiring a camera.
The use of solenoid or similar drivers can be used to turn devices on and off.
Figure: Prototype HTU21D Humidity Sensor, 1-Wire Interface and PSoC 4200
The list is only limited to your imagination and yet is so easy to connect and automate. All you have to do is get an idea of how to measure and control your contraption is to buy your parts from Element 14, hook them up to a Raspberry Pi Model B+ with Compact TOP HAT, electrically test your design with your Tektronix TBS1052-EDU Scope, schematic capture your design and produce PCBs with CadSoft EAGLE and then add them to your OpenHAB system with a bit of simple configuration.
Then you can sit back and relax and control everything from your Wireless Android or iOS device whether it be a Smartphone or Tablet!
Just remember the most important thing. SAFETY FIRST!