Modification to extend wireless range

Consumer Electronics Design not always beneficial if it retards the primary functions of a device. The internal antennas are such a design concept that cause a lot of headaches for tech guys like me. The primary function of a antenna is to transmit a signal, capture a signal or both. Since most modern equipments are manufactured with plastic casings (as opposed to metal), a lot of manufactures have opted for internal antennas. The advantage; now nothing is sticking out, they can make the equipment more desirable to mainstream consumers by making “beautiful” equipments boxes. I am on the other hand one of those people who would buy a device for its’ practical functionality over looks.

The following modification was made on my VeraLite (Vera3 variant) to remove dead-zones in my Z-wave network. However, using the same principles and steps, you can also extend the range of your WiFi network. I will add bits of information specific to WiFi extension on this article.

Vera3 and VeraLite controllers

The door locks on Z-wave networks almost always accept only secure authenticated signals. In order to operate the locks you must send the signal either directly from your Z-wave controller (in this case VeraLite) to the locks or use repeaters (or modules with secure repeaters) that are capable of secure signal handling. I found it is extremely hard to find such repeaters in Canada.

So I went with the second option; direct communication between the locks and the controller. However, my controller is in a locked cabinet far away from the locks. This causes reliability issues because unlike Z-wave light switches, door locks cannot take unsecured signals repeated from nearby low security switches.

Modification to the controller

Warning: This modification will void your manufactures’ warranty. Beware of the static charges. Static electricity could burn out your circuit board. Either use a grounded anti-static wrist strap or use extreme caution. Remove all power supply units (batteries & DC power unit) before opening the case.

Parts, tools and technical information

  • Antenna must be able to handle frequency range of the device (for this mod, 908 MHz)
  • U.fl/IPEX to RP-SMA Pigtail with at least 5 cm; 10 cm is too much; find happy medium) of wire length between the connection points
  • GSM antenna extension cable (optional and longer the cable, more problems arises)
  • Small needle nose pliers
  • Small Phillips screwdriver and a large slotted screwdriver or a flat plastic or mental piece
  • Small electric drill or a utility knife

It is very easy to take apart VeraLite unit. Only two screws and few plastic clips that holds the plastic casing. One of my readers (“Jack”) pointed out that the screws will not come out from the casing. In that case do not try to pull it out. Once the screws are lose, you do not have to take them out of the holes in order to separate the green cover from the case. Use a flat head screw driver or a flat object to pull the cover apart. Be careful to not to break the clips that holding the two parts.

Inside you will find the internal antenna attached to side of the box with a connection wire going to the Printed Circuit Board (PCB). Click on the the image below for more detailed information.

VeraLite PCB: A = Internal antenna, B = Cutout made for ext. antenna. C = Antenna connector
Figure 1: VeraLite PCB: A = Internal antenna, B = Cutout made for ext. antenna. C = Antenna connector

Disconnect the internal antenna wire from point C (refer to above image) by gently twisting and pulling on the connector. Do not pull from the wire because it will break the wire from the connector. I recommend using a small needle nose pliers.

Make a hole through the casing, either on the back or on the side. Make sure it is large enough to pass the SMA (SubMiniature version A) male connector but not its’ neck. I used a box cutter to be safe, but you can also use an electric drill. If you are using a large construction grade drill, please be careful to not to break the box. I found the utility knife to be the best option.

Creating a circular cutout to pass the male SMA end
Figure 2: Creating a circular cutout to pass the male SMA end

Take the U.fl/IPEX to RP-SMA Pigtail (Figure 3) and connect the U.fl side to the board. Then pass the SMA side from inside to outside. Then connect the other end to the point C (Figure 1) on the board.

U.fl/IPEX to RP-SMA Pigtail
Figure 3: U.fl/IPEX to RP-SMA Pigtail

Internal and external view of the final product.
Figure 4: Internal and external view of the final product.

Put the box back together and your done! For the external antenna now you have the option of adding it directly to the device shown in Figure 3 or you can add a antenna cable before adding the antenna itself. This is what most people do when they want to secure their devices in a cabinet. You can keep the network controller inside while antenna outside for greater coverage.

It is quite possible to salvage antenna and U.fl/IPEX to RP-SMA Pigtail connection wire from old devices such as wireless routers and GSM devices. But unfortunately most WiFi routers are on 2.4 GHz band while Z-wave is in 900 MHz band. For example, this particular model is at 908 MHz frequency. If you cannot find a GSM device to get an antenna, please buy one (~ $8 – $12 CAD) to take the full advantage out of this modification. Connection wire from a WiFi router is suitable for Z-wave broadcast.

Antenna length difference due to wavelength difference between 2.4 GHz vs 900 MHz
Antenna length difference due to wavelength difference between 2.4 GHz vs 900 MHz

If you would like to know more about how antennas work, try this site.

Modify WiFi Routers

Yes, you can modify your b/g/n/ac WiFi routers with built-in antenna(s) by following the same instructions. The only difference is now you can use any old 2.4 GHz or 5 GHz (not very popular) antennas for your project.

Modules associations

There are few different companies that manufacture modules for home automation. Even with products from same company, it can be difficult to find all in one solutions to consumers’ need. Through manipulating the behaviors of the modules through the controller, we can accomplish almost anything.

Let’s look at a situation where solution is not obvious. In my home, I have a separated garage with a conventional door opener and lights. To automate the door, I added a Z-wave inline module. It works great, but it often interferes with the built-in light of the opener. So I removed the light fixture from it. Now every time I come home the garage is dark because the other set of lights requires me to turn on separately. Solution is to combine two modules; the door open/close sensor and the light switch module.

I wrote down what I would like to have and what equipment I have to solve the problem. What I wrote is; Sensor is Armed –> Sensor is Connected/Disconnected –> Turn ON lights –> Wait 10 min –> Turn OFF lights. Then, being a good computer scientist I created a flow chart.

Flowchart: Garage Door Sensor associating with Light Switch
Flowchart: Garage Door Sensor associating with Light Switch
Now, I installed the Z-wave 2-way switch module by replacing the old switches. Then I used the association in Vera controller to make a relationship between the sensor and the light switch.

Here is an example video of an association (not the same one describe above).

You can resolve problems similar to this using associations in many other situations. Here are few example of typical problems that can be fixed using association method.

  • Turn on lights (switch module) when the motion senator (sensor module) is tripped if the time period is night.
  • Turn off the TV (plug-in module) if the motion sensor (sensor module) have not been tripped for over X hours in the entertainment room.
  • Turn on the sprinklers (plug-in module OR sprinkler controller module) if the light sensor (sensor module) detects low lights and it is at night.
  • If the light level (luminance sensor) is below 90 lux then turn on lights.
  • If the humidity level (humidity sensor) is below 40% turn on the humidifier and send an email.
  • If you install a multisensor, Boolean logic possibilities can be significantly increased.
  • …and many many more!

The key to a successful association type automation is proper planing and right equipment.

Improvised home automation

The ideal solutions for home automation devices are usually plug-and-play units or modules. They often require just powering the unit and adding to your main controller. I came across unique situation in which a Z-wave, x10 or Insteon modules does not exists, but a solution can be made by combining automation modules with types of electronic/electric units. It is technically an improvising what you can get on the market. However, it does not necessarily means the final outcome of these projects are lower in quality compared to plug-and-play solutions.

Electric shock alertPlease note that some modifications may result in voiding the manufactures’ warranty. Some project involves working with ~ 110/240 volts alternating current (AC). Even with the power cut offed, there is always a risk of electric shock.

Garage Door

Currently there are no manufactures or distributors in Canada that sells openers with automation as a built-in function. I have used a inline relay module between the traditional opener switch and power. If you are unfamiliar with what is an inline relay, check these items: Fortrezz MIMOLite Zwave Input Output Module and Evolve ZWave Inline Relay Module-LFM-20.

These relays acts as a human input to any device that has a ON/OFF type switch(es). Some of these may not work for devices that require continuous ON such as an electric heater. Make sure you read the manufacture’s datasheets before purchasing.

Door Opener

Yes, you can buy a automated door locks from companies like Kwikset, Schlage and Yale. But it will only allow you to either lock or unlock your door. What if you want to open the door remotely? To do that you need a motorized door opener. You can buy a door opener unit for either swing door or slide door type. They comes with an electric motor, mounting equipment, a switch and a remote. What lacks is any form of automation controlling unit (Z-wave, x10 or Insteon).

When you are purchasing a electric door opener, make sure it also has a push-button connection. You will replace this push-button with your inline module.

Again, we can use an inline module like MIMOLITE between the motorized door openers such as Skylink Otodor Automatic Swing Door Opener and its power supply. Then by adding the the module to network, you can open and close the doors with your computer or phone.

Security Cameras

There are several companies that produce high quality cheap security cameras. For indoor use, almost all of the reputed companies make great products that are simply plug-and-play modules. I also like the fact they are often independent standalone units. In other wards they can operate without a central controllers like Z-wave controllers.

In Canada, we run into one big problem; weather. Most wireless outdoor cameras are built to work between -20 to +40 degrees Celsius. In most parts of Canada (such as Calgary) we get temperatures as low as -40 oC during Winter months. You could buy a extreme weather cameras with a heated casing. But it will not only cost a lot for the unit, but also the subsequent costs for heating will add up over the years. Hence we must improvised with these cheap IP-Cameras if we want to use them outside.

Solution 1: Use indoor units

You can install a high grade indoor camera such as D-Link DCS-5222L close to a wide outside window (inside the house). Now by pointing the camera towards the outside, you can still surveils the outside without having a weather proof unit. The major drawdown is that the Infrared (IR) LEDs will bounce off the window at night causing distorted image. This can be overcome by turning off the IR mode and illuminating the outside area with a flood light.

Solution 2: Install on the other side

If you want to protect areas like your garage, you can install the camera inside instead of outside. In most situations this will provide adequate protection from weather. The darwdown is that if you have an enclosed area, you will not be able to see the outside. However, if someone breaks into the garage, that can be recorded.

Solution 3: Creating your own weather casing

This is really a improvised do-it-yourself project. You can create a metal or wooden box and add a HVAC pipe into the box from your house. So whenever the house is heated, the camera enclosure will also be heated. Please make sure that you are doing this according to the laws of your area. Some cities and countries would not allow you to use such methods due to safety reasons.

Last option is not really an improvise. You can just buy a Canadian outdoor weather reared camera. In December 2013, it will cost you around $300 to $2000 depend on the manufacture and the model.

When installing a wired outdoor camera (or anything else), make sure to use outdoor rated cables.

Plumbing

I would not buy a fully integrated taps or water controllers. This is because electric taps are often well-built. However, the electronics go into the automation can be unreliable. You do not want a leak after few years of use or unwanted turn on/offs. The solution is to buy an electric taps/water controllers with a push-button switch. Hence, the automation part will be added using a inline module that is independent of the water controller itself. Easy to install and easy to do maintenance work.

Electrical

I would not recommended improvising for anything to do with electrical. It not only pose a hazard to your health, but also could lead to criminal charges. But there are something you can do in your own home. Even the garage door and light switches automation involves electrical modifications.

Missing Common Wire

If you have a situation in which a Common Wire (“white wire) is not available in your house or the area in question, you have two options. One is to run a Common Wire from your main board to the location, and the second is to use a plug-in module. If you are not familiar with electrical work, I recommend the second option. You can connect lamps, electrical appliances, consumer electronics and many more to a plug-in module. Make sure you use the right module with proper rating. The module will plug-into the wall outlet and provide outlet with automation. The Evolve ZWave Plug-In modules are examples of such units.

LED dimmer causes flickering

This is a very common problem with LED dimmers and not the Z-wave module itself. Sometimes when the resistance, R on the circuit is extremely low and the current, I flow is also reduced through the dimmer, it will cause the LED lights to flicker. This happens when the dimmer at its lower illumination setting.

To resolve this we need to increase the resistance in the circuit. The best solution is to install at least five to eight LED light bulbs in a single circuit. You can try by adding one at a time until you no longer have this problem. If that is not viable solution, install a mixture of both LED and regular bulbs on the same circuit. However, I found by mixing manufactures of LED bulbs I was able to stop the flickering with just three LEDs.

Outdoor electrical modules

When working on an outdoor automation project, use outdoor approved electrical products. For example, GE ZWave Outdoor On/Off Module-45604 should be used when you are installing a sprinkler system. Do not try to save money by buying an indoor module to control an outdoor electrical products. There is a reason why outdoor units can be bit more expensive!

Please be aware that you may not be able to automate anything and everything. Use common sense and if you are not sure of something, do your research and/or ask an expert. Most manufactures and distributors also provide free support. Use them as a resource.

Advantages of Improvising

There are several advantages. I decided to list them so you can quickly glance through each one.

  • In-line modules can be from any manufactures and can be on any standard (Z-wave, x10, etc)
  • Most of the time, it is easy to install with improvised solutions (describe in the article)
  • If a unit/module fail, it is easy to replace as opposed to replacing an expensive and complicated unit
  • Parts can be easier to find (for example, an electric tap from Canadian Tire and a controller module from a Z-wave specialty store)
  • May be more reliable than having a single plug-and-play
  • Can be install on almost any house regardless of the age of the house or the electrical wiring/plumbing/door system
  • Provide much more expansion possibilities

Random Item from CMS Database

There are few ways to do this in WordPress CMS using the PHP web language. What I would say the “best way” involves editing either original or Child Theme functions.php file. Therefore it is bit risky and you could potentially take your side down in an event of an incorrect implementation. Let’s look at the fool safe “easy way” first.

By creating a page template

The advantage of this method is that we are not editing your original or Child PHP theme files. Instead, a separate PHP file is created (either directly on the server or outside then uploaded using FTP) as a template file. This may also potentially create coding conflicts but usually can be resolved by simply removing the newely created file from the server. This new template must be located in the templates folder of your WordPress theme files. Hence the location should be the same as the page.php file location. Usually it is in “themes” folder.

First, create a PHP file with a desired name. Let’s call this file “template-random.php” in this particular example.

<?php
/* Template Name: Random Item */
query_posts(array('orderby' => 'rand', 'showposts' => 1));
 if (have_posts()) :
   while (have_posts()) : the_post(); ?>
     <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
     <?php the_content(); ?>
   <?php endwhile;
 endif; ?>

After creating the template go to the Admin Panel of your WordPress and create a new page (let’s call it “random”). Choose the template we just uploaded as the template of the page. The template we just created should appear on the list of selectable templates under “Attributes” pane as “Random Item”. A random page/post will be generated every time this new random page is generated. For example, sanuja.com/blog/random will give you a random item from the database. Now you can use “a href” type links or buttons to direct users to random pages.

By updating the functions.php

Update the functions file in your main theme files or Child Theme files with the following code.

function le_random_post() {
if ( isset( $_GET['random'] ) && $_GET['random'] == 1 ) {
   $posts = get_posts( 'post_type=post&orderby=rand&numberposts=1' );
      foreach( $posts as $post ) {
      $link = get_permalink( $post );
      }
      wp_redirect( $link,307 );
   exit;
       }
}
add_action( 'template_redirect','le_random_post' );

Now you are done! Just use the appropriate URL to generate items from this script. For example, this will generate a random item as soon as the URL, http://sanuja.com/blog/?random=1 is requested.

Mobile tools for Webmasters

There are many different types of Webmasters (and Owners / Developers / Administrators / etc). One thing most of us love is to save money by opting for free services whenever it is possible. You do not always have to pay for high quality services. For example, Google Inc. is one of my favorite high quality free service providers. However, keep in mind that often these services are provided “as it is” without a warranty and for personal website Webmasters and small business owners.

Mobile Computing

This is not so much of a new tread but rather a continuation of the teach bubble. Many personal website owners and increase number of small business owners maintain their sites on the go. This is where smartphones and tablets can be very useful. But, I found keeping things up to date on a website can be a difficult thing to do. Looking out for those unwanted DOS attacks and server downtime can be time consuming. But it doesn’t have to be like that because there are tools to keep an eye on your site 24h/7d/year on your mobile device.

Introducing Pingdom

Pingdom is one of the most popular site among Webmasters. They offer wide range of technical tools for monitoring and managing your website. This includes the world famous, the Pingdom Speed Test. While there are two tears for their services (free as well as Pro paid version), for a novice Webmaster with a personal website, their free services are more than adequate. For example, if you want to keep an eye on your HTTP side of your server, you can create a free account and automate that process. This free account also comes with the access to a very well written Android and Apple apps.

The Pingdom mobile app provide critical server information such as outages, uptime and response time. Again, yes for FREE! I use it to keep track on this website. I would specially recommend anyone who is paying for their web hosting to use this wonderful free service. Because if you found that your site is not up 99.9% like some hosting companies claim, you can ask for your money back.

Android Mobile Pingdom App
Android Mobile Pingdom App

I should also thanks the Pingdom for coming up improved mobile support. Even while I am typing this article they released a new version of their app improving overall quality of presentation.

Google Google Analytics

I use a lot of Google free services. They include great services such as search engine, Google.com/cTLD, Custom Site Search, Google Adsense and other free Webmaster services offered by the company. While I do not have a favorite Google service, I can say Google Analytics is the best tool for monitoring web traffic.

Android Google Analytics App
Android Google Analytics App

Once you set up a site with with the Analytics tracking code, this mobile application will provide live traffic at your finger tips. Additionally, when used with Google Adsense, you can combine the visitor behaviors with your ad revenues or vice versa. This is a great tool for Webmasters with multiple sites too. You can combine data from several sites into a single app.

Android Terminal Emulator

As the title suggests, this is specifically for people with Android devices. But, this will also work on a Windows phone, tablet or a PC. The term “Terminal” is known as “Command Prompt” in Windows or simply “Terminal” in Linux/Unix.

So how can this be useful? Instead of using an application like Pingdom, you can use the Terminal Emulator to ping your site. Unless you write a script, you can have to manually ping your site(s) each time, one at a time. Therefore, this is a time consuming process for Webmasters with slow older devices. If you find that your phone “hangs” or crashes upon loading the Pingdom app, this is a good solution (although no means it is a prefect solution).

There are many other tools available in the market. I only introduced few of the most basic and generally bugs free items. I would not recommend using paid mobile tools unless you are running a large company. For most average Webmasters, these free applications can be as useful as Calculus to a an Engineer.