The first long term measurement I made, to test the behaviour of the sensor over a longer time range was a failure. After the five days with the device introduced in this post, the readings made absolute no sense.
The sensor was not moved in the flower pot and the plant was once watered at the begin of the measurement. While it looked promising at the begin, the frequency suddenly went down again, which was very irritating. I am still investigating how this could happen.
To get closer to the real measurement of the final plant watering sensor, I started a new approach.
I soldered a header to one of the LED pads on a fully assembled plant sensor. Next I changed the device for the measurements.
I ordered a single panel as a test for the production version of the plant watering sensor and I got astonishing perfect panels from Eurocircuits.
Even I only ordered just one, I got three perfect panels in gold. Thank you very much Eurocircuits! As you can see from the photos, the quality of the panels is just amazing.
This panels use the Eurocircuits registration system. This is a own set of rules for the registration holes around of the panel. Using these registration holes, I can easily align the stencil and the board on a special tool they produce. I will tell more about that in one of the next parts of the series “How to design a cheap plant watering sensor” (Read Part 1, 2, 3, 4, 5)
If you have questions, miss some information or just have any feedback, feel free to add a comment below.
Update: Weller solved the problems I describe in this article with a new design of the retainer. This new retainer solves all the problems described in this article. The new retainer looks very different and uses a spring to pull the tip to the heating element.
A little bit more than a half year ago I bough a Weller WT solder station. This solder station has a very smart design and there are many features I like.
The solder pencil is very small, but has exactly the right weight and grip to solder for a long time without fatigue.
The cable between the station and the pencil is very flexible, soft and never gets tangled magically.
The tip heats up to working temperature in seconds.
After a programmed time, the station goes into power saving mode and automatically wakes up as soon you touch the solder pencil again.
It has a large nice display, just showing the info you actually like to know.
Even digital, temperature can be quickly and precisely changed.
The solder pencil is very modular, you can actually have multiple heat elements with different tips and change them in the middle of the work.
The tips are small and relatively cheap, but from a high quality.
The stand is heavy and does not slide away. You can switch between brass wool and a sponge if you like.
For the Boldport Club project “The Matrix” I used hot air soldering for the first time. After some experimenting and with help from Boldport Club members, it worked really well. I could colder the 120 LEDs in less than 10 minutes to the board.
I made a video about the process. Please keep in mind, I am new with this process, so this is absolutely no instruction video how things should be done. I may be absolutely wrong. 😀 Enjoy!
Here a list of the objects and tools you can see in the video:
To gather more long-term measurements for the capacitive method I use for my plant watering sensor, I created this small logging device. As you can see, it uses one of the plant watering sensor prototypes for the measurements. Instead of using the ATtiny13A on the board, it passes the oscillator signal directly to the microprocessor of the logging device.
In front there is a very small 128×32 OLED display, where I can see the current measured frequency in kHz. On top, the current time and date is visible, and on the right there is a graph where I can see the values from the last 48 hours graphically. There is not much visible in the graph, because I took the photo just after installing the sensor.
Every minute, the current average of measurements is stored in a CSV file on a SD card. After a few weeks I should be able to analyse this file and see the results. Here I am especially interested in the cycles from watering the plant until the soil got dry again. Continue reading Plant Watering Sensor – Long Term Logging→
This is the fifth part of the meta-tutorial, where I talk about designing a cheap plant watering sensor. If you did not already read the first, second, third and fourth part, please do it now. These parts contain a lot information which lead to this point of the tutorial.
The fourth part ended with step 20, where I did usability tests and stability tests using the preliminary firmware. This article will focus on designing the final board for the project.
Step 21: Design the Final Board
Designing a good board is like one of these puzzles with quadratic tiles, where you try to lay down a 3✕3 set where all edges match. Often a small change result in many follow up changes, so you have to rip-up a lot of routes and design them in a new way.
My goals for the board were:
Everything, except the two LEDs, should go to the top side of the board.
Reduce the amount of vias to the absolute minimum.
Create a ground pour, especially around the oscillator part, to reduce noise.
Move the button as far as possible from the oscillator to minimise the influence if the user presses the button.
Make it as small as possible.
I worked with small iterations, checking the design after each iteration and checked the design against my goals. To keep track of the changes, I versioned each larger iteration. This way I could go back at a later stage for comparison or if a change did not turn out well.
I worked with Autodesk Eagle to create the board. This tool is in the current state far from perfect, but it is cheap and has all required features for the task. For me personally, these are the features I need to design a board:
Smart routing editor which is linked to the schema.
Quick and easy way to create vias and see the required connections.
Good library support for symbols and packages.
Design rule checks.
Quick board preview to check label placement and design.
I am a machine engineer and very used to work with CAD software. The abbreviation CAD stands for Computer Aided Design. I personally think, Autodesk Eagle fails with the ‘A’, because often it does not give you any aid. On the contrary it often puts a spoke in the wheel and makes your life horrible.
Please do not get me wrong, there are many aspects I like and the alternatives I know have other issues. I would really like to work with Altium Designer, but a license is way to expensive for me as hobbyist. There is also KiCAD, a very promising program. I will try to do a whole project design in this software soon, to see where the strengths and weaknesses are.
I hope the Eagle developers will be able to add the described features to the software. They develop Eagle using C++ and the Qt framework – I personally really like this language and framework combination and use it for most of my own software.
1. Inadequate Layer Handling
Even if you only work with a two layer board, the board display quickly gets crowded and it is very hard to see all details.
It is not only the visual representation, as soon objects are close, selecting a specific one gets really hard. In some locations, you always have to cycle through many objects, until you find the right one. This is slowing down your work and is really annoying.
Hide some of the layers is the solution for this, but you have to do this either via text commands, or create many own keyboard shortcuts to work efficient. Just for the simple action to only show the top layer, you have to enter display none top and shortly after this display last to restore the previous view. There is a panel, where you can do this actions graphically, but this is a modal dialog and blocks further user input – it is useless for efficient work.
For a software, where layers play an such important role, the layer handling is inadequate. Every modern vector drawing program already demonstrates, how an efficient layer handling can be implemented.
There should be a permanent visible panel, docked in the window, where the list of all layers is visible:
It should be possible so view only a single layer and restore the previous view easily.
A special combination of layers should be save- and loadable.
Layer presets should be accessible via keyboard shortcut.
All layer should be made visible with one click.
There should be a default view to restore at any time.
The panel should be easily hidden and shown with a keyboard shortcut.
Another important missing feature is locking. Each layer should be lockable, so no objects on this layer can be selected or modified.
Each layer should be lockable.
All layers except one, should be easily lockable and the previous state restored easily.
There should be an option to allow modification of attached objects, even if the layer of these is locked.
This is the fourth part of the meta-tutorial, where I talk about designing a cheap plant watering sensor. If you did not already read the first, second and third part please do it now. These parts contain a lot information which lead to this point of the tutorial.
The third part ended with step 18, planing the final firmware. There a decision was made about the language and style of the firmware. This article will focus on the code of the firmware itself.
Step 19: Write a Preliminary Firmware
In order to be able to do some final tests with the prototypes and be able to work on the final PCB, I need a firmware which is is very close to the final one. In the Atmel Studio, I start a new C++ project in a new folder.
The first thing I do is checking the chosen compiler options for the project. Everything looks reasonable, I just add the option --std=c++11 to the C++ compiler options to get the latest language features.
In a section below I will describe all modules I wrote and will point details about the functions. I obviously did not wrote the whole firmware sequentially in that order, instead I use a incremental approach to develop the software:
Create empty frameworks for all modules.
Create a header and implementation file for each module with the correct name.
Add the header comments, the namespace, #pragma once and the #include for the own header file.
At this point, each module should be ready, so I can easily add new functions to each module.
Start with the hardware module.
Write the initialisation for the hardware, like CPU speed, port directions and other important stuff.
Layout the interface for the hardware module and prepare empty implementation blocks to be filled with code.
At each place where code is missing, I write a comment // FIXME!! to be reminded that there is something missing.
Start the logic module.
Write the main entry point of the logic.
Call this entry point in the main() method of the firmware.
This is the third part of the meta-tutorial, where I talk about designing a cheap plant watering sensor. If you did not already read the first and second part, please do it now. These parts contain a lot information which lead to this point of the tutorial.
The second part ended with step 14, designing a first prototype PCB. So let us start with the next steps in this journey. This article will be the smooth transition from prototyping to the initial planing for a final design.
Step 15: Assemble and Check the Prototype
After receiving the prototype PCBs from OSH Park, I assemble one completely, including the cable and with one of the sensor plate prototypes as foot part.
Set the Fuses of the Microcontroller
The microcontroller ATtiny13A requires programming using SPI before it can be soldered to the board. There are special bits in the memory, called “fuses”, which control very basic settings of the chip. One of this fuse controls if the chip can be programmed and debugged via the debugWire protocol. This protocol just uses one single wire to program and debug the chip, bus has to be enabled first.
So I put the microcontroller into the programming adapter and connect everything via the Atmel ICE to the computer.