Tag Archives: diy - Page 4

“Spaghetti” IP Cam / Arduino Motion Detect Sprinkler

arduino motion detect sprinkler


After a neighbourhood dog decided my front lawn was a fantastic place to poop on and his owners decided that they don’t care for bylaws I set upon finding a solution. Sure you could try cayenne pepper, mothballs, ammonia or even marking your own territory (take that!) but I already had an IP camera monitoring my front yard for security purposes, so I figured I’d just hook up an Arduino and a sprinkler valve. This yard defense solution has two added benefits, it keeps my lawn healthy (I can set up timed watering through this system) and it sends offending dogs home stinkin’ wet. From me having to shovel dookie off my lawn to negligent owners having to deal with wet dog — perfect.

When the IP camera detects motion in configured regions of its video stream (the rectangles in the screenshot) it triggers one of its General Purpose Input/Output ports (GPIO). The Arduino is listening for this GPIO signal and once its received the Arduino triggers a relay which connects a 24v power supply to the sprinkler solenoid valve. The valve opens when 24v is applied to it and “sprinkles” whatever was responsible for the motion.

The TRENDnet IP camera I employed works great as it already records video of events to network or attached storage, sends email alerts with snapshots and allows manual triggering of its GPIO.

The TRENDnet monitoring plugin only works in IE but after some reverse engineering and C# coding I had an easy to use web interface for all browsers and mobile devices.

If there’s enough interest I’ll post circuit and wiring diagrams. Ensure the valves you get are non-latching 24v solenoids, some 9v valves seem tempting but are magnetic and require a more complex circuit.

Why Spaghetti? Watch more ATHF.

Parts

 
Update: Some folks have asked why not just trigger the valve relay directly from the GPIO on the camera. This could’ve been done, but then I wouldn’t have gotten as much control as I wanted. This way I can configure timing to prevent the sprinkler itself from setting off the motion detector, set up timed watering as well as trigger other devices at various timings (DSLR for reaction shots). Another addition may be an XBee based remote control or hardwired buttons for various functions.

Update: I’ve added a quick circuit diagram and simple Arduino code.

Arduino Code


int gpioPin = 1;       			// GPIO input
int val = 0;           			// value read from GPIO input
int trigPin = 13;      			// solenoid relay output

void setup()
{
	pinMode(trigPin, OUTPUT);
}

void loop()
{
  val = analogRead(gpioPin);		// read the GPIO input pin
  if (val > 500)
  {
	// GPIO triggered, open the valve
	digitalWrite(trigPin, HIGH);
  }
  else
  {
	// GPIO off, close the valve
	digitalWrite(trigPin, LOW);
  }
}

osPID Sous Vide: Open source high tech cooking on a budget

osPID Sous Vide

It seemed inevitable that I’d put together a sous vide immersion cooker, when I came across a post regarding the osPID I knew the time was right. The osPID or Open Source Proportional–Integral–Derivative Controller is a device which can be employed to turn a heater on and off in such a way as to keep the temperature of an environment at a specific level — in this case a container of water used to cook sealed food, or a sous vide.

What I liked about the osPID is that it’s more than just a PID, it’s a platform. Programmable as any Arduino is along with four buttons, a two line LCD display (my favourite white-on-blue style) and limitless expansion possibilities, the osPID can be used in many, many applications — a sound investment I thought, so I invested. Can anyone spot the other PID in the gallery?

Commercial sous vide cookers can be extremely expensive. Creating one yourself is easy, it can be taken apart for storage and you can also salvage parts from it for other projects if need be.

Parts

  • osPID Kit $85.00 (Rocket Scream)
  • Exoterra Repti flo 200 Circulation Pump $10.99 (Pets & Ponds)
  • Milwaukee Type K 49-77-2002 Thermocouple $14.17 (Amazon)
  • Norpro 559 300 Watt Water/Tea/Coffee Heater $7.05 (Amazon, eBay) *Ensure the coils are submersed before powering (plugging-in) or these will fry themselves
  • 12V, Positive Center, A/C Adapter
  • Grounded Extension Cable
  • Coat Hanger
  • Clip

Alternate Parts

Once I had the osPID up and running, thanks to great support from Brett (one half of the dynamic duo responsible for the osPID), I cut the black (hot) wire of the extension cord and attached each stripped end to the relay onboard the osPID. By using an extension cord I can plug any type of heater into the relay, for this project I purchased two Norpro Water/Tea/Coffee Heaters which have a useful clip style base. Because the extension I wired only had one outlet I needed a power bar to plug both heaters in — whether or not you’ll need one will depend on how many heaters you want to use.

I then purchased a K-Type thermocouple (don’t ask me what it means, K-Type is what the osPID supports), removed the connector it came with and connected the positive and negative leads to the thermocouple terminals on the osPID. These terminals are polarized so keep track of positive and negative leads on the thermocouple while working.

That’s it really. I purchase a circulation pump to keep the water moving in the vessel and thus heating evenly. I try to include a coat hanger in every project so I used one to suspend the ziplock full of tenderloin secured with a clip in the sous vide.

Keep in mind the thermocouple will most likely not read the proper temperature until calibrated so just use a thermometer to find the target temperature and set the osPID accordingly. For me an input reading of 57 translated to the 130°F I needed for medium rare, so I set the osPID to maintain an input of 57.

I would’ve preferred a larger bowl and will track one down, but the Beef Tenderloin With Lemon-Parsley Butter I cooked with my favourite gal turned out fantastic and we’re looking forward to more sous vide meals.

Thanks to Brett for the swift support and for the osPID itself.

Update: The Norpro Heaters stopped working on my second cook. This is probably due to the fact that I plugged them in before fully submersing the coils, that being said, many others have had these types of cheap immersion heaters die on them — so I included an alternate upgraded heater for those wishing to avoid the issue. Thankfully since I wired in a cord not the heaters themselves I was able to plug in another heat source for the osPID to control in order to get my dinner cooked.

Update: To replace the Norpro Heaters I picked up a couple of heating elements at a local electronic surplus store (Active Surplus) for $3 each. I snipped and soldered the Norpro power cords to the new heating elements and covered the connections with heat shrink tubing. You can see the final results in the gallery above. These weren’t stainless steel but they work just fine, I bent them to follow the curve of the bowl (which I’ll probably regret when I switch to another container) and to keep them from slipping I fashioned some clips out of, you guessed it, left over coat hanger. They’ll probably short circuit if both solder joints hit the water, heat shrinking or no – be mindful of that if you decide to go this route. I believe these are somewhere around 140 Watts, I needed both to maintain a temperature setting.

Ardunio Wine-O-Meter


The MQ-3 Gas/Alcohol sensor is not accurate enough to use for any serious breathalyzer applications, it also needs to be properly calibrated which is a process I did not undertake. The 25 Shiftbrites are powered by a 4.5volt 500mA adapter, I’ll have to check what I powered the MQ-3 with – but I recall it was the adapter from an old ZIP drive. The LCD and speaker I used are optional for this setup, certainly not required for the test-your-strength breathalyzer. Have fun and drink responsibly. *This device is no where near accurate enough to measure blood/alcohol levels.

When using a separate power supply for the Shiftbrites be sure to bridge the ground lead with the Arduino ground – I’ve forgotten this on two projects now and wasted a bunch of time chasing my tail.

Arduino Sketch, complete with bugs.

YouTube Demo

30 Second iPad Stand

What can’t coat hangers do? I came up with the idea for this stand and made this video to help advertise my ohDisco! iPad app, a quarter of a million views ain’t bad.

Converting the Canon TC-80N3 for use with the Rebel XT (and others)

After having fun with some infrared and macro photography I wanted to try some time lapse. Some cameras have built in intervalometers ( big word for interval timers ) which allow you to do time lapse with little effort. Sadly the Canon Rebel XT does not, so I searched around for solutions, most of which are quite expensive.

I found out some useful information:

  • the Rebel XT has a 2.5mm stereo jack connection for remote operation
  • connecting the ring and base of this jack trigger the autofocus
  • connecting the tip and base of the jack triggers the shutter

With this information I hacked together a makeshift solution with a 12v relay, 12v wall adapter and an X10 appliance module. This system sucked and wasn’t portable, but it was all junk I had laying around. Anyhow, I went back to searching and found out about the TC-80N3, a Canon wired remote which does all sorts of fun timer stuff, including time lapse and goes for under $100 on eBay now and then. Unfortunately it doesn’t work with the Rebel XT, the connector is different, out of the box at least.

I found out that it has three leads on the connector, as the Rebel does, so perhaps they function the same? It seemed to be the case so I went and purchased one, hoping to just swap the connector out.

Once it arrived I went straight to hacking it up. Chopped off the old connector, found out that there are two wires and a ground wire, sweet. With the help of my multimeter I determined that the red wire is the shutter and the white wire is the focus. So, to attach the new connector:

  • solder the red wire to the tip of the 2.5mm jack
  • solder the white wire to the ring of the 2.5mm jack
  • solder the ground to the base of the 2.5mm jack

Slip the cover back on or tape up the connector, whatever, and it’s all done. The Canon TC-80N3 modified to connect to and control a Canon Rebel XT. Doesn’t need much know how at all to pull this off.