Lazy Gardner Project – An Intro

I’ve been wanting to get back into the Arduino scene for some time. But, until now, it’s always been a battle between lack of time or just pure laziness.

I decided enough was enough and decided on a project that would be both fun and useful – introducing the Lazy Gardener!

You’ve probably seen many of these projects on the net. An arduino powered plant irrigation system. I decided to build my own but without any help from other guides.

I’ve been procuring lots of stuff from my new favorite site But I also had a bunch of existing stuff laying around, such as my Arduino Pro Mini’s (5v).

The first utility tool I have built is a simple soil moisture level tester. To build it, I used:

  1. 1x Arduino Pro Mini 5v
  2. 1x SSD1306 0.96″ OLED Display (I used the 6-pin, careful as there are many different types with different numbers of pins)
  3. 1x YL-69 Soil Moisture sensor (this link is to a pack of 20 but you can easily find single lots)
  4. Various cables, headers, jumpers and a 4 AA batter module (since we need at least 5v)

I’ll draw out a schematic soon but here are some pictures. It isn’t pretty but it’s functional. I’ve been reading the soil moisture sensor has accuracy issues, but at this time I’m ok with that since I don’t need a 100% accurate reading, I just need ballparks since I’ll use this reading to determine whether or not to pump water into the plant periodically.

The sensor in action. You can see my soil is quite hydrated. I’m growing baby tomatoes here.
The Code

Grilled Beef Tenderloin on the Grill

Several neighbors and we decided to hold a bbq this weekend. I opted to provide the beef tenderloin (among other things) as I wanted to try cooking it on the grill.

I got inspiration from this post:

But, there were a fee things I did differently.

  1. I couldn’t find kitchen string in time. So I didn’t wrap the narrow end and tie. Instead, I used aluminum foil to keep it tightly together. I didn’t fold the end either.
  2. The grill we used isn’t a typical gas or coal grill with a lid. It’s an open coal grill. So I used aluminum foil and tightly wrapped the entire loin to keep the juices and steam sealed in
  3. I forgot to apply a layer of vegetable oil. Oops.
  4. I didn’t trim the silver skin or side muscle. I opted to leave it on. I was too lazy to cut the silver skin but in my experience, the tenderloin’s silver skin isn’t as tough as a strip loin’s silver skin.
A few hours prior to the grilling, I took it out of the fridge, seasoned it with salt and pepper. I wrapped in plastic wrap and left in room temperature until time for grilling.

I started with the sear I did roughly 4 sides at approximately a minute each. The heat was very high so I didn’t want to do any longer.

 (you can see I didn’t trim the silver skin off)

It was interesting to see the meat shrivel up a bit.
After the searing, I placed it in the tin foil, and left it off to the side. It took considerably longer to get the internal temperature of the thick portion to about 150 F or 66 C (the temperature I decided to target as I didn’t want it to be too rare inside)
After roughly 50 minutes, it hit the target temperature and I removed the loin from the heat but left it wrapped in the foil for approximately 10 minutes.
During this time, sure enough, the internal temperature continued to slowly rise, an important point to note.

Beautiful color, lots of juice. So far, so good.

During slicing, lots of juice continued to ooze out. But you can see the meat was still very moist. And a pretty good internal color.

The end result cut. Excellent color. The only thing is I would probably remove from the heat slightly earlier (5 minutes?) and let it rest a bit longer. I don’t think it needed the oil as recommended by the post I shared earlier, but I think this is because i used foil during the cooking process to keep the moisture in.

Automatically lock Yale Z-Wave Lock with Vera and Fibaro Door Sensor

I got another toy today – the Fibaro Door and Window Sensor FGK-107.

The primary reason why I got it was I wanted to be able to automatically lock my door when it is closed. The Yale lock I got 2 weeks ago is Z-Wave enabled, which means I can connect it (wirelessly) to my Vera Lite home automation controller. One of the shortcomings of this lock is it won’t automatically lock when (and only when) the door is closed (like other fancy digital locks on the market these days). But no matter, the fact that it is Z-Wave enabled is it’s strength.

I purchased the Fibaro Z-Wave Door and Window sensor (FGK-107) today for the primary purpose of being able to tell when the door is closed (or not). The idea is, program a trigger so when the door is closed, send a signal to the lock to lock itself.

Connecting the sensor to the Vera was pretty straight forward, although the process is a bit different than what the instructions say. Take a look at this URL:

Once it’s all configured, it looks something like this in Vera:

Now, on to creating the trigger. From the Automation screen,
Click on New Scene, then the Triggers sub tab. From there click “Add Trigger” and start configuring it. See my settings below:

A few important steps:

  1. Select the sensor device we just created
  2. Select “A sensor is tripped” for the type of event
  3. Select “not tripped” whcih is when the door is closed. When the door opens, the sensor IS tripped. So keep that in mind.
That’s it. Save your settings, reload, and give it a go. Here it is in action:

Simple LIFX HTTP API Status Checker for Imperihome

I wanted to add a widget to my Imperihome set-up telling me if my LIFX API was still running. If you check my earlier post, you’ll see that I am running the unofficial Ruby LIFX HTTP API from

I decided to write something simple in php and run it also on the Raspberry pi. But first, I need an http server. I decided to go for lighttpd (following directions from this page:

Quick Steps:

  1. sudo apt-get install lighttpd
  2. sudo apt-get install php5-common php5-cgi php5
  3. sudo lighty-enable-mod fastcgi-php
  4. sudo service lighttpd force-reload
  5. sudo chown www-data:www-data /var/www
  6. sudo chmod 775 /var/www
  7. sudo usermod -a -G www-data pi

Write a bit of code and place it in /var/www:

And there we are!

Connecting LIFX Bulbs with Vera (Z-Wave)

A quick guide on how I got my bulbs (sort of!) connected to my Vera network. No real trickery here. And the bulbs themselves aren’t yet added, instead, I focused on creating common scenes and made scenes in Vera.

What’s needed:

  1. A Raspberry Pi (or other *nix computer that you’re happy with keeping on all the time)
  2. Ensure it has a static IP on your local network – otherwise if the IP keeps changing, this won’t work too well. For mine, the IP is
  3. Ruby v2.0 (Raspbian has an older version, so I had to follow these instructions to get 2.0 installed: ( (this took forever to finsih!!)
    1. sudo aptitude update
    2. sudo aptitude install git-core
    3. curl -L | bash -s stable –ruby
    4. pi@raspberrypi ~ $ source /home/pi/.rvm/scripts/rvm
  4. Make sure root can see the new file by changing the /bin/ruby binary to point to the new ruby that is placed somewhere obscure in your own folder. For me, it: /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby
    1. sudo ln -s ruby /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby
  5. The (unofficial) Ruby HTTP API for controlling LIFX bulbs: (and follow those instructions on getting it installed), but the long and the short of it is:
    1. rvmsudo gem install lifx-http
    2. Note here i’m using rvmsudo – this was key to ensure that the gems are installed systemwide, and that root, during the installation, gets my new ruby 2.1.x environment (otherwise you’ll get complaints that LIFX requires >= Ruby 2.0.
I wrote a simple php script to help generate the Lua code (the language Vera uses) that you can paste into the Scene configuration.
Running my script, you will get a result that looks similar to this:
In Vera, go ahead and create a scene and click on the Luup tab:

Paste the Lua code that is generated from the script above, save, reload, and now you should have a working scene that controls LIFX bulb(s)!!

Curtains and Blinds with Vera Lite and Fibaro Shutter Relay

About two months ago, I started looking into home automation solutions as the condo my wife and I bought way back in February of 2011 was going to finally complete soon – and since it would be ours (and not rented from someone else), I figured I could finally do some fun projects to make it “ours”!
In comes Home Automation.
I wrote a couple of posts before here, here, and here in the lead up. What I didn’t really touch on are curtains and blinds. I joined a Singapore-based Home Automation group on Facebook and some of the other members were discussing automated curtains. 
The way my condo is set up, we have two balconies (living room and master bedroom) and two normal windows (the two small bedrooms). Since were putting curtains in for the two balcony doors, it would be a good idea to automate them somehow. For the two normal windows, my wife and I were thinking of roller blinds. I figured, why stop at automating the curtains when I could take this opportunity and automate the blinds too!
I’ll get into both solutions below, along with links to where I sourced the materials. I justified the overall expense with this simple fact: It was cheaper to source the motorized curtain rails and full roller blinds (motor and material) from China on our own than buy MANUAL curtains and roller blinds here in Singapore. Absolutely crazy, right?


From the Facebook group I mentioned earlier, members were discussing curtains. After a little digging and prodding, I learned the motors for the curtains used by one of the members were manufactured by a Ningbo, China company named “Dooya“. Their curtain solution can be read about here.
I found the specific motor I wanted to source was the Dooya DT52S – ‘S’ for “standard”. This means there are 4 wires leading to the motor instead of 3.
Green/Yellow – Ground; Blue – Neutral; Black – Direction 1; Brown – Direction 2
The ‘E’ model of the motor comes with a single “live” wire as it comes with a RF remote control. This ‘S’ model doesn’t have any of that fanciness, which is great because this gives the ultimate flexibility on how I want to automate the motor – i.e connecting it to a purpose-built shutter relay that connects to my home automation control center, the VeraLite. (As I wrote about earlier, the VeraLite is a control center for a Z-Wave-based home automation solution)
I went straight to Taobao to find a source. I did a random search for “DT52S”, the model of the motor. Tons of results came up. I randomly chose one from a dealer based in Hangzhou, specifically 小殷智能窗帘馆. They not only sell the motors, but also the rails. 
Here’s the link to the motor I bought. But, I specifically requested the ‘S’ model, and not the ‘E’ model – so be careful here!
We made a few phone calls to the guy who runs the shop, Mr. Li, to understand what kind of measurements we needed to do. Mr. Li was extremely helpful and friendly. Based on his coaching, I came up with the following measurement diagram and sent it over to him:
Living Room Curtains, 2 directions

Master Bedroom Curtains, single direction (curtain moves from the right)
Yes, the writing is mine. As you can see, it’s been a while since I wrote in 汉字.

We made a conscious decision to only buy the rail and motors from China as we wanted to see and touch the curtain material in person – so that we’re sourcing here in Singapore (and paying for it too!)

Overall, the cost to produce the rails and buy the motors (2 motors, 2 rails) came to about RMB 1,416 (~S$ 280). (This is before shipping). They charge about RMB 80 per meter of rail. The Motors were RMB 428 a piece. To put this into perspective, sourcing rails (boring manual rails) here in Singapore is around S$100 for 2 rails, at least that’s what our curtain guy was charging). Shipping to Singapore was about RMB 680 (~S$ 136).
The key to connecting the motor to the VeraLite is this little relay: The Fibaro Shutter Relay (FGR221). (I didn’t buy it from this link)
There are other competing products but Fibaro is a well known brand and I believe the Fibaro modules are among the smallest in the market. (You also pay a bit of a premium for this).
I sourced these locally in Singapore from a company named Domotics for S$95 a piece. Each one controls one motor. Wiring is simple. I ignore the S1 and S2 connectors as I won’t be adding any physical switches. So the connectors I am interested in are: N for Neutral, L for Live, O1 for Direction 1, and O2 for Direction 2.
I went to my local hardware store to pick up some electrical wiring, a concealer box to mount to the wall, and some other nic nacs. The last thing you want is exposed wiring, especially with a 1-year old running around. Here’s what the wiring looks like in the concealing box. The wiring coming from the bottom goes to the wall plug. From the top is from the motor. As you can see, I plugged the brown and blue from the wall into L and N connectors on the relay respectively. The smaller black and brown wires plugged into O1 and O2 are from the motor. That’s it. Really simple. There are plenty of nice wiring diagrams out there so I won’t attempt to make one myself.
Now, I realized my measuring was slightly off for my master bedroom. Seems I had to cut about 2 inches off the rail.
I had to take the rail apart. Inside is a steel reinforced rubber track with teeth that the motor turns.
An excuse to by a hack saw.

 Back together.

Measuring to cut the correct length of the inner track.

Putting the clasps back on.

And it’s back together!

Adding the Fibaro Shutter Relay to the VeraLite was pretty straight forward. There was one setting I had to make that wasn’t very clear on the forums (I asked someone form the home automation fb group for guidance).
You have to set variable 10 to 1. This tells the motor to not try to be smart and turn off the “shutter positioning”function (yes, “1” means off. counter intuitive, I agree). Before I did this, when I pressed the button to open or close, the rail would stop several times, and rarely make it to the end. I set this variable, now it functions as it should!
(Sorry, in the video, I don’t have the material yet)

Update: I now have the material. Here are curtains operated by the Aeon Labs MiniMote:


While working on getting the curtain rails and motors, I started thinking about the blinds for the other bedrooms. The quote we got locally for manual roller blinds for the 2 bedrooms (4 roller blinds in all) was more than S$ 2000! I thought that sounded outrageous. I found that the same taobao dealer I was working with on the Curtain motors and rails also sold tubular motors for blinds. Also from the same manufacturer Dooya.
The motor we ended up going with is the Dooya DM35S. Link to the product on taobao is here.
After some consultation with the dealer, we decided to take the risk and have him supply the material as well as we felt it may be more difficult to source only the material locally without the roller. Due to the width of our windows, each window would require 2 roller blinds (thus 2 motors), making it a total of 4.
Below are the drawings with measurements I took and sent over.
(this time I didn’t bother with the Chinese characters)
All in, the price we paid for all 4 motors and material came to RMB 3,023 (or approx SGD 606 – a freaking steal). Shipping to Singapore was another RMB 850 (~S$170) – actually, this shipping fee was a topup of the original RMB 680 as my dealer combined all into a single shipment.
The shipment looked like this:
Unpacking the roller blinds: (you see the rails for the curtains at the top of the photo)

Installation complete, now my turn to wire things up. As you can see, I added 2 boxes, one for each Fibaro Roller Shutter relay (one box was too small for both plus wiring)


I tried to be professional by soldering the copper wires

Finalizing the wiring. As you can see, I decided to wire these up in series as I felt the load would be low enough to put both on a single circuit and wall plug. The wire going down at the bottom right of the photo is going to the wall.

And here we are! I connected the Aeon Labs MiniMote here too for ease of use.


All in I think it was worth the trouble of working in constrained spaces, wiring, etc. Good fun. All in, total cost was as follows:
  • Curtain rails and motors (x2) – S$280 | Source: Taobao/China
  • Blinds material and motors (x4) – S$606 | Source: Taobao/China
  • Shipping of the above two items from China – S$306 (ouch!)
  • Fibaro Roller Shutter Relays [FGR221] (x6) – S$570 | Source: Domotics SG
  • Aeon Labs MiniMote Z-Wave Scene Remotes (x4) – S$320 | Source: Domotics SG
  • Miscellaneous wiring, electrical boxes, etc = ~S$100 | Source: Local HW stores
  • Material for Curtains (x2) – ~S$800 | Source: Local curtain supplier
Total Above: S$2980 
Manual curtains and blinds here would have cost about the same, give or take. I think money well spent!

Oh, and I can be even more lazier with the Vera app for Android plugged into my TV.

(Note: You’ll need a Z-Wave control center, like the VeraLite!)