Shop OBEX P1 Docs P2 Docs Learn Events
So I've got this task at Parallax - a Blockly project with a plant and water pump..... — Parallax Forums

So I've got this task at Parallax - a Blockly project with a plant and water pump.....

Hey everybody,

As we develop the Blockly product line at Parallax we're aiming to make it very complete in the same was as people appreciated Stamps in Class. Stamps in Class has many popular tutorials like Process Control, Earth Measurements, and Basic Analog and Digital. These projects emphasized so much beyond robotics, which is our intent as we develop the Blockly program.

Today the team tasked me with a project so we could achieve a couple of goals:

- Showcase a self-watering plant using a pump, moisture sensor and water level sensor
- Get some neat photos for a big 2x8 "BlocklyProp" banner, and publish the project

I need to do a good job for them because they are very well-organized and effective in everything they do.

This project is really quite easy to program and set up. No problems as defined above. I could even add an OLED with a rolling strip chart that shows the amount of moisture and water graphed against time.

The project needs to be simple, too. I don't want to integrate a lot of complexity into it.

But there's something bugging me about this - it doesn't really showcase the Propeller and there are hundreds of Arduino-like projects out there that do the same thing.

What simple additions could be added to this project to make it impressive - but still simple for others to duplicate? What kind of basic software enhancements or Propeller-specific improvements might you suggest?

Thanks,

Ken Gracey

Comments

  • 'Haven't messed with Blockly much, so I don't know what its limitations are. But to show off the Prop you need to have it serving up a webpage via one of your WiFi modules that includes a current webcam snap of the plant, along with text -- and maybe a graph -- showing its watering history and profile.

    Um, is it a man-eating plant? If so, maybe you could use the Prop's voice-synth to quote lines from "Little Shop of Horrors." :)

    -Phil
  • One thing comes to mind, a plant benefits from a drip irrigation, not to let the soil medium dry out. Which would let the tender root ends die. Too much moisture isn't good either.

    A few dozen plants of different varieties would be a good implementation for a Propeller, as long as you were going to control lighting and nutrition with it. One plant could be taken care of with a BS2. IMO
  • How about several moisture sensors at different levels to see if l'il Audry's toes are too wet, too dry, or just right. And maybe a touch screen interface to modify watering parameters. Last but not least, incorporate a humidity sensor to increase watering rate during very dry days and reduce watering when it gets steamy.
  • @Phil: soon we will have complete blocks for the WX. At that time I'd consider adding that part to the project.
    @MikeDYur: yep.
    @Hal Albach: that's an idea I can probably work with.

    Thanks!

    Ken
  • ercoerco Posts: 20,254
    edited 2017-02-15 06:29
    Great ideas so far.

    Talk about "gilding the lily" (or at least watering it), a Prop is definitely overkill for the basic job. As Mike pointed out, a BS2 (prolly even a BS1) is up to the task. TTYTT, with 16 I/Os, a BS2 could monitor and water 8 plants, so the Propeller needs to do more.

    Per PhiPi, it seems like a golden opportunity to incorporate some BlocklyProp high tech multimedia features, using web, OLED displays, speech (I can make you a deal on some SP0256 chips!). Make a datalogger of time vs. water, and throw in Hal's humidity sensors, also temperature and light sensors. As this compulsive hoarder has mentioned elsewhere, it's downright foolish to NOT use numerous 10-cent photocells, multiple 10-cent thermistors and several 3-cent 555 timers in every project we do.
  • Perhaps assigning the cogs of the Propeller to separate tasks such as controlling the water flow, moisture, humidity, PH sensors and displaying the info on a monitor for multiple plants. To go a step further, you could use 2, or more, Propeller boards connected either via Zigbee, bluetooth, and such with one handling the watering and plant monitoring and the other collecting the data to be posted on a screen and or web page; maybe even, gasp, the cloud. All this with no Raspberry Pi, Beaglebone Black or PC needed; all the heavy work done by the Prop.
  • ErNaErNa Posts: 1,742
    Hi Ken, I miss a temperature sensor. What makes the Propeller superior? It is the fact, that tasks can run in parallel. While the system is running, other experiments could be done. If you measure temperatur in the soil and outside in free air, you should be able to correlate temperature (difference) and humidity. You might come up with an solution, that replaces humidity measurement but temperature measurement or even combine both to have a more reliable value.
    An SD card also allows for long time data locking, what could be done using a eeprom alternatively.
  • Cluso99Cluso99 Posts: 18,069
    Ken,

    What Prop board are you using? ie what else is on the pcb?

    I am not familiar with Blockly - Can it control multiple cogs individually?

    The project needs to showcase how simple cogs can run different processes without interfering with each other which means no interrupts. The Blockly style programs on other micros usually hide these complexities but cannot deal with fast time-critical code. So the project needs something that the other micros (AVR) cannot easily deal with. Hooking a VGA or composite monitor might be a better showcase for the prop rather than LCD/OLED.
  • Hey guys,

    This is fantastic - I'll run all of these sensors in parallel, in their own processor (in Blockly we call the block "new processor" instead of "cognew" so we can speak a more universal language). This certainly demonstrates the Propeller very nicely and makes for a tidy code system that functionally and graphically writes it's own pseudocode.

    I'll get it up and running today, after I finish combing through my messages.

    Thanks!

    Ken Gracey
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2017-02-15 17:15
    A couple of comments:

    1. If people aren't interested in the specific project, they'll move on to something else. This means ideally have a wide variety of projects, where hopefully one will catch a person's fancy. Developing all these is time consuming, though, so in addition to full projects, I think it's also good to have lots of little-bitty code that take <5 minutes to set up and demonstrate. Can you implement this project to show how it can be started with bare basics, then things added on?

    2. The more complex a project -- to make it impressive or otherwise -- the harder it is for people to deconstruct it, and use the pieces in their own projects. If you do enhance it, maybe do it in a way where components can be easily added and removed, without breaking the rest of the code. Similar to the above, could you write your demonstration to use universal blocks that people can pull out and reuse? Or maybe this is already a design goal of your Blockly tutorials.

    Personally, always found the code demos where output was through a VGA or composite monitor rather meaningless. Who other than a Prop developer has one of these monitors laying about? It always irritated me that I had to pull in some serial monitor code to see output -- though that helped me learn more about the Propeller. I wouldn't say that grumbling frustration is the best way to learn, though!

    Politely disagreeing with my esteemed fellow forumster, basing the project to show off the abilities of the hardware doesn't help a person who's who's trying to learn coding. I know that an occasional dose of Brewer's yeast is good for me, but darned if I'll be willing to eat it unless they put it in a Snicker's bar.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    I removed my Toro Sprinkler control because it wasn't very intuitive. I replaced it with a Propeller-based unit that also monitors soil moisture in each zone and doesn't turn on that zone if scheduled and the soil is already damp. The sensors all run in a single cog, while the main routines run in another. There is a cog running serial for the LCD as well. It could all have been realized using Blockly.
  • erco wrote: »
    As this compulsive hoarder has mentioned elsewhere, it's downright foolish to NOT use numerous 3-cent 555 timers in every project we do.


    Do you ever worry about combining cheap knockoffs, with your Grade A Propeller projects?
    320 x 320 - 17K
  • Cluso99Cluso99 Posts: 18,069
    A couple of comments:

    1. If people aren't interested in the specific project, they'll move on to something else. This means ideally have a wide variety of projects, where hopefully one will catch a person's fancy. Developing all these is time consuming, though, so in addition to full projects, I think it's also good to have lots of little-bitty code that take <5 minutes to set up and demonstrate. Can you implement this project to show how it can be started with bare basics, then things added on?

    2. The more complex a project -- to make it impressive or otherwise -- the harder it is for people to deconstruct it, and use the pieces in their own projects. If you do enhance it, maybe do it in a way where components can be easily added and removed, without breaking the rest of the code. Similar to the above, could you write your demonstration to use universal blocks that people can pull out and reuse? Or maybe this is already a design goal of your Blockly tutorials.

    Personally, always found the code demos where output was through a VGA or composite monitor rather meaningless. Who other than a Prop developer has one of these monitors laying about? It always irritated me that I had to pull in some serial monitor code to see output -- though that helped me learn more about the Propeller. I wouldn't say that grumbling frustration is the best way to learn, though!

    Politely disagreeing with my esteemed fellow forumster, basing the project to show off the abilities of the hardware doesn't help a person who's who's trying to learn coding. I know that an occasional dose of Brewer's yeast is good for me, but darned if I'll be willing to eat it unless they put it in a Snicker's bar.

    Respectfully I have to disagree with the notion that VGA/Composite monitors aren't readily available. I often see VGA LCD monitors being discarded because the user has upgraded to a bigger screen. Car reversing LCD monitors (composite video) are cheap (<US$16 on eBay http://www.ebay.com/itm/4-3-TFT-LCD-Rotary-Backup-Monitor-For-Car-Reversing-Rear-View-Camera-GPS-DVD-TR-/141810045912?hash=item21048993d8:g:u0AAAOSwal5YGXvo). I have used these with my 1pin and 1 resistor driver for text output, as well as traditional 3pin and 3 resistors for color output.

    I have also had good results with cheap SPI LCD modules (<US$4 on eBay http://www.ebay.com/itm/128X128-1-44-Serial-SPI-Color-TFT-LCD-Module-Display-Replace-Nokia-5110-LCD-Red-/172227931162?hash=item281995ac1a:g:CrQAAOSw44BYFG-t).

    Not having played with Blockly, I am not sure what would be required to have driver blocks/objects for these displays. These of course can be used to complement a project as an add-on. It is nice to see that Blockly does support multiple cogs, and yes, "new processor" makes more sense than cognew to the beginner.


  • Add a Marbella roller coaster course around the flower pot(?) to pick up water from a reservoir and dump it on the flower pot, have a robot arm poke the soil to measure the moisture, have a little guy (robot) rake & plow the soil, have a robot "bird" fly around the flower pot and find a robot "worm" - all like an old time store front display window animation.
  • PropGuy2 wrote: »
    Add a Marbella roller coaster course around the flower pot(?) to pick up water from a reservoir and dump it on the flower pot, have a robot arm poke the soil to measure the moisture, have a little guy (robot) rake & plow the soil, have a robot "bird" fly around the flower pot and find a robot "worm" - all like an old time store front display window animation.



    Since we have given all these great ideas for Ken to implement. Is there a way to tell that the plant is actually thriving. A camera shot once every 24 hours would make an interesting time lapse video.
    Had there been any thoughts on what plant species. House plants go crazy given all the right conditions. You would have to start out with a large pot, a plant getting root bound is diagnosed after the plant is stunted. Maybe a dwarf tree may be a better long term option. Slow growing, and aesthetically pleasing are the Bonsai. Chip could get you a Walnut start, supposedly a bonsai can be done with any tree. If I leave a pile of walnuts laying on the ground for more than a year, they all sprout. Let them go to long, and the weed trimmer won't cut it. Vigorous, but slow growing.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2017-02-17 20:27
    Hi Ken,

    This task seems vaguely familiar!

    I see your beta code for this project at
    http://blockly.parallax.com/blockly/demo/blocklyc.jsp?project=3791
    It does seem like something you'd want to build up in stages. Like Earth Measurements for Stamps In Class. Each added sensor or function needs its own short tutorial, then at the end violá you have a complicated system. There are plenty of good suggestions above for blocks to add. I'm not clear on how Blockly works in the classroom. There has to be some kind of tutorial along with it, right?, to show how to set up the hardware and to motivate and explain.

    As shown your program (block? sketch?), the alarm sounds in relation to one fixed threshold. I'd add hysteresis to that. Especially as you incorporate the pump. You'd want to let the plant dry out a bit before watering it again. Varies by plant. Students need to understand the concept of hysteresis.

    Do you have a source for pumps? That became an issue for Earth Measurements. Maybe a DIY valve to a reservoir of water could work out. I see you have an unimplemented Servo block in the program. Do the students have servos in their kit? Maybe use that to move a siphon tube.

    The program now calls a simple ADC routine to measure the moisture level. In Earth Measurement I used an LMC555 to generate an AC signal to measure moisture. It is important to use AC instead of DC in order to avoid corrosion effects that both destroy the electrode eventually and also corrupt the signal. The output of the 555 is a frequency. (I'm with Erco, every project should have a 555. Above all else a great teaching tool). The Prop is good at measuring frequencies. For something uniquely Propeller, the moisture could possibly be measured by a TDR stub in the soil and a couple of counter modules.

    Carbon dioxide might be a good one. Kind of expensive though. How about sap flow? It is not exactly easy in practice, but in theory it is just a heater and couple of temperature sensors under an insulating blanket.

Sign In or Register to comment.