The DIY Smart Garden System

I’m going to take you on a tour of Do It Yourself Smart Gardening

My name is Cory, I’m a Technical Craftsman specializing in creative problem solving within electronics and software engineering.  Professionally, I’ve worked as an electronics engineer, a plastics fabricator, software engineer, an industrial laser technician, and, of course, a coffee barista.  I’ve spent the last several years working on a Smart Garden System project I named, hydroMazing.  I’m sharing my work with you because I would like to empower everyone who is interested in a “Smart” approach to gardening.

What we’ve covered so far:cropped-hydromazing_smart_garden_system

 

Are you interested in following me on this journey?

Now that we have an understanding of what it takes to provide an optimum indoor growing environment we can start analyzing the cost-benefit of further optimizing and automating the system.  Please share with friends and follow to receive a notification when I publish the next section.

Section 1:  Let’s start by using an Arduino Nano on an Expansion Board to monitor the indoor gardening environment.  We will measure light intensity, ambient temperature, relative humidity, nutrient/water temperature.

Section 2:  Continue working with the Arduino Nano on an Expansion Board to control appliances in the indoor gardening environment.  We can continue working directly wired or we can start working with wireless communications.  Wired or Wireless?

Section 3:  Add an Arduino Uno using an LCD with Buttons Shield to provide a display and alerts.

Section 4:  Add the Raspberry Pi for remote access, notifications, data collection, and analytics.

Section 5:  More sensors:  moisture probe, pH, E.C., carbon dioxide level, flow-rate, liquid, float (liquid level switch).Peristaltic Pump

Advanced:  Using Dosing/Peristaltic Pumps for Nutrient Solution Management.

Using a Raspberry Pi and USB Camera  Use Raspberry Pi to monitor or collect snapshots of the garden using a USB webcam.

Coming Soon:  hydroMazing Smart Garden System Kit

Kit includes wired and ready sensors and components for making the Controller Module (Arduino Nano) and Web Services Module (Raspberry Pi)?

Please share with friends and follow to receive a notification when I publish the next section.

Why Arduino when you can Pi?

Arduino
Arduino ProMini, Uno, and Nano on expansion board.

Why Arduino?

The greatest advantage to using the Arduino family of microcontrollers for DIY electronics projects, is that they are ubiquitous.  Since they are so available, they are inexpensive and you can find open-source software to get started.

If you’ve ever had the opportunity to work with an Arduino Uno microcontroller board, then you’ve probably executed the flashing LED example.  Going further, you might attach a button, or switch, to trigger the LED or to turn it off making the project interactive.  There are many sensors that could be connected to the Arduino Uno and setup to trigger events, such as the LED flashing, using threshold values that we would need to experiment with in order to figure out what settings work best for creating the effect we want.

While the examples that come with the Arduino software and the examples included with libraries are an excellent start to a project; the Arduino family of microcontrollers is often grossly underutilized in many projects.  Sure microcontrollers are limited in how many instructions they can run; hitting the program size limit doesn’t take very long when you want to control more than a few blinking LEDs.  Even with creative variable handling and custom libraries, eventually, there is a need for another microcontroller or to move to a larger one, even a Raspberry Pi.

In my Alien Invasion Slot Machine project, I tried to push the Arduino closer to its limits.

Time Management and state and trigger flagsf0zk2etiagml1az-medium

At its most basic, a microcontroller loops through a set of instructions handling each action with the focus of The Red Eye of Sauron from Lord of the Rings.  There are a few interrupts that can be configured should an event be so important to receive the full attention of the microcontroller.  Using some form of time management creates a state machine. If x amount of time has passed since x event, then do something and so on…

“The behavior of state machines can be observed in many devices in modern society that perform a predetermined sequence of actions depending on a sequence of events with which they are presented. Simple examples are vending machines, which dispense products when the proper combination of coins is deposited, elevators, whose sequence of stops is determined by the floors requested by riders, traffic lights, which change sequence when cars are waiting, and combination locks, which require the input of combination numbers in the proper order.” https://en.wikipedia.org/wiki/Finite-state_machine

There are rare instances where: RTOS, AI, neural networks exist on microcontrollers, but that’s best left to software-oriented systems such as a Raspberry Pi.

After trying many different timer and time management libraries I felt they were either too much or not enough of what I was wanting in my timers.  A set of timers that are easy to set, keep track of their own state, and each have their own trigger flags.

Button assumptions

buttons

Interacting with an electronics device such as a microcontroller or computer system is relatively easy and typically provided as an example for developers looking to use the device in their project.  Press a button and an LED illuminates. A button or switch may seem like a simple sensor input, but it’s not.

The device’s system resources are consumed waiting and watching for a button press. When we use a button in a project we typically think of it being activated when pressed.  Then what? What should happen if the user holds the button in the active position? Will the button be counted as pressed once, or is the program going to count each second, or x amount of time, as another button press?  Does the program need to know that the button has been released?

Hardware and wiring

wiring harness

Rather than using the Arduino Uno and a protoboard or breadboard for this project, I’m using the Arduino Nano on an expansion board.  Keep it simple using common wiring colors, keep it modular so connections can be made with ease, keep your project sustainable; a part can be replaced rather than the entire system.  The DuPont wire connectors that come with prototyping starter kits makes it easy to create your own custom wiring connections. The wires are easy to solder when a more permanent connection is needed.  I make custom wiring harnesses for neater, cleaner, and more easily connectable modules.

 

Raspberry Pipi3

The latest version of the Raspberry Pi v3 uses a Linux OS and is a computer that can do so much more than an Arduino Uno, why not just use it for everything?  While it is possible to do many of the same tasks as you would do with the Arduino Uno or variant, it’s not always best.  The Arduino Uno and variant microcontrollers are best for doing the same actions, over and over again, such as reading a sensor and doing something with the value.

As I mentioned previously, you can do a lot with a Raspberry Pi, and depending on how much you are doing, it won’t take too long before you discover it has limits.  When the Pi overheats, it will either freeze or shutdown, hopefully, the processor has a heatsink.

More Info:

Please share with friends and follow to receive a notification when I publish a new article.

Making Sound Effects with Arduino

speaker

Sound and Voice Effects

Sound plays an important role in the user experience by adding another layer of depth; making for a more realistic experience.  http://www.robotoid.com/sound/soundingoff-sounds.html

  • Arduino and piezo ~ dual purpose can make sound or be used as a vibration sensor
  • Low-cost option – WT588D ~ $5
  • Other options include the Adafruit Audio sound board $20 and mini computer systems on a board, such as Raspberry Pi or similar $30+.  These devices also need an SD card to provide memory space, more sensitive to vibrations and use more power.

 

SoundFX Lightshow

Using an Arduino Nano on an expansion board with push-buttons, one to play a sound and the other to select a sound effect from a WT588D through a speaker.

For this project, I’ve selected a low-cost option, internal memory, and reasonable sound quality – WT588D-U, this model includes a built-in mini USB port for power and direct programming.  Sound output is amplified by the module and produced by a standard 0.5w 8-ohm speaker or can be connected to an amplified speaker system. The down-side with this module is that it can be difficult to get the programming software and drivers installed and configured.

Using the WT588D voice module connected to a basic speaker, the project can deliver cellular phone quality sound.

More information and tutorials specific to the WT588D:

There are several options for triggering a sound clip to play.  Examining the documentation for this module including the schematic…The sound module has a few modes to select from when working with it.  If there are only a few sounds that need to be triggered then the direct button mode would work without a microcontroller. However, if there are several sound clips, it takes just as many wires to connect to a microcontroller using the following 3-wire configuration:

WT588D-3-line-serial
Three Line Mode=

I’ve taken the time to download sound clips, modify, and organize a few themes.

  • Games – sound effects for the mechanics and the animation, GLaDoS voices from the Portal video game
  • Spooky – selection of spooky sounds for Halloween projects.
  • LCARS – Star Trek computer phrases and sounds.
  • Zelda: Link To The Past – sounds from the video game.

 

 

Other themes online:

 

IMG_20180726_072519070
Alien Invasion Slot Machine uses the WT588D board for sound effects.

 

Parts:

  • Arduino Nano
  • Expansion Board
  • USB to mini USB ~ 5ft. cord
  • AC/DC Outlet Power Adapter
  • Project Box
  • WT588D Sound Module
  • 8 x 7-segment Display module
  • (1-4) strips of 10 RGB 12mm LEDs.
  • (2) push-buttons
  • photocell
  • microphone
  • PIR sensor

 

Steps:

Prepare the following for wiring and connect to the expansion board:

  • WT588D with wiring harness and speaker
  • (1-4) strips of 10 RGB 12mm LEDs.
  • 8 x 7-segment Display Module
  • (2) push-buttons
  • photocell
  • microphone
  • PIR sensor

 

Connect the push-buttons to the expansion board and upload test code.

Nano with buttons

Connect strips of 10 RGB 12mm LEDs to the expansion board and upload test code.

Connect the 8×7 segment display module to the expansion board and upload test code.

Nano WT588D

HotGlue WT588DConnect the WT588D with wiring harness and speaker and upload test code.

 

 

Any sensor can be used to trigger specific or random sounds and going even further, a basic neural network could make decisions using multiple sensor inputs.

Connect the photocell to the expansion board and upload test code.

Connect the Microphone to the expansion board and upload test code.

Connect the PIR sensor to the expansion board and upload test code.

 

SoundEffects
Completed SoundFXLight Project

Insert Arduino Nano into Expansion Board and plan to provide power using USB to mini USB cord.  Optionally, AC/DC Outlet Power Adapter

https://youtu.be/kD2SiK95vtk

Enclosing the project

Drill 7/16” – 1/2” holes into the project box:

  • HOLE 1: side
  • USB to mini USB ~ 5ft. cord
  • Optionally, AC/DC Outlet Power Adapter

 

  • HOLE 2:  cover push-button
  • HOLE 3:  cover push-button

 

  • top front side
  • HOLE 4:  (1-4) strips of 10 RGB 12mm LEDs
  • HOLE 5:  speaker connector

 

  • HOLE 6:  side
  • microphone, PIR sensor

 

You can purchase a completed SoundFXLight directly from me as a functioning example.

promini sound
Arduino Pro-Mini directly connected to WT588D