OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Comments / Suggestions on OSPi v1.4

  • This topic is empty.
Viewing 25 posts - 1 through 25 (of 28 total)
  • Author
    Posts
  • #22825

    Ray
    Keymaster

    I just pushed out a post about the ongoing development of OSPi 1.4:
    http://rayshobby.net/?p=8592

    Because this version will be changed to use the OpenSprinkler injection-molded enclosure, which is a considerable departure from the current version, I’d like to collect comments / suggestions before finalizing the design. Feel free to leave your words / questions here or following the post. Thanks!

    #26421

    nayr
    Participant

    Ive been thinking of cooking up a set of boards based upon your design, expanding some of the functionality.. and this is what Ive planned to change so far, but if you want to implement any of these it then go for it..

    SuperCAP instead of Battery for RTC so it never needs replacing.
    A more powerful 5v supply (2A perhaps) and a set of headers available for 5v out, can then solder jumper wire with a barrel plug onto it and have it power a small usb hub.. this will help people with powerful wifi usb chips and/or those who want to connect several usb devices without any reliability/stability issues.
    Header for a TPM36 Temperature Sensor on the board; mebe included so we can monitor system temperature if installed in a Greenhouse etc.
    A PTC Fuse instead.
    Signal Converter so we can plug some analogue sensors in and not worry about the input voltage.
    Circuitry to cutoff the external 5v rail to the Microcontroller if its powered externally/usb so people can troubleshot bad power supplies.
    AC in with Ground, Microcontroller ground tied in so any ESD coming in the sprinkler control lines does not try to go out ethernet/usb, also help cut down on RF interference.. my Elk power supply has a ground it’d be nice to use.
    I also want to add a few serial ports for AtlasScientic Sensor stamps: https://www.atlas-scientific.com/embedded.html but this is more for my own project where I am attempting to maintain PH and TDS automatically and getting it all into the footprint might mean I sacrifice some other circuitry.. but this could also be done with a via USB conveniently if I can power a hub from the board. (Bluetooth or FT232)

    Thanks ray for the project; I wish I had found it before I had a year of circuit designs and prototypes made up :geek:

    #26422

    Ray
    Keymaster

    Thanks for your suggestions and ideas.

    SuperCAP instead of Battery for RTC so it never needs replacing.

    I am not too worried about it: the DS1307 RTC consumes very little current in backup mode, and a CR1220 single battery should last for at least 5-7 years.

    A more powerful 5v supply (2A perhaps) and a set of headers available for 5v out, can then solder jumper wire with a barrel plug onto it and have it power a small usb hub.. this will help people with powerful wifi usb chips and/or those who want to connect several usb devices without any reliability/stability issues.

    Sure. The LM2596 switching regulator adopted in the current design can actually output up to 3A current, but a more careful design, including PCB traces and component selection, should be used if you want to reach that limit.

    Header for a TPM36 Temperature Sensor on the board; mebe included so we can monitor system temperature if installed in a Greenhouse etc.

    OK, good point.

    A PTC Fuse instead.

    There are actually two fuses on board currently, one fact-acting 2A fuse on the 24V AC line, and one 1A PTC fuse on the 5V line.

    Signal Converter so we can plug some analogue sensors in and not worry about the input voltage.

    Good point.

    Circuitry to cutoff the external 5v rail to the Microcontroller if its powered externally/usb so people can troubleshot bad power supplies.

    A SMD switch can be used for this and it should be pretty easy to add to 1.4.

    AC in with Ground, Microcontroller ground tied in so any ESD coming in the sprinkler control lines does not try to go out ethernet/usb, also help cut down on RF interference.. my Elk power supply has a ground it’d be nice to use.

    This would probably require a sprinkler transformer that has a ground wire. Many transformers I’ve seen use 2-prong plug and the output is 2 wires too. I’ve seen one or two transformers that have three wires (I think RainBird has one). But they are relatively uncommon.

    I also want to add a few serial ports for AtlasScientic Sensor stamps: https://www.atlas-scientific.com/embedded.html but this is more for my own project where I am attempting to maintain PH and TDS automatically and getting it all into the footprint might mean I sacrifice some other circuitry.. but this could also be done with a via USB conveniently if I can power a hub from the board. (Bluetooth or FT232)

    This is a little beyond my plan, so I will leave it to you to add these extra functionality ๐Ÿ™‚

    #26423

    nayr
    Participant

    might consider using a BR battery then opposed to a CR; my concern with the battery is temperature range… a winter out in a greenhouse (or even a detached garage) in colorado will likely drop down below the -4F thats the lower limit of the battery.. once they sit at -20 for a week or so they tend to perform poorly afterwords then die prematurely.

    The BR is rated to -22F which is more reasonable (although Ive seen it get lower than that outside here); I switched to supercaps for RTC’s when making circuit for a high altitude balloon… all sorts of battery issues @ 120k altitude & -40 degrees.. We also use em for the GPS in OpenPilot, where thousands of dollars in damages and possibly injury can happen if GPS lock is lost from a brownout… They take up less space on the circuit board, are lighter and more rugged (no loose battery after a plane/balloon crash).. as a result of many great successes with supercaps its my go-to over an onboard battery.

    The problem I see is when the battery dies nobody will notice until after there is a failure; depending on scenario a small power outage in middle of heat wave (when the electrical grid is the least reliable) might destroy a crop if the timers dont come back when the power does; or land you a ticket from local govt for not following irrigation restrictions.

    I dont know how old my analogue sprinkler controller was; I suspect over 20 years… and it ate up batteries in my garage. I’d like to think my OpenSprinkler will be in service for the next 20 years, but changing the battery in it is even more of a pain than in my old controller since I’d basically have to unmount and disassemble the entire thing.

    In my tests with a very high frequency/accurate crystal & RTC with the biggest supercap digikey offers; I was able to maintain time for at a minimum of 10 days without power, it was really close to 2 weeks total; which should more than cover any reasonable unplanned power outage.. If your without electricity that long I dont think your sprinklers are much of a priority; you have bigger issues.. Yes people whom unplug there controller over the winter will have to restore time in the spring but they also wont have any reason to question the reliability of the battery after a prolonged usage in extreme temperatures,. I figure since manual action is required to plug it back in there is obviously someone around to verify that internet is online and the time got set correctly.

    And now, adding a ground-plane with unused copper on the pcb, connecting the pcb ground to that and providing a header for access.. My Transformer has a ground connection, my old 20+ year old controller had a ground connection, if you make it available people will use it. I have a lot of expensive radios and computer equipment in my server room and as good policy I dont allow anything connected to an outside wire to enter my room that hasent been grounded before it enters my room. I will install a ethernet surge protector with a STP ethernet cable connected to my OSBo and and ground it to the transformer ground; this meets my requirements, and should also provide a proper ground to the Beagle; that rain sensor mounted to my gutter, connected to the beagle, wired to my server room makes me nervous.. Come to think of it; regardless of having a ground on the OSpi its best to install an ethernet surge device if your using wired ethernet, but my next point:

    Right now the USB port on the microcontroller is floating ground, I suspect if this was grounded properlly WiFi USB may be less susceptible to noise from the AC coil and power running nearby.. I know laptops with usb radios have all sorts of issues until you plug it into the wall and give it a ground.. You can run a USB Spectrum analyzer or USB-SDR and see an improvement just by plugging a laptop into mains vs running off battery w/floating ground (I am also a HAM with a bit of experience).. I bet if you had a HID ballast nearby (Common in indoor gardens and Garages) with the current design you’d have a hell of a time with wireless and analogue sensor inputs using a floating ground like this, Ive ran into that problem before trying to setup some aquarium automation that was near a Metal Halide lamp. The RF noise from the ballast resulted in erratic and worthless temp readings and flakey bluetooth communications; when I grounded the board properly those problems disappeared.

    *edit* looking at the board you could attach the ground to the board mounting holes with some exposed copper and anyone needing to ground the board can attach to the mounting screw, simple and not really prone to user-hookup error.

    PS: I noticed after the fact there’s a 5v header already on my OSbo; how much current of 5v would be safe to a small hub like this: http://www.monoprice.com/Product?c_id=103&cp_id=10307&cs_id=1030702&p_id=10065&seq=1&format=2 ? If you could get over 2A of power to a hub it’d open the doors to a whole bunch of USB options/modules.

    #26424

    nayr
    Participant

    An onboard buzzer would be a nice addition. Since the Pi/Bo dont have LCD screens it would be a good alternative to physically notify someone to an issue/error they need to look at.. For example; after a successful boot and beep once if using internet time and twice if using RTC; if year is less than 2010 chirp every 20s; or if network is not available, a flood/freeze has been detected, garage door is about to close so play a tone, etc..

    edit* If your going to toss a temp sensor onboard you might look at the BMP180 and putting it on the i2c bus w/the RTC, I believe it is very accurate and has a barometer which might be more useful than humidity, also has a native kernel module and the watchdog daemon should work with it without much fuss. (reboot if temps exceed XXX)

    #26425

    pc123
    Member

    A reliable failsafe circuit is I think critical. I had a flashcard fail, which prevented rebooting, and one of the sprinklers remained on for a full day. I was lucky that that sprinkler was in a visible place, if not this could have destroyed a lot of plants.

    Is there any solution for that with the existing ospi boards?

    #26426

    Samer
    Keymaster

    I am sure you could setup email alerts for some of these issues.

    #26427

    nayr
    Participant

    did you have the watchdog application installed and setup? If your Pi restarted it should have reset all its GPIO which would have closed your valves.

    Wont work on current board but mebe for future ones we can use the RTC w/a hardware timer to cut power to the stations when triggered, then anytime a watering program goes off we set that timer to either a big default or the time the program is supposed to conclude; then if anything prevents the microcontroller from completing the program the RTC will be a failsafe to shutdown the stations.

    And yeah email alerts could be used for alot of that; but lets just say internet is down/unavailable… or were using it to close the garage door in which case it would be to alert anyone who’s in the garage that the door is about to close.

    #26428

    pc123
    Member

    I did not have the watchdog enabled at the time, but it would not have triggered. I enabled it later it did not trigger when the failure re-appeared.

    The fault behaviour looks like this: The system keeps running, but the filesystem is no longer really accessible. I had an ssh session connected (and it did not disconnect) but on ‘ls’ or ‘sudo’ it can no longer find /bin/ls or /usr/bin/sudo. The watchdog does not trigger though. I guess I can configure it to test the filesystem as well. Will look into that next.

    In the mean time I’m trying to find out if the problem was caused by a bad SD card or if the temperature was just too high. (it is outside in the sun in a metal enclosure)

    anyway, reliable shutoff is pretty important under failure conditions.

    #26429

    nayr
    Participant

    ah yes the device filesystem would have still been available; so the watchdog process would have still been alive and still pinging the timer.
    I doubt you exceeded the operating temperature specs:

    SanDisk SD, SDHC, microSD and microSDHC memory cards are capable of withstanding operating temperatures from -13ยบF to 185ยบF

    I’d assume the card went bad; you can try moving /tmp /var/log /var/run and /var/apt/cache to tmpfs filesystems to lower the amount of writes to flash dramatically. I’d also invest in a quality card; definitely not the cheapest one in town.

    You can configure the watchdog daemon to execute this simple script thats included:

    add to watchdog.conf

    check-binary = /usr/share/doc/watchdog/examples/systemcheck.sh

    execute:

    sudo chmod +x /usr/share/doc/watchdog/examples/systemcheck.sh
    sudo /etc/init.d/watchdog restart

    This would have detected your failure as it could not have opened a new shell when the disk died.. causing the watchdog daemon to hang and miss its heartbeat. I have personally verified that if a valve is open when the watchdog timer triggers a reset the valve will close.

    I’ll try to come up with a sane watchdog config for most of our use cases and document it on the Wiki, perhaps I can write a script that monitors the valve status and if there open for longer than XXX it first tries to shut them down; and if that fails reboot.

    #26430

    Ray
    Keymaster

    @nayr:

    might consider using a BR battery then opposed to a CR; my concern with the battery is temperature range.

    OK, agreed, consideration of temperature range is a good point.

    My Transformer has a ground connection,

    I’ve only seen one transformer (made by RainBird) that has three wires. The majority of transformers I’ve seen use only two wires and I don’t think there is any ground wire (also considering that the secondary coil is isolated from the primary coil).

    I know laptops with usb radios have all sorts of issues until you plug it into the wall and give it a ground..

    OK, I didn’t know about this, but isn’t that a lot of laptop power adapters use two-prong plug?

    PS: I noticed after the fact there’s a 5v header already on my OSbo; how much current of 5v would be safe to a small hub like this: http://www.monoprice.com/Product?c_id=1 … 1&format=2 ? If you could get over 2A of power to a hub it’d open the doors to a whole bunch of USB options/modules.

    The switching circuit on OSPi/OSBo is not designed to provide more than 700 to 800mA of current. The LM2596 chip can, but the inductor / diode should be upgraded to provide more current.

    #26431

    Ray
    Keymaster

    @pc123:

    Is there any solution for that with the existing ospi boards?

    There isn’t a watchdog timer on OSPi currently. This has been brought up in the past, but I think it’s probably best addressed by the internal watchdog timer on the RPi (just noticed nayr gave suggestions on how to properly configure the watchdog timer).

    #26432

    pc123
    Member

    nayr: thanks, I’ll set that up as well. Small correction: I think it is “test-binary” and not “check-binary” in the watchdog config file.

    #26433

    nayr
    Participant


    This is the transformer I use; cost $19 shipped thru amazon prime.
    I got it for the screw terminals, and I like that it can be secured to the outlet w/a screw… plus it has a ground, built in PTC and a nice LED, its an all around winner and I am impressed w/its quality.

    I am probably not the best case but of the 4 laptops I have around me, all different kinds only 1 has a 2prong.. My MacBook and ToughBook and my wife’s old HP Laptop all have a ground, her new work thinkpad however does not.. I believe a vintage 90’s laptop I just tossed out did not have a ground either but that thing didnt have any radios in it at all.

    #26434

    R_W
    Member

    I’m not sure if the Raspberry or Beagle have reliable interrupt driven inputs like the AVR’s. This $4.99 rain gauge has a dry contact reed relay output and a phone jack style connector. I haven’t measured the rain amount per pulse yet. In any case, measured rain total readings would take some of the guess work out of watering time adjustments. http://www.ambientweather.com/amws1180rg.html
    Some photos of the internal mechanism: http://www.philpot.me/weatherinsider.html

    #26435

    Ray
    Keymaster

    @R_W: very interesting. Thanks for the pointer. A while back I was working on reverse engineering a wireless rain gauge (http://www.acurite.com/environment/rain-gauge/acurite-digital-rain-gauge-with-self-emptying-wireless-rain-collector-00875.html) which uses similar reed-based measurement, and it wirelessly transmits 433MHz signals to a display unit. The signal can be easily captured using a 433MHz RF receiver. I was never able to figure out how the signal is encoded. But anyways, it’s good to know the gauge without the wireless part exists and is very inexpensive. Unless if the click frequency is super high, I think it’s possible to just use a GPIO pin to poll the clicks.

    #26436

    R_W
    Member

    Python is not my native language so to speak, but Dan should be able to verify rain gauge type input interrupts in about five minutes with this tutorial and source code for the Pi.
    http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-

    Edit: There does seem to be more than a few open bug tickets for the RPi.GPIO library concerning interrupts. Perhaps a rain gauge is better suited for the AVR on the OSBee.
    http://sourceforge.net/p/raspberry-gpio-python/tickets/search/?q=!status%3AVerified+%26%26+!status%3AInvalid+%26%26+!status%3ADuplicate+%26%26+!status%3ADone+%26%26+!status%3AWontFix+%26%26+!status%3AFixed

    #26437

    rhillman
    Participant

    Suggestions for the next OsPI version in order of interest:

    1. The 74HC595 has a master reset input that looks like it’s not being used right now. Perhaps a watchdog timer IC connected to this such that if the Rpi freezes (doesn’t toggle the watchdog) it would at least reset all the valves to off. Future ext boards could include this reset signal.
    2. Flow sensor input so we can record flow rates of all the valves and know if a leak occurs or valve isn’t working.
    3. Someone else suggested a way in another post to feedback the serial data back to the Pi so we can verify the shifted data and connection to the valves.
    4. current monitoring (could just monitor all the current through all the valves, so you would only need one current sensor). A little trickier with 24VAC.
    5. For the RTC can’t it access the internet to get the latest time/date? (if internet is available?)

    If the rPI stops working (corrupt FLASH etc) is there any way to be notified or do we wait till the plants start looking scary?
    Was thinking about having my droid phone daily ping it and alert if no response detected.

    #26438

    bradl001
    Member

    Hi everyone.

    I don’t have any comments regarding the electronics but I am about to buy one and see v1.4 is going to ship in early May.

    Just wondering what features made it into v1.4 and if that other enclosure is being used. If so, what’s covering the hole?

    Thanks,
    Brad

    #26439

    Ray
    Keymaster

    Hi Brad,

    This upcoming batch of OSPi 1.4 largely follows the prototype seen here:
    http://rayshobby.net/?p=8592
    Because Maker Faire is coming soon, I didn’t have time to introduce new features, so this batch has the same hardware features as 1.3, except 1) it uses the injection molded enclosure, and 2) a microSD to low-profile SD adapter will be included in the kit.

    The hole is currently covered by a sticker. I’ve also ordered laser cut acrylic pieces which can be glued from the back of the hole. That works pretty well and there are different colors I can choose. Hopefully the acrylic covers will be ready by Maker Faire time.

    #26440

    bradl001
    Member

    The current stock is already on back-order. That was fast. ๐Ÿ™‚

    Any thoughts around a time frame for the OSPi with the electrical enhancements noted in the thread and blog postings?

    Cheers,
    Bradley

    #26441

    Ray
    Keymaster

    The last batch of OSPi was all gone shortly after the Maker Faire. A new batch was ordered immediately and there wasn’t time to add new changes. The next hardware revision will probably need to take a couple of months to develop.

    #26442

    bradl001
    Member

    Hi Ray.

    Lately, I haven’t had time to even think about getting an OSPi but now I figured I’d ask if you had any comments on a new revision.

    Perhaps it’s being completely retooled for the RPi B+ or the RPi Compute Module?

    Thanks,
    Brad

    #26443

    Ray
    Keymaster

    Hi Brad,

    I just got my hands on a B+ model and indeed I will have to redesign OSPi to fit B+. I assume the current B model will be discontinued. Since B+ is considerably different from B, it’s unlikely I can design an OSPi that fits both versions. So for a while we will have to offer both versions, until the current B model phases out.

    As you’ve probably noticed, OSPi doesn’t have its own dedicated enclosure — instead it shares the OpenSprinkler injection-molded enclosure. So the enclosure is not fully tailored to RPi. When I met Eben Upton at the Maker Faire last year, he told me specifically not to finalize the enclosure design, as they were in the process of redesigning RPi. I guess B+ is what he was referring to ๐Ÿ™‚

    As to the compute module, I haven’t had time to try out it yet. With it, it’s totally possible to fit everything inside the OS injection-molded enclosure, so OSPi will look just like the Arduino-based OS, expect it runs RPi inside. The compute module is not widely available yet, and it’s unclear to me what would be the final pricing.

    Speaking of that, there are alternative choices: I’ve also just got my hands on the SparkCore and the Electric Imp. I like them quite a lot: they are low-cost ($30 to $40), have built-in WiFi, very small in size, and have excellent web and cloud support. I am very tempted to design an OS-Spark, or OS-Imp, or I think it’s even possible to have one circuit that can fit either of them. The only downside is that they have relatively fewer pins, so an IO expander may be necessary.

    -Ray

    #26444

    bradl001
    Member

    Hi Ray.

    Thanks for the insight on your future efforts.

    Should we assume new hardware designs will target the Raspberry Pi B+ model while the original will not get (major) hardware updates?

    Cheers,
    Brad

Viewing 25 posts - 1 through 25 (of 28 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Comments / Suggestions on OSPi v1.4