Best Shepherd’s Pie Recipe

Shepherd’s pie has always been one of my favorite dishes.  Growing up and until recently, it was made with beef (technically cottage pie, I believe).  Then a couple years once we started having lamb we switched to using lamb.  Really good.

BUT, we made it this week with mutton and…wow.  Sooo good.

So now my official Best Shepherds Pie recipe calls for

  • 1 can creamed corn
  • 1 can whole kernal corn
  • ~6 medium potatoes, grown in the garden, preferably from stock from Aroostook county, ME.  And preferably the Carola variety, which has a nice yellow buttery flesh.
  • A couple handfuls of frozen peas.  Again, preferably from the garden
  • 1.5 lbs ground clun forest mutton.  The breed is critical here, of course. 🙂  Substitute lamb if you can’t get mutton.
  • Raw sheep or goat milk.  Preferably 24 hrs old or fresher (like, from the animal, not the store)
  1. Brown the ground mutton, adding some salt and pepper
  2. Make mashed potatoes, using the sheep/goat milk and plenty of butter.  Clun forest sheep have a very high butterfat content (6-9%!!) so it makes it extra delicious!  We also milk Nubian goats which have about 5% butterfat. Season to taste.
  3. Layer the pie.  Mutton at the bottom, then the two cans of corn (1 creamed, 1 whole kernel).  Then some peas for extra flavor and color, and finally the potatoes on the top
  4. Spread a bit of butter on top of the potatoes to help get some crispiness
  5. Bake in oven at ~350 degrees for 20-30 mins, until potatoes have started to crisp up and brown

Yes, you need to think ahead on this recipe for those garden potatoes, peas, and mutton.

Also, I recommend not telling your daughter that Daffy tastes amazing, she *might* get a bit upset….

Hope everyone had a great holiday!

“Alexa, raise my desk to 15 inches”

Last year, I built a DIY Raspberry Pi controlled electric standing desk.  It was a great project and I’ve gotten a ton of use from it.

To move the desk, I simply had to:

  1. Launch PuTTY on my computer
  2. PuTTY to the raspberry pi
  3. Log in
  4. Navigate to the directory where the program was running
  5. type sudo python3
  6. Tell it what height to move to

It works and is definitely better than sitting all day… but we can do better than that, right?

Yes, we can.  My desk is now voice-activated via Amazon Alexa!

Isn’t that better?

How does it work?

There are 3 parts to the integration:

  1. Alexa Skill
  2. Azure-hosted API
  3. Desk Controller


Alexa Skill

Amazon has an SDK for the Amazon Echo family devices called the “Alexa Skills Kit“.  In short, the Alexa skill contains 3 things:

  1. The things your skill can do (called intents)
  2. Sample ‘utterances’ and how they map to the intents
  3. Instructions on how to call your program

Your program can either be an Amazon Lambda program, or it can be a HTTPS API that the Alexa service will post a message to.

It’s easy to set up a simple skill to get started.  Check out the Amazon developers site for how tos, tutorials, etc.  Or if you want to learn in a bit more structured way, check out “Developing Alexa Skills for Amazon Echo” on Pluralsight.

The speech assets for my desk are on github.


The API is simple and does 2 things:

  1. Receives commands from the Alexa service and translates the intent and parameters to a desk command
  2. Responds to the desk controller’s requests for command.  The desk is using a long-polling mechanism to get commands.

The code is here (disclaimer: this is hack-it-together code, not production quality!)

Desk Controller

The desk controller uses the python program I had previously created to control the desk, but adds long-polling to get commands, rather than waiting for someone to type into the console.

What’s Next?

The program has lots of room for improvement, the Amazon process for certifying skills is rigorous, and the interactions with the desk will get better as I find the terms that I want to use to control it.

Have feedback?  I’d love to hear it.  Leave a comment or reach me @_brentonc on twitter.

Standing Desk: Wiring 6 relays to 2 GPIO pins

A comment on a video about my desk recently asked,

I’d like to know how you wired up everything (the pi to the relayboard) using 2 GPIO pins. Could you please take a picture and upload it to your blog?

Good question, Jake.  Here’s a picture.



But that’s not too clear, let’s break it down.

  1. This gray band connects the RPi to the breadboard to make it easy to make multiple connections.  But you can connect directly from the pins to the breadboard; just make sure you bring power and ground as well.  And you’ll beed male/female connecting wires to make the connection.
  2. Connect the 5v power (red wire above) and ground (black wire above) to the power/gnd pins on the relay.
  3. The breadboard lets us connect multiple wires to a single pin.  When that pin is ‘on’ all three connected wires are signaled.  In the picture above, the 3 green wires on one pin; the 3 blue wires are connected to a second pin.
  4. The green and blue wires are connected to the relays in alternating pairs.  Each one turns on one relay when signaled, so each time the pin on the RPi is on it triggers 3 relays in my case (one for each actuator in my desk).
  5. For each of my actuators I use two relays.  This allows the signal to be reversed by flipping which switch is on, thereby telling the actuator to extend or contract.

So, after all this, the code to extend, retract, and stop is easy!


Good luck!

First Egg!

One of our ladies laid her chickens laid her first egg – very exciting!  Unfortunately, it wasn’t in great shape when I found it:


I’m a little disappointed we can’t have this first one for breakfast, but over we are excited nonetheless!

How old are the chicks?  When this egg was laid: 21 weeks, 2 days.

Amazon Echo just bought paper towels for me?

This am, true story:

Me: “Alexa, I need to buy paper towels”

Alexa: “sparkle 24 giant rolls, white, your order total is $27.  Should I place the order?”

Me, puzzled at this unexpected response: “um, yes?” 

Alexa: “Ok, order placed.  Your order will arrive on Tuesday, May 26th

Me: oh crap, I still have ~24 rolls from my last order!

How to send events from a Raspberry Pi to Microsoft Azure Event Hubs

Sending data from a Raspberry Pi to a Microsoft Azure Event Hub is remarkably easy.  Here are the steps:

1) Configure your Event Hub in Azure

This article on MSDN shows the steps to set up an Event Hub.  It’s very easy and takes just a minute.  But when you get to the part about how to send messages, come see #2 and #3 below!

2) Install the Azure SDK on your Pi

This should be pretty easy, but I had a little bit of trouble getting pip 3.2 running on my Raspberry Pi 2 B.  Once I did get pip-3.2 installed (because Python 3.2 is what comes on the Raspberry Pi), it’s easy:

pip-3.2 install azure

3) Write a little code

Once the Azure SDK is installed, you can write your “Hello Event Hub” program.  Here’s what mine looked like:

azure poc

You can download this sample on github:

Note, this sample is largely based on this article in the Azure SDK documentation.

The only things that weren’t immediately obvious to me from the official SDK documentation was what the shared_access_key_name,shared_access_key_value, service namespace, and hub names were.  Here are a couple screenshots to help you visually map the data points:

Namespace and Event Hub names:

Namespace and Event Hub Names

Shared Access:

Shared Access

4) Glory! 🙂

Once you get this set up, you’re ready to event!  The Azure portal gives you a handy dashboard to see the rate a which messages are coming through (but, there’s a bit of a delay, so don’t worry if there is a delay between when you start sending messages and there is something to see in the dashboard):

Event Hub Dashboard

New DIY/IoT/Raspberry Pi Project: Smoker Temperature Controller, or “My Smoker is an Internet of Things Thing”

For my next project I am going to build a wifi enabled, Raspberry Pi controlled temperature controller for my Weber Smokey Mountain (WSM) smoker.

The temperature of a charcoal smoker is controlled by the flow of oxygen.  More oxygen, more heat.  This is usually done by checking the temperature of the smoker every now and then and adjusting the vents – more open to get it hotter, and less open to make it cooler.

The idea is simple – thermometer connected to a Raspberry Pi, a fan/blower plugged into the WSM, and a small python program that tells the blower to blow if the temp gets too low.  It’ll be interesting to see what other adjustments need to be made once the base solution is in place.  And once it’s going it becomes simple software to push the temperature readings and other data to my phone or other devices.

The WSM actually keeps its temperature quite well, and doesn’t require much babysitting most of the time, so this project is very much in the ‘because I can’ column. But, with something like this it will be much more feasible to smoke overnight, for example (om nom brisket!).

Also – yes, I know I can buy something that is ready made for not a lot of money.  But what fun would that be?

DIY Standing Desk Part I: Running a linear actuator from an Arduino

I’ve been using a standing desk on and off for well over a year now.  At the time I started I was thinking about buying a GeekDesk or similar, but decided to try out standing first.  The Ikea Standing Desk recipe from Colin Nederkoom worked great.

Fast forward a year.  I found that I enjoyed using the standing desk, but it wasn’t all that well suited to switching between sitting and standing because the monitors don’t raise/lower with me (without some distracting manual moves).  Ultimately this ended up meaning that I preferred the sitting position that had the two monitors.

Around Christmas 2014 I started looking at adjustable desks again, and was close to buying one.  But sometime during the process of deciding what to buy I decided it would be WAY COOLER to make one myself.  And if I made it myself I could write software for it.  And if I could write software for it then I could make it do ANYTHING I WANT (squat-thrust mode, anyone?).

The basic plan is to:

  • Use the desk surface I already have (an Ikea L-shaped desk) and just build a lift for it
  • Control it either via Arduino or Raspberry Pi (or both)
  • Use 3 Linear Actuators, one each for 3 legs

Before going ahead to buy all the parts, I decided to get one leg working to prove the concept out.  After a few misfires (forgot to buy a power supply, wire that was too large – 18 gauge seems to fit the relays I have nicely, but 16 gauge did not) – I got it working!

Firgelli Automations has a blog post that outlines how to connect up 2 SPDT relays to an Arduino to allow it to both extend and retract.  In my case I elected to get some RobotGeek relays, and while I was at it got their workbench and Arduino Sensor Shield as well (much neater than wiring everything through a breadboard as I had done previously).  The actuator I have is a Firgelli Automations Sleek Rod Tubular Actuator, with a 150lb force and 18″ stroke.

Anyway – step 1 is looking good.  Next I plan to try running the Actuator directly from the Raspberry Pi, and make a decision about whether to use a dumb actuator like the one I have, or to go with a feedback actuator.

By the way – the software for the desk (work in progress!) is posted on github: