npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

imber-remote

v0.0.2

Published

A small module for use with Project Imber. It controls three solenoid valves via an Arduino.

Downloads

5

Readme

Project Imber (remote)

This is the second half of Project Imber that directly interfaces with an arduino to control solenoid valves to turn on and off a home garden sytem. The Raspberry Pi interfaces with the arduino via Johnny-Five.

It uses the DDP protocol to watch a remote Mongo collection for changes (running via a Meteor server) and respond to those changes appropriately. The records have references to which pin they relate to so that this module knows which Arduino output to turn on or off. The act of turning a valve on or off is really simple; it simply applies current to the valve via a solid state relay (which is off by default). When the value receives current then they open and the sprinkler turns on.

The implementation here is very strictly tied to the Mongo app at Project Imber but could probably be extended to do other stuff with a minimal amount of tweaking.

Although this code can be run from any computer that runs node and has an Arduino attached to it, ideally this belongs on a dedicated Raspberry Pi. So the installation instructions below assume this.

##Arduino Setup

My setup has three solenoid valves on pins 10, 11, and 12. The connection map can be changed to any other pin numbers if you want to change which pins direct the valves on the arduino.

Kit:

  • Raspberry Pi
  • USB wifi dongle (optional if you have a nearly ethernet port)
  • Arduino Uno or compatible microcontroller
  • Three solid state relays (I have these)
  • Three solenoid valves (I have these)
  • 12v power adapter
  • Male to female leads

You'll need to setup your SSR's with the default state to 'always off' so that they are only on when the Arduino sends sends a current. Depending on your relays, the leads simply go form the appropriate Arduino port to the appropriate relay pin. The USB goes to the Raspberry Pi and that's about it.

I'd recommend putting your valves in some sort of enclosure away from the electronics and in a manner where, if a hose comes loose or bursts, no electronics are affected. It's happened to me before and isn't nice.

##Installation of the node module

npm install imber-remote

node app.js

##Other notes

If you like you can SSH into your Raspberry Pi, but if your Pi exists soley for your sprinkler system like mine does then having the node module run on startup by default might be something you want to do. You know, so if your power goes out or something then your sprinkler system will automatically restart and start monitoring for changes again without your input. There are plenty of guides on the net for this

You may also want to use something like nodemon or forever to ensure that if your app does crash for whatever reason then it will startup again.