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.

Digging Deeper into Indoor Gardening

What do plants actually require in order to grow well?

It is important for context and it is important for every human to understand what it takes to grow plants, even if the future doesn’t allow for outdoor cultivation.  At a minimum this is my effort to prevent future generations from suffering the fate of a World without plants as proposed by Mike Judge in his movie “Idiocracy” where people no longer understand why plants wouldn’t want to live on a beverage containing “electrolytes.”

Regardless of which method you choose:  soil, hydroponic, or an aquaponics system, none will be able to compensate for poor growing conditions such as improper temperature, inadequate light, or pest problems.  Indoor grown plants have the same general requirements for good growth as field-grown plants. The major difference is the method by which the plants are supported and how the inorganic elements necessary for growth and development are supplied.

Let’s start out by discussing what it takes, at a minimum, to grow plants indoors and then look at ways to improve, scale in size, and automate the mundane.

plant-needs-chart

Quick review of growing in soil

When we think of home gardening, we typically assume the plants are growing in soil.

Soil makes sense.  Plants in nature grow in soil, some maybe fortunate enough to receive a freshwater stream but most plants use their roots to seek out and locate water and nutrients.  Seasonal sunlight provides the light intensity needed for photosynthesis.  Temperature control is achieved by combining the sunlight with the wind to create a comfortable growing environment, while frequent rains bring the water needed by the plant for both nutrient uptake and respiration.  The plant can rely on signals such as the change in daylight and weather to indicate that it is time to flower.  Pollination occurs from the wind or bees and other insects that enjoy a sweet nectar as reward for their services.  Pest control is handled by the natural order when a predator insect finds, catches, and eats the pests on the plant.

As with most in life, It need not be a binary decision.  We don’t have to create a sterile environment for plants to thrive indoors.  In fact, I prefer to grow with hydroponics indoors and include a compost tea that I make from soil!

Going Soilless

 

 

Growing plants indoors without soil is a lot easier than you may think.pothos

If you or a friend have a common houseplant, such as a Pothos or Philodendron, then you can try out hydroponics without anything more than a small jar and tap water.  Using utility scissors, clip off a small 4-6 inch section of the Mother plant that has a few healthy leaves.  Wash and rinse a jar, then fill with clean tap water to about half of the jar. Rinse the clipped portion with tap water and insert it into your jar.  Ideally, you would feed the plant by supplying a small serving of nutrient solution, without it very little growth will occur. Place the jar on a dark shelf where the leaves can hang out into the light.  Within a few weeks, you should see some root growth.

Why not just grow ever plant the same way as the Philodendron?   The plant is hardy and can tolerate most indoor living conditions.  The same plant would grow much faster if we provide it with a more stable comfortable environment and aerate the water with an aquarium air pump.  Additionally, most plants are not as tolerant of the cloning process, removing a clipping and expecting it to grow roots, without an anti fungal to prevent root rot and a rooting hormone to encourage root growth.  Also, that formula is not recommended for plants that produce food.

Plants that produce food require more.

What types of plants grow well indoors?

f2vlheoi87656cg-mediumf3m2d9ii7vqmc2x-medium

Leafy greens (lettuces, spinach) herbs:  parsley, cilantro, oregano, thyme, chives, mint), strawberries, tomatoes, cannabis, exotics, etc.  Squashes and the like require a great deal of space as they mature enough to produce fruit.  Onions, carrots, turnips, radishes, and especially, potatoes, require a lot of root growth space.

hydrotonContainer and growing mediums

Clay Pots, grow bags, but mostly, plastic containers and PVC Tubing

Common soilless options:  rockwool, expanded clay pellets, hydro stones, vermiculite, perlite, coco coir, peat moss, sponge

What do you need to setup a complete indoor garden

Equipment needed for lowest-cost method of growing indoors

 

 

  • Tent or confined structure
  • Fluorescent Light on an outlet timer.
  • Intake Fan / Exhaust Fan
  • Containers
  • Water / Nutrient Solution
  • Air-pump ( aquarium-style) and tubing

Recommended:

  • Temperature / Humidity Meter
  • EC Meter
  • pH Meter

We need electricity and a way to get water to the grow site.

  • Lights
  • Ventilation
  • Water quality, Oxygen, and Mineral Nutrients

Location

Consider whether you are going to be sharing your living space with the plants?  If so, then you will need an indoor growing tent.  

 

 

Important factors to consider include:

  • How much space do you have?
  • What do you want to grow and and how much of it?
  • What is the cost of equipment and how much time do you have to spend maintaining the system?

If you are fortunate enough to have access to a greenhouse, terrarium, or sun porch then you can take advantage of our natural sunlight.  If you’ve not grown in those environments or don’t have one, then you might want to convert an entire garage, basement, or other room? However, before you do that, I highly recommend you start with a small to medium-sized grow tent, which you can then setup inside of a garage, basement, or other room creating a smaller micro-environment.  Even if you plan on scaling to a larger size, then you’ll be glad to have the tent environment so that you can use it primarily for starting seeds.

Plants grow well only within a limited temperature range. Temperatures that are too high or too low will result in abnormal development and reduced production.

  • Warm-season vegetables and most flowers grow best between 60° and 75° or 80° F. 
  • Cool-season vegetables such as lettuce and spinach should be grown between 50° and 70°F.

Think about safety when setting-up your indoor garden.

It is a very good idea to use a GFCI adapter for your AC outlet if it does not already have one. Good quality extension cords can then be attached.  I often use the top of the tent as a place for the electrical cords to meet and connect to an extension. It is important to keep electrical cords a few feet or more off of the floor / ground in the event an overflow or flooding occurs we do not want to create an opportunity for electricity and water to mix.

recommended equipment:

48” x 48” x 80” indoor grow tent

24” x 24” x 48” indoor grow tent

Setup a tent, or closet, or spare-room.

A search on Amazon will result in many options and many sizes.  Whatever size of tent you think you have space for, imagine the tent taking up a little more than that and reconsider.  Trust me, I’ve made this mistake more than once 😉

Suggestions:

Next Up:  Maintaining your Indoor Garden

More Info:

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

Starting a Smart Indoor Garden

What’s at stake?  Are you providing life support or inadvertently executing a death sentence?  Are you improving the system, or adding more dependencies?

Bigger than a window herb garden but smaller than a greenhouse?

hydro-diagram-final

A basic, low-cost, reliable, indoor garden is a controlled environment typically in the form of a tent inside a room, inside a garage.  You have one or two AC-powered ventilation fans, recirculating and/or one is the intake and the other is the exhaust.  You have two super bright fluorescent lamps connected to a mechanical/digital timer controlled AC outlet providing the plants with their appropriate light-cycle.  Your plants are contained in soil, or a basic deep water culture hydroponics system. A large plastic reservoir with multiple grow baskets containing clay pellets partially submerged in the nutrient solution being aerated by an aquarium-style air-pump that’s connected to an air-stone, creating bubbles, preventing stagnation, keeping the culture healthy. 

image11
small hydro garden setup

 

temp humidity display

 

An inexpensive household digital temperature and humidity gauge provides daily readouts including minimums and maximums.

lux

 

 

The next “smart” enhancement can be to use a temperature controlled AC outlet for at least one of the fans helping to keep the temperature and humidity in range while reducing the power consumption being used by a continuously operating fan motor.

 

 

Next Up:  Digging Deeper into Indoor Gardening

More Info:

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