Sunday, September 11, 2016

My Summer of Peppers

I've wanted my own greenhouse ever since I worked at the Controlled Environment Agriculture Center in college.  (Did you know my tomatoes were featured on the Martha Stewart show?)  I learned some basic green-thumb skills on that job, and as an engineer I also identified that many day-to-day tasks were simple enough to be automated.  The intersection of plants and engineering has piqued my interest for years, and it's been rewarding to finally dive into it.
I planned this project as a pilot program for future growing adventures.  My goals were:
  1. Take some plants on the journey from seed to harvest
  2. Build some hydroponic systems, and compare the experience to growing with soil
  3. Record greenhouse operational data for analyses and visualization
  4. Understand how software interfaces with electronic devices, then actually automate some tasks
  5. Build modular components which could be reused in future projects
I wanted to understand the finer points of plant cultivation and agriculture methods, and how I could augment them with my software skills.  To do this, I had to try it out at least once without knowing what I was doing (I call this knocking out the hoodrats).  The experiment would be successful whether or not it produced a big yield.  It's simply a nice bonus that I got a bountiful harvest of peppers :)

I chose these seeds as the basis for my trial.  I started them in peat moss cubes and kept them in a covered tray under a grow lamp for a few weeks, using a 20/4 on/off cycle for the light.  This process was mostly hands off, which gave me time to prepare their transplant habitat.

I planted the peppers in two batches.  The first batch was 16 plants (4 of each type).  The second batch was 36 plants (9 of each type).  I started the second batch about a month after the first.  This gave me time to learn from the first batch and correct course for any mistakes I made.  Out of 52 plants, 5 seeds didn't germinate.  Of the 47 that did germinate, 2 didn't survive to adulthood. 

The first batch was started under the LED shown in the picture to the right.  The second batch needed a bigger light, so I opted for something different.  I didn't notice if either lamp outperformed the other with respect to plant growth.  I imagine the LED is more power efficient, especially when running 20 hours a day for a few weeks straight.


I placed the tent directly against the house because I needed access to water and electrical.  The location wasn't ideal from a sunlight perspective, but the summer days in Washington are so long that just the afternoon sun is sufficient.

I needed room for a few dozen plants, and also a dedicated space for my electronics.  Fire-safety and dryness were my biggest concerns for the electronics, so I dedicated one corner as a plant and water free zone.  Another corner was used for the hydroponic systems, and I used the other half for potted plants.  I made sure to leave enough space to move around in the middle.

I built hydroponic chambers inside of containers that were lying around the house.  Some old styrofoam boxes were perfect for deep water culture, while a 5-gallon bucket was used for an aeroponic reservoir.  I picked up some pumps, airstones, tubing, net pots, clay pebbles, and spray heads as construction materials.  I also needed a power drill and some hole saw attachments, which I didn't previously own.  I wrapped the containers in black trash bags in order to keep light out, which prevents algae from growing in the nutrient solution.









15 of my plants were grown hydroponically, while the other 32 were planted in pots with soil.  I installed a drip irrigation system for the soil plants.  I used a Y-splitter to add an additional tap to my garden hose connection, then I added a backflow preventer, a pressure reducer, a mechanical timer, and a 1/2 inch tubing adapter.  1/2 inch tubing runs from the faucet into the greenhouse, then flexible 1/4 inch tubes run from the mainline to each potted plant.  Each drip line is capped with a 1/2 GPH or 1 GPH emitter, depending on the size of the pot.

 You can't beat soil for "set it and forget it" farming.  Mother Nature can attest to that.  Hydroponic methods give you more granular control over nutrient delivery, but they require more effort.  If you micromanage your plants in a hydroponic system, you can create an interface for sensors and devices, which can then be used to automate some of the predictable maintenance tasks.

I wanted to explore automation with respect to watering, nutrient delivery, and environmental control.
I used a PC battery backup as the power source for greenhouse electronics.  It provided me with 10 outlets, 5 of which could survive power outages for a couple hours.  This was a safety measure for the control computer, and for one of the pumps which runs on a two minute cycle.

My electrical components are two submersible pumps, two air pumps, a space heater, an oscillating fan, and a raspberry pi.  The water pumps are running on timers, while the air pumps are on 24/7.  The heater is controlled by a thermostat.  I turn on the fan and open the windows if I know it's going to be a warm day.

The raspberry pi is connected to my home network via wifi, and connected to a webcam and an arduino board via USB.  The arduino is connected to light, temperature, and humidity sensors.  Once per minute, the arduino provides environmental readings to the pi, and the pi logs the data to network attached storage.  Communication between the arduino and raspberry pi is done using the pyserial library for Python.

I use another raspberry pi as a web server.  The web server reads from network attached storage and serves pages to visualize the data.  The web application was built using Spring MVC and runs inside a Tomcat container.  Routing is handled by Nginx running on the same machine.  Data is rendered in the browser using D3JS.  I opened up HTTP requests to the web server on my router, and I use NO-IP to access it over the internet using a custom domain.  To see today's dashboard, go to tgibriday.noip.me.  To see the dashboard for a specific day, use a URL like tgibriday.noip.me/greenhouse/dashboard/8-4-2016.  To watch my plants grow in real time, go to tgibriday.noip.me/cam.



I wanted to keep things iterative, so the first version of the control system was only used to monitor and record data.  I kept the electronics on isolated circuits, controlled by individual timers and switches.  Version 2 was to use the arduino to control the pumps, fan, and heater.  An integrated system provides a few benefits:
  1. Less hardware needed (substitute timers and thermostats for a relay board)
  2. More data is recorded, which leads to better performance analysis and improvements
  3. Overrides to the system can be controlled remotely over the network

I built an electronics control box inside of a plastic container.  The control pi and arduino sit inside the box along with a relay board.  The arduino powers the relay board and closes or opens circuits when commanded by the pi.  Each circuit on the relay board is connected to an outlet on the outside of the box, and is powered by an extension cable which connects to the battery backup.  My controllable outlets were a little extra work compared to cutting the power cords of my appliances and wiring them into the relay directly, but I think they'll work out in the long run when I reuse the control box for other projects.

I've constructed the control box, written most of the software, and tested it a few times, but I don't think I'll get it installed before the peppers are done growing.  Things are running smoothly now, and I'd rather not "fix" something that isn't broken.  I'm also not confident that my electrical work meets modern safety standards, especially inside a warm and humid environment.  Thankfully I designed my components with the future in mind, so I can let the hub of timers and gadgets finish what they started this season while I prepare the integrated box for next season.


A greenhouse is meant to provide ideal conditions for plants, but it also provides ideal conditions for pests.  At first my pest problem was localized to a couple plants, so I optimistically ignored it.  When the damage started to spread, I kicked myself for being foolish and decided to take action.  This was is one of the most challenging parts of the project for me.  I couldn't catch the buggers in the act, and I was unable to identify them by the damage patterns, so I'm pretty much shooting in the dark trying to purge them.




This stuff slowed the bugs down, but didn't stop them
After a few weeks of waiting (and chasing the ghosts of bugs), flowers started appearing.  In nature, flowers mostly get pollinated by bees and butterflies.  I don't have any bees, so I had to pollinate the flowers by hand.  I put on some baby-making music and grabbed some cotton swabs, and then things got intimate.  It was super exciting when the first little fruits started appearing.  I'm really happy with the quantity that each plant is producing.



My alpha jalapeno plant has several dozen peppers on it!
Throughout the course of this journey, things didn't always go as smooth as planned.  I needed to calibrate the watering schedule for my felt pouches.  The Raspberry Pi shutdown a couple of times due to high humidity.  The electronics and hydroponics systems didn't turn out exactly as designed.  Other things, such as the irrigation system, would have taken much less effort had I bothered to plan at all. Mistakes and shortcomings are OK though because that's how we learn, and at the risk of sounding cheesy, my biggest harvest from this greenhouse was an education.

I'll keep the plants alive as long as they're bearing fruit.  I'm not sure what to do with all of the peppers, though, so if you want some then let me know!  I'll probably try some broccoli in the fall/winter.  I'll continue growing some stuff in soil and some stuff without it, since both techniques have their benefits.  Most of the components I built can be recycled, which will make things simple for the next iteration.  If/when we ever decide to buy a home, I'll definitely keep a consideration for greenhouse space in the yard and room for a hydroponic system in the basement or garage.

I started this greenhouse with a vision of a self-sustaining food production system.  The goal was to install it, then perform minimal weekly maintenance while reaping regular harvests.  That goal is still within reach, but I'm working kinks out of the timing and setup process.  It's hard to appreciate the complexities of a smart greenhouse at a small scale, like my setup.  Keep a lookout for projects like mine, though, and you'll understand why reliability and scalability are important for supporting human populations on this planet and elsewhere.

Thanks for reading about my plants!  This was a really fun project for me.  If you're interested in setting up something like this yourself, then please feel free to ask me for help :)

TGIB!

Edit: Here's a direct link to my presentation of this topic at Bellevue College's "Life on Mars" panel.

Thursday, August 4, 2016

27

26 was a year self improvement.  Since my last birthday I:
  • got into the best shape of my life
  • joined teams for ultimate frisbee and flag football
  • read a variety of fiction and non-fiction books
  • got promoted
  • grew my hair from Owen Wilson to Thor
  • taught myself about electricity and plant cultivation (more on that soon)
  • explored somewhere new
  • did a bunch of other stuff that I can't remember, because a year is a long time
26 was also a year of maturation.  I feel more grounded than ever, emotionally.  I'm shifting from constantly planning ahead to more just living in the moment.  I'm very lucky in that I don't need to worry about much.  Still, for the first 20+ years of my life, stressing about the future was my M.O., and I've found peace in letting that go.



On the other hand, every year after college has felt increasingly like the year of boring adulthood.  I'm going to bed earlier than ever.  I make sure to eat a decent breakfast every day.  I set aside time to exercise.  I guilt myself out of bad habits like video games and TV.  I'll be the first to admit that those changes are anything but exciting, but they do come with a silver lining of discipline.  I've gained the discipline to prioritize the most important things, to focus on what's in front of me, and to unplug myself in some ways from consumer culture that I've always loathed being a part of.

26 was chill in a really professional way.  Even though I still don't know what I really want out of life, I'm not tripping on it.  When the right opportunity presents itself, I'm confident that I'll be prepared to take it.  Until then, I'm just trying to stay sharp and enjoy each day for what is brings.

TGIB

Tuesday, April 26, 2016

Konnichiwa!

Getting There

Our trip to Japan got off to a slow start.  The first 12 hours of the 13 hour flight were smooth, but when our plane approached Tokyo the winds were too high to land.  We were told to circle around until things stabilized.  90 minutes of circling later, the captain informed us that we had to land because fuel was running low, so we were directed to Nagoya airport, which is another hour away.  Felicia and I thought we struck gold since Nagoya was near our final destination of Kyoto.  We could just get off the plane there and  hop on a commuter train, right?  Wrong.  Instead we spent four hours on the tarmac at Nagoya and watched 15 other redirected international flights do the same thing.  The winds near Tokyo finally died down and all of the grounded planes made the short hop to Narita airport.  Unfortunately, since we all arrived at the same time, immigration was basically a two-hour moshpit.  We finally got through around 1:00 AM local time (about 25 hours after we left our house in the morning) but we still weren’t done.  The trains stop running out of Narita at midnight so we had to spend our first night in the airport.  Thankfully they were prepared for an event like this and handed out sleeping mats to all the stranded passengers.  We finally arrived in Kyoto the next afternoon.  I’m still bitter that we couldn’t get off the plane in Nagoya almost a day earlier!


When we transitioned from planes to trains everything instantly got better.  Traversing the country with a Japan Rail Pass was so effortless.  Throughout the week we rode countless bullet trains, local trains, subways, and monorails, and we never had trouble with any of them.  It’s kind of remarkable how they set and achieve such a high bar for availability and punctuality.

Kyoto

With a day lost we made sure to capitalize on our time in Kyoto.  After a quick lunch of conveyor belt sushi we spent the afternoon at Fushimi Inari.  This was a really cool spot! From a Western perspective it seems like a Mecca for Shintoism.  We climbed all the way up and passed through thousands of the orange torri gates which make up the path, and visited thousands of shrines along the way.  It was a perfect change of pace from the previous day.  We picked up some delicious and cheap ramen for dinner and crashed as soon as we got back to the hotel.


The next two days in Kyoto were also packed with activities.  We checked out castles, temples, gardens, markets, museums, a bamboo forest, and a monkey park.  It was really cool to just roam around and explore one of Japan’s most historically significant places.  We also enjoyed the comforts of our hotel - specifically the hybrid Western/Japanese breakfast, the Onsen (public bath), and the "Western Style" toilet.  If you ever find yourself in Kyoto, you can consider my recommendation to stay at Sakura Terrace.



Miyajima and Hiroshima - “Heaven and Hell”

We visited the Hiroshima peace park and museum at the hypocenter of the A-bomb blast.  The park is a beautiful tribute to the victims, and a testament to the city’s strength in recovering from disaster.  The museum is a grim reminder of the horrors of war.  Numerous exhibits illustrate how those who died instantly were “the lucky ones.”  Tens of thousands of innocent people who were further from the blast suffered terribly for rest of their lives - however short they may have been.  The museum was an evocative experience, but I think it’s impossible to really understand the hellish scene without living through it.  Hopefully nobody ever has to again; the museum’s initiative is to raise awareness for future generations in hope of eventually accomplishing nuclear disarmament.

Hiroshima was a very somber visit, but Miyajima island was the perfect place to reflect and appreciate life afterwards.  It’s a little slice of heaven just an hour south of Hiroshima, and a popular vacation destination for good reason.  We stayed at Momijiso Ryokan, a traditional Japanese bed and breakfast on the banks of a creek.  Our hosts spoke barely any English (still more than we spoke Japanese!) but they couldn’t be any friendlier or have offered any better of an experience.  The room was tranquil and cozy, and the food was exquisite.  Miyajima really is paradise.  If/when we visit again, we’ll definitely spend more than one day there.

Tokyo

We didn’t have any particular agenda for visiting Tokyo, so we just went to a few of the famous neighborhoods to get immersed.  Our favorite was the sushi breakfast that we had in Tsukiji market.  We also shopped around Harajuku and the Pokemon Mega Center in Ikebukuro.  Those places were pretty neat, but shopping isn't really our cup of tea.  We caught a baseball game between the Yokohama Bay Stars and the Yomiuri Giants.  It was cool to see another cultural lens on baseball. The crowd was much more like an international soccer match than a MLB game.  For dinner one night we ate at a maid cafe in Akihabara.  It was cute but it also had undertones of being in a strip club, which made the meal a little uncomfortable.  Overall the experience in Tokyo was good, but I’m just not a big city guy so I’m not going to prioritize a return visit.

Food

Growing up I never really explored Japanese food beyond sushi, so I decided to take my tummy on its own adventure through the country.  Ramen and udon noodles became the staple.  Casual restaurants were everywhere, especially in the train stations, and the food was way too tasty for the low price of each meal.  All my noodles were delicious, and the flavor was different everywhere we went.

Sushi in Japan is as good as advertised.  I didn’t know fish could taste so fresh.  At Tsukiji market they literally buy the tuna from fisherman at 5:00 AM and sell it to you for breakfast at 8:00.  Americanized me would never have considered sushi for breakfast.  How could I be so blind!?  Our omikase dinner in Kyoto was also incredible.  Omikase basically means “chef’s choice,” and our chef must have been a marine biologist because we had more different sea specimens than I could count.  I was nervous about some of the more exotic dishes such as whole squid, sea urchin, and some mysterious eggs, but I drooled at the sight of fatty tuna nigiri and sashimi.  We polished off all five courses and ultimately this was one of the most satisfying meals I’ve ever eaten.


We ate fast food a couple of times.  Our bento boxes from the train station were simple and filled with quality ingredients.  We also ate McDonalds once.  Felicia had a shrimp filet sandwich while I branched out on desert with a Hokkaido Milk Pie and a Green Tea and Azuki Bean McFlurry. 

Azuki bean just might be my favorite legume.  It’s sweet but not too sweet, and soft but not too soft. It’s the perfect ingredient for making traditional sweets, or even as a standalone side dish to a bowl of noodles!

Sayonara

All things considered we really enjoyed our week in Japan.  It's a land full of friendly people, scenic landscapes, delicious food, vast history, and rich/quirky culture.  I really look forward to visiting again sometime.

TGIB

Thursday, April 14, 2016

Catching Up


I haven’t posted in too long.  Here’s my attempt at filling in the last six months!

Holidays
The 2015 holiday season had its ups and downs.  I got to spend a lot of time with my family and my in-laws, whom I always love to see.  Being an independent adult 1000 miles from home is fun, but there’s a certain warmness that only comes from spending a week as a carefree kid in the family house.  Felicia and I got a chance to bring our families together over Christmas, which was really fun.  We hadn’t done something like that since our wedding.


Of course, every family has its “family business” and mine is no different.  Ours cast a shadow over the holidays, but in a way it also added authenticity to our time together.  Being a family isn’t just about sharing the good times.  Any group of people can party.  Families struggle together through the bad stuff too.  As much as nobody wants to deal with that kind of drama, at least we were able to do it as a family.  We’ve been fragmented for as long as I can remember, so even though we didn’t have ideal circumstances I still found solace in the fact we were able to do something together.

Work
In October I got promoted at Amazon.  My official title is now Software Development Engineer II - Test.  I felt that I deserved the promotion earlier (especially after some shady annual review politics the year prior), but I appreciate it regardless.  There’s no formal responsibility added to my job, but I’m continuing to take on new leadership roles organically, and I’m pretty satisfied with the salary bump.  I’m almost three years into my four-year signing bonus, and with the recent performance of Amazon’s stock I’m making out pretty well :)

We’re churning out a pretty cool new project right now that should be available in a couple months.  I was originally apathetic about it, but as I see it come along I’m getting more encouraged.  I don’t know how much of that is just my emotional attachment to something that I have ownership of and how much of that is genuine objective coolness.  I can’t tell you what the product is, but I’ll let you know when it comes out so you can judge for yourself.

Travel
In December Felicia and I went with our good friends Casey and Christina to Orlando to celebrate Casey’s 30th birthday.  What more magical way is there to celebrate than visiting the Wizarding World of Harry Potter!?  If you’re into theme parks then early-December is the time to visit.  Lines are short between the two major American holidays, and the Florida weather provides a nice respite from the Seattle winter.  Of course roller coasters are my jam, but even if you’re not a thrill seeker you’d still love Diagon Alley.  There’s nothing like a cold butterbeer on a warm, sunny day.



In February we spent a long weekend in Whistler, eh.  10 of us loaded up a few cars and convoyed up after work from Seattle.  Whistler is an expensive destination, but thankfully the USD is strong so we were able to afford an awesome chalet just outside the village.  There’s nothing like drinking ice cold Coors Light in a hot tub as thick snowfall surrounds you.  The skiing itself was a mixed bag.  The mountains are so large that you wind up hunting for the right microclimate.  We found some sunny slopes on Blackomb, so we spent most of our time there.  We also took a trip up to the Whistler peak and ran into the worst storm I’ve ever experienced.  We were basically on the planet Hoth.  The snow was soft and the slopes were steep, but with the gusting winds and lack of visibility we were in pure survival mode.  By the time we made it down they had closed that lift for safety reasons :P

In March we headed to Vegas for the Pac-12 Men’s Basketball Tournament, as is tradition.  It’s always a treat for me to see the ‘Cats play.  Even though they couldn’t finish the comeback against Oregon in the semi-finals, it was still one of the craziest games I’ll ever get to see.  We also got to daydrink on the lazy river during the day and catch a show at night.  If you’d like to see people pushing the boundaries of human possibility and political incorrectness, then Absinthe at Caesar’s Palace is the show for you.

I’m heading to Japan very soon - stay tuned for my next post!

Health
I haven’t been to a doctor in 10 years.  That’s mostly due to good genes and a sustainable lifestyle, and the rest is luck.  It’s not something I ever really thought about because it was never necessary.  Then I caught the flu in Whistler and came back down to Earth.  I didn’t need any medicine and I got over it in a couple weeks, but damn was it demoralizing.  I’m not looking forward to being sick again, but the silver lining from that event was a reminder not to take the blessing of consistently good health for granted.

I got my wisdom teeth removed in February.  I put it off as long as I could, but the dentist was practically begging me to get them yanked so I finally had to pay the piper.  I witnessed my brother’s experience with it as a teenager and I was mortified about the idea of puking from anesthesia sickness while my mouth was openly bleeding.  Luckily none of that happened.  I just ate a bunch of soft food for a couple of weeks and had to clean out my sockets every day, which was pretty gross.  (One of my teeth was growing in sideways so it left a massive hole in gums which is actually still healing a couple months later!)

Lifestyle
I quit playing WoW in December, and with college basketball season now over, I’m finding myself with all kinds of free time.  I’ve done a pretty good job of filling the void with wholesome, positive activities.  I’ve been running and lifting weights regularly, playing basketball whenever the weather is nice, reading a mixture of fiction and nonfiction literature, and tinkering with various engineering projects.  Hopefully some of these things will develop into long-term habits.



One of the books I recently read is The 7 Habits of Highly Effective People by Stephen R. Covey.  There’s no revolutionary lesson to be learned from this book, but it did help me materialize some things that I’ve always noticed about the world and personal relationships.  Attempting to synopsize the book would be an injustice to its message, but if you’re feeling unsatisfied with life then I recommend that you open your mind and give it a chance.

TGIBriday!