Solar Powered WiFi Weather Station

I’ve always wanted to add a backyard weather station to help record not just temperature data, but humidity, pressure, rainfall, wind speed and UV levels. My recent experiments introduced me to the ESP8266 NodeMCU, a low-cost microcontroller with embedded WiFi. I just needed to add a solar cell, a battery, a sensor and an enclosure.

Solar Power

I found a 2.5W 5V/500mAh solar cell (from Amazon) and a 3.7V 3000mAh rechargeable Li-ion battery pack (Amazon). After some research (see here), I added a TP4056 charger module (Amazon) that regulates the charging and protects the battery from overcharge.

Solar cell and battery charging circuit.
Solar Cell + Battery Power Supply

I added a 0.1uF ceramic capacitor and 100uF electrolytic capacitor to smooth the output voltage. I used a simple 3.3v voltage regulator (DigiKey) to feed the 3.3v bus for the ESP8266 and sensors.

Voltage Divider
Voltage Divider

Monitoring the voltage coming from the solar cell and/or battery would help determine if the system is getting enough power during the day to keep the system running at night. The ESP8266 has an analog input (A0) that can be used to determine the output voltage but it can only handle up to 3.3v. By using a simple 2 resistor divider circuit (see right) I could monitor the voltage and apply a multiplier to get to the actual voltage I measured with a multimeter. In this case, the A0 pin was reporting 907 when the multimeter was showing 4.69v so I used 4.69 / 907.0 and further sampled other readings to ensure I had the correct value.

Voltage Charge and Discharge over 4 Days

Circuit Design

The sensors I wanted to add included a BME280 pressure and humidity sensor, a one-wire DS18B20 temperature sensor and a 2N2222 transistor powered rain detector. I put the circuit together using a simple breadboard and started on the code.

Prototype Solar Power Weather Station
Prototype Solar Power Weather Station

Using the free open source KiCad electronic design software, I build a schematic drawing to help build the final non-breadboarded product.

Schematic - ESP8266 Solar Powered Weather Station
Schematic – ESP8266 Solar Powered Weather Station

Getting Started with Arduino IDE and ESP8266

The ESP8266 NodeMCU has a USB port that allows the microcontroller to be easily powered and programmed with the Arduino IDE . However, it is not as easy to set up and use as an Arduino device. I found out that you will need to install a driver to see the device on my MacBook (see here for MacOS instructions and download the USB to UART Bridge VCP Drivers here). Once the driver is installed, the Arduino IDE needs to be set up to manage the NodeMCU. The ESP8266 I purchased came with some instructions:

Instruction & Steps of How to use:
1. Download and Install the Arduino IDE (download here)
2. Set up your Arduino IDE as: Go to File->Preferences and copy the URL below to get the ESP board manager extensions: http://arduino.esp8266.com/stable/package_esp8266com_index.json
3. Go to Tools > Board > Board Manager> Type “esp8266” and download the Community esp8266 and install.
4. Set up your chip as:
Tools -> Board -> NodeMCU 1.0 (ESP-12E Module)
Tools -> Flash Size -> 4M (3M SPIFFS)
Tools -> CPU Frequency -> 80 Mhz
Tools -> Upload Speed -> 921600
Tools -> Port -> (whatever it is)
5. In Arduino IDE, look for the old fashioned Blink program. Load, compile and upload. Go to FILE> EXAMPLES> ESP8266> BLINK

Code

Once I had the ESP8266 connected, I could start creating the code. The code is available here: https://github.com/jasonacox/WeatherStationWiFi

Rain Sensor

Using a simple NPN transistor, you can detect the presence of water. I wanted to detect rain which mean that I needed to add a couple of electrodes connected to that transistor (for detection) and our power supply. Water allows a small amount of current to pass through it to detect water, you will need to amplify it, hence the need for the transistor which turns a low current into a switch to a much larger current. The ESP8266 digital inputs can see the switched power from the transistor and can indicate water has been detected.

Wind Speed Sensor with an Anemometer

An anemometer is a device used to catch the wind and record its speed.

3D Printer

I found a 3D model on https://www.thingiverse.com/thing:2559929

More to come…

Installation

The Unicorn Project

The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Digital, by Gene Kim

This new novel by Gene Kim takes place simultaneously as the events of The Phoenix Project with many of the same characters, business challenges and end results. All of this continues to take place within the fictional company, Parts Unlimited. However, while the prior book gave us insight into the transformation of the operations team, this book chronicles the journey from a developers point of view.

The Unicorn Project takes you on a fun and inspiring journey into some of the most difficult IT and business challenges we face today.  The project may be mythical, but the lessons and ideals uncovered here provide real help and inspiration to any leader seeking to transform their business. Along the way, you discover people empowering, data driven and digital business enabling ways of working that can unleash the powerful potential within any organization. 

There are five ideals that are discovered through the course of the book that will help any business succeed.

  • The First Ideal – Locality and Simplicity
  • The Second Ideal – Focus, Flow, and Joy
  • The Third Ideal – Improvement of Daily Work
  • The Fourth Ideal – Psychological Safety
  • The Fifth Ideal – Focus on our Customer

I recommend this book for any business or technology student, professional or leader who is serious about leveraging data driven digital disruption and workforce empowerment to delivering business value faster, better, safer and happier.

More information about the Unicorn Project.

Home Automation – SentryPi

Who left the garage door open?

We have a full house with a lot of activity and visitors.  There have been several times when the garage door is left open for extended periods of time.  While our Christmas decorations and paint supplies may not be a treasure most would be thieves would desire, it is still not the most comforting thing to think about leaving the garage open for all passerby to see.  I often thought it would be great to have a way to notify whoever is in the house that the garage is open.

Phase 1 – LED Indicator

I decided that my first step would be to design a way to detect “door open” by providing a simple indicator light.  I explored a few optical ways to do this (light beam, camera, reflectors) but quickly pivoted my approach when I found some unused microswitches.

I found a good place to detect “closed” on the main track.  I thought about piggybacking on the garage opener sensors but dismissed that as I didn’t want to risk an undesirable interaction with the opener and more importantly, I wanted to have the detection work even if power to the opener was interrupted.

This required that I build a bracket to mount the switch to and a ramp plate to compress the switch when the door was in the down position.

I used an aluminum sheet, cut with sheet metal snips,  bent and drilled holes to mount the microswitch and eventually attach it to the garage door track.  It took a few tries to get the right fit and right placement of the micro switch.

My first attempt destroyed the microswitch after a few uses.  The garage door track sled has a straight edge that collides with the microswitch roller. It created too much force on the small roller and eventually popped it loose.  To help with that, I added an aluminum ramp to the sled so that the microswitch roller would gently rise as the sled entered the “closed” position.

I decided to make the “door open” state be the closed circuit condition so that phase 1 of the project could start as a simple LED circuit indicator.

I attached the switch and drilled some pilot holes and mounted the bracket to the garage door track right above the sled when the door is in the closed position.

I added a 9V battery, a 470 ohm resister and a red LED to the circuit.  To complete this phase, I ran the wire from the garage to our entry hall and mounted an LED and housing above the HVAC controls.  Now we can all see the brilliant red LED glowing when the garage door is open.  That covers some of our use cases but I also want a more proactive notification.  Now on to phase 2…

Phase 2 – Raspberry Pi – Home Automation Sentry

Now that I have a working “door closed” sensor and indicator, I am ready to add the proactive home automation component, specifically the Raspberry Pi (RPI).  It just so happens that I have a spare RPI Model 3 that needed a project, and I wanted to experiment with AWS IoT services.

I used the RPI to detect the state of the switch. To do that, I will need to wire the circuit into the RPI’sGPIO headers.  I decided to use GPIO Pin 23 and the adjacent ground (GND) pin.

Here is the code that is used to detect the closed circuit (indicating an open door):

#!/usr/bin/python

##  
## Garage Door Sentry - RPI script to monitor door
##  

## load libraries
import RPi.GPIO as io 
import time 

print "Garage Door Sentry\n\n"

## set GPIO mode to BCM - allows us to use GPIO number instead of pin number
io.setmode(io.BCM)

## set GPIO pin to use

door_pin = 23
print "Sentry Activated - Watching: GPIO 23"

## use the built-in "pull-up" resistor
io.setup(door_pin, io.IN, pull_up_down=io.PUD_UP)  # activate input

## States for door: 0=closed, 1=open, 2=init
door=2
## infinite loop
while True:
    ## if switch is open
    if (io.input(door_pin)==True and door!=0):
        door=0 
        print "Door closed"
        # do some action
    ## if switch is closed 
    if (io.input(door_pin)==False and door!=1):
        door=1 
        print "Door open"
        # do some action
    time.sleep(1) # 1 second wait

The next step was to connect to AWS IoT to record this sensor data and send alert messages to my phone.

The following will help you set up your Raspbery Pi as a platform to install the SentryPi scripts.

Required:

  • Raspberry Pi – B+, 2 or 3
  • Wifi Dongle or Network Cable configured
  • SD card (Recommend: 16GB or larger)
  • AWS Account (IoT, DynamoDB)

Read the details on this GitHub Project: https://github.com/jasonacox/SentryPi

The project describes how I added these additional features:

  • Sentry Alert – Send a text message to contacts when an alert condition is reached.
  • Dashboard – Provide an automation dashboard for realtime status.
  • Other Sensor Data:
    • Temperature Sensors
    • Barometric Pressure Sensor
    • Humidity Sensor
    • Motion Sensor

To set up a web based dashboard, I decide to use static HTML, CSS and JS (jQuery, Chart.js and the AWS JavaScript SDK) so it can be hosted on a simple S3 bucket, a web server, or the RPi itself.  See here for the code. 
SentryPi Dashboard
SentryPi Dashboard - Garage Door Graph

DevOps Enterprise Summit – London 2017

#DOES17

I had the privilege of attending and speaking again at this years DevOps Enterprise Summit in London at Queen Elizabeth II Centre across the street from Westminster Abby and Big Ben. The conference was attended by nearly 700 transformative leaders from companies and organization across the UK and the rest of Europe:  Hiscox, ITV, Barclays, Hearst, Jaguar Land Rover, Lloyds Banking Group, Orange, Northrop Grumman, easyJet, Capital One, UK Ministry of Justice, ING, Swisscom, Lockheed Martin and more.

The speakers’ slide decks and videos of their talks are available now!

Great talk by Chris Hill (Jaguar Land Rover) and a great quote…

I love this quote from Suzette Johnson (Northrop Grumman) – an example of a good leader empowering the team:

Jonathan Smart (Barclays) had several great points, including this courageous quote on challenges along the journey:

I love this quote from Jonathan Fletcher’s (Hiscox) talk:

Creating Digital Magic

I was honored to speak again and talk about our DevOps journey at Disney.

Even though I wasn’t able to record my presentation, TheNewStack provided a great write-up of my talk: https://thenewstack.io/magic-behind-disney-devops-experience/

https://twitter.com/DOES_EUR/status/871659037993119744
https://twitter.com/DOES_EUR/status/871661031734603776
https://twitter.com/DOES_EUR/status/871663760678813696
https://twitter.com/DOES_EUR/status/880077833023836160

Ask the Speakers

Great “Ask the Speakers” session with my new friends Jonathan Smart (Barclays) and Andrea Hirzle-Yager (Allianz Deutchland AG):

https://www.srepath.com/inside-disneys-site-reliability-engineering-practice/

And…

The best part of this years trip to London?  Yes, an amazing journey through time and space with my sweetie…

A Seat at the Table: IT Leadership in the Age of Agility

Book Review

A Seat at the Table: IT Leadership in the Age of Agility
by Mark Schwartz

This should be required reading for all technology and business leaders who are serious about digital transformation.  This book takes you on a provocative, fun and comprehensive tour of the key areas that will promote and ignite digital empowering agility, creativity, learning, community and collaboration.

This book may be about taking a seat, but this is no time to be sitting still!   IT leaders will be convinced that their job is now about incentivizing and inspiring courage, passion and technical excellence in service of business objectives rather than blindly servicing requirements. You will even find practical advice on how to deal with projects, scope creep, IT assets (what the author calls Enterprise Architecture), governance, security, risk management, quality, and shadow IT.

DevOps Enterprise Summit 2016 – San Francisco

The 2016 edition of the San Francisco based DevOps Enterprise Summit underscored the momentum and scale of the DevOps movement across the industry.  The summit saw record level attendance and phenomenal presentations from established DevOps luminaries, notable DevOps transformational companies as well as many new companies.

“We are at our best when we are helping each other, serving each other, and making a positive difference” – Jason Cox, Disney

Articles related to DOES 16:

https://blog.chef.io/2016/11/21/chef-devops-enterprise-summit/

DevOps Chat: Gene Kim on The DevOps Handbook and DevOps Enterprise Summit

https://stackstorm.com/2016/12/15/dimension-data-devops-beyond-deployment/

https://stackstorm.com/2017/01/24/innovation-at-dimension-data-event-driven-automation/

 

 

 

 

 

 

Thinking Environments

Transformational technology leaders from many companies across the world assembled at the 2016 DevOps Enterprise Forum to discuss DevOps practices, challenges and best-known methods to help our organizations and our community succeed.

Along with several other leaders, I had the privilege of helping put together a guidance document on DevOps Organizational Models to accelerate business and empower workers. In this free publication by IT Revolution, we take a look at how and why organizations are structured, examine which have characteristics that promote or impede business enabling DevOps practices, and take a deep dive into four different models that began to surface during our research:  (1) the traditional functional silo hierarchy, (2) the matrix model, (3) the product platform model and the (X) adaptive organization model.

Download PDF Here

Authors

  • Mark Schwartz, CIO, US Citizenship and Immigration Services
  • Jason Cox, Director, Systems Engineering, The Walt Disney Company
  • Jonathan Snyder, Sr. Manager, Service Deployment & Quality, Adobe Systems
  • Mark Rendell, Principal Director, Accenture
  • Chivas Nambiar, Director Systems Engineering, Verizon
  • Mustafa Kapadia, NA DevOps Service Line Leader, IBM

More DevOps guidance documents can be found here: http://itrevolution.com/devops_enterprise_forum_guidance

DevOps Handbook

devopshandbookDevOps Handbook: 
How to Create World-Class Agility, Reliability, & Security in Technology Organizations

These notable DevOps luminaries provide a comprehensive definition, patterns and guidance on implementing business winning DevOps culture and practices within your your organization.  Beyond just looking at successful DevOps principles from “unicorn” companies like Google, Amazon, Facebook, Etsy, and Netflix, the authors provide several practical examples and case studies where these same practices are helping traditional enterprise companies like Target, Nordstrom, Raytheon, Nationwide Insurance, CSG, Capital One, and Disney.

The handbook captures several quotes from industry practitioners as well as unpack patterns that help promote increased velocity, feedback and experimentation and learning.

http://itrevolution.com/citations-devops-handbook/

wordcloud-devops-handbook

DevOps Enterprise Summit – London 2016

I once again had the privilege of attending the DevOps Enterprise Summit.  This time it was in the U.K. at the Hilton Metropole.  I was impressed with the representation and talks from companies and organization across the UK and the rest of Europe:  SAP, ITV, Hiscox, ING, Barclays, HMRC, Zurich, and many more.

Themes that I picked up from these DevOps leaders:

  • People – Its all about People – empathy, org change, transformation
  • Speed – Continuous Integration and Delivery
  • Quality – Investment in DevOps practices often results in higher quality output
  • Agility – Microservices and Flexible Infrastructure
  • Security – Everyone’s responsibility
  • Business – Focus on Product vs. Project with integration with business in transformation (BizDevOps?)

I was honored to speak again and talk about our DevOps journey at Disney.

Jason Cox DOES16 London

Even though I wasn’t able to record my presentation, ComputerWorld UK provided a great write-up of my talk, and even gave me a new title! 🙂

https://twitter.com/DOESsummitEU/status/749000157136650241

There was considerable interest in our journey to DevOps, especially our transition from Operation Specialist to embedded Systems Engineers.

Other Quotes

“If technology is done well it looks like magic”

https://twitter.com/tumble_b/status/748460191935500288

References

Systems strategy chief Jason Cox details Disney’s devops journey – ComputerWorld UK

Tips for DevOps Success from DOES 2016 – ComputerWorld UK

DevOps Across the Pond – London Reprise – ITproPortal

Overcoming the scale-up challenge of enterprise DevOps adoption – ComputerWeekly.com

How to Effectively Communicate to Leaders

As an leader who loves working with people, I often have the pleasure of hearing from individuals at all levels across the organization.  However, I am often amazed at how many people fail to communicate effectively with their leaders and others. They are terrible at scheduling meetings, pitching their idea or even asking for help. That got me to thinking, what advice would I give to anyone who needs to communicate with me or other leaders? I came up a list of 7 imperatives that I have learned from those who are the most successful.

1) Be contextual – I often have meeting invites or receive emails or presentations that provide little or no context. The senders may have mentioned it in a prior exchange and are usually saturated in the subject themselves, but most leaders are constantly task switching and juggling multiple ideas, projects, discussions, etc., and can struggle to make connections back to the senders requests. While we all want to be superhuman and always “know what you are talking bout”, the truth is that we have a finite capacity to retain more than a handful of contexts. Provide “helps” to onboard the leader and the rest of the audience quickly. That will help you succeed in getting the point across and if needed, a decision. I love seeing context in the meeting invite or email, or in the case of ad hoc meetings, and introductory summary for why he or she should listen to you.

2) Be brief – As with most leaders, I get several hundred emails, calls, texts and IMs per day. I must skim to survive. You should fashion your communications so that important ideas are highlighted. For written communication, make use of white space to help the eye quickly skim and do what you can to avoid unnecessary language. Can I suggest that executives aren’t the only ones who appreciate this and anyone who discovers this art of concise and effective communication will succeed in their career?

3) Be real – Leaders see through bogus accomplishments and self promotion. I’m most impressed with people who are respectful but direct, confident but humble, and candid but optimistic. They spend more time acknowledging others and the achievements of their team rather than their own.

4) Be kind – Good leaders have little tolerance for other leaders or managers who berate, belittle, or otherwise deal harshly with their team or others. Don’t expect to find a gracious audience with your own leader if you can’t deal respectfully, courteously and graciously with your own staff and partners. Treat others as you want to be treated.

5) Be honest – I’ve seen individuals and teams manipulate messages and presentations to get an executive decision or modify perception without providing all the details or slightly modifying the story. If you know something that could materially impact the decision process, why are you hiding it? Blocking signals to manipulate circumstances for your own benefit will backfire on you personally and in some cases have a significant impact on the company, brand, employees or customers. Be honest.

6) Be optimistic – Good leaders are not looking for everyone to be Pollyanna and will prefer a difficult truth to a comforting lie, but rarely are things without hope or some positive element. Bring a bias toward positive solutions, look for the opportunity in the disappointment, the lesson in a setback or wisdom in a failure. Business is about taking risks and moving forward from mistakes. Surround yourself with others who believe we can make a difference and impact the world for the better. Be an optimist.

7) Be proactive – Don’t just tell your leader what someone else needs to do, take action yourself. It’s great to have a plan to make something better and to bring that to the attention of your leader, but be prepared to be part of the solution!  Leaders are always on the lookout for a great idea with muscle. What are you doing to turn your great idea into reality? Get started.

This list is in no way comprehensive, but hopefully it will help you as it has helped me.