So I've got this task at Parallax - a Blockly project with a plant and water pump.....
Ken Gracey
Posts: 7,392
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
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
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
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
@MikeDYur: yep.
@Hal Albach: that's an idea I can probably work with.
Thanks!
Ken
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.
An SD card also allows for long time data locking, what could be done using a eeprom alternatively.
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.
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
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.
Do you ever worry about combining cheap knockoffs, with your Grade A Propeller projects?
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.
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.
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.