Posts

Embedded Gardening, Part 5 - Software Considerations

Image
Working on this platform with Micro Python has been pretty interesting.  It's a strange combination of low level driver access patterns, memory limitations and debugging with higher level python and interpreted code.  Using the WebREPL for remote debugging and serial Python console afford pretty convenient and fast print and repl testing.  Breakpoints would be nice and I think you can do that with ESP32.  Early on I started getting out-of-memory (OOM) errors when loading all the python drivers for the peripherals I was using.  But I made an error in judgement, and rather than use the built-in tools to track down the exact memory usage of each module and memory used while the program was running.  It would have saved me some time. I decided that since each module was not needed simultaneously, rather than load all the modules into memory, I'd load them as needed, and then unload them.  When you use a python "import" statement, the module gets loaded int...

Embedded Gardening, Part 4 - Perf Proto Boarding

Image
Solderless protoboard is fast and flexible, but the connections can be flaky and the wires can pull out if you move it around.  I wanted to move it to something a little more permeant. I needed a way to keep track of the wiring, so I downloaded and learned how to make a basic schematic in EasyEDA.  It was really pretty easy, at least for the diagram.  I'm expecting layout to be more challenging. I cleaned up my wiring diagrams a bit before doing the protoboard.  Here is the diagram: This included the new MCP23008.  And to be honest, for the extra cost, since I only needed one more  GPIO with interrupt support, v2 will just use a board with more GPIOs.  Bringing in another driver brought a series of difficulties that I'll discuss later. You'll may notice the buck converter is missing from the diagram.  At the time, I only had parts for one board and I was concerned about wiring up the converter wrong and toasting the ESP8266.  In the prototypi...

Embedded Gardening, Part 3 - Initial Prototyping

Image
The next step of the watering system was prototyping the system with a solderless breadboard. Here are the main physical parts hooked up. Electronics This allowed for validating wiring and drivers. One issue I found after setting up the drivers was that I was unable to handle interrupt requests on the digital GPIO I was planning on using for the flow meter. As this was a D1-Mini based ESP8266, not all GPIO pins were brought out and the one I chose didn't support registering an Interrupt Service Routine (ISR) to handle interrupts.  Luckily, or so I thought!, there was one one remaining GPIO that was internally connected to a blue LED on the board. The idea behind the interrupts and ISR is that if supported on a given GPIO pin, when there is a change in state, High to Low or vice versa depending on configuration, the system calls a function you register for that pin.  The flow meter generates square waves that indicate the flow rate/ The borrowed diagram below shows the physica...

Embedded Gardening, Part 2 - Picking Parts

Image
The next step was to pick some parts. I have to admit, I'm a bit of a hardware fiend.  And if a part is less than $10, I'll often buy a couple.. just in case!  In case of what?, yeah, well, occasionally I'll find I have a part from a previous project that works out.  But mostly they just hide in different little carboard boxes in their little Mylar bags, almost but not quite organized enough to be where I look for them.  In this case I did have a success.  The level shifters were needed and I was able to find them.  So there, they do ACTUALLY get used sometimes! So now, on to what is needed to make the watering thingy. The Brains... I wanted to keep it small and am really loving the ease and flexibility of MicroPython .  Some of the smaller SoC's that I like are Espressif ESP8266 based devices. I generally use NodeMCU type dev boards.  You can get them for between $0.79 and $3 these days.  Shipping is usually the deciding cost if you need un...

Embedded Gardening

Image
We planted some tomatoes. But then we wanted to take a vacation. The easiest thing to do would have been to ask a friend to water or get a timer with some drip tubing. Simple timers like this are available at Home Depot and Amazon. There are fancier WiFi Enabled ones too: Also there are these pumping systems that require containers of water which they pump from. Does this seem crazy to anyone else? Is the reasoning behind this to limit damage when watering indoors due to system malfunctions due to system errors? Is this to avoid accidental $1000 water bills for plumbed systems? Another concern is how can I know that the system is working and really watering the tomatoes? I can point one of my Arlos at it to get a pretty good idea. While better, it's somewhat limited. If I want to see them all with one camera, I won't be able to look closely and see if the soil is damp. Also, I'll bet I could find some industrial controllers. But looking around, what I found seemed ex...