Create your own PC moisture sensor via PS2/Gamepad Controller
15.9 years ago electronics, water
Yet another component for “Project Everbearing” where I need the ability to monitor the moisture level of my soil. There are a couple options on how to do this; the classic method is to take two galvanized nails at a fixed distance apart in the soil. If you run electricity through one of the nails, some of the electricity will pass through the other nail depending on the amount of moisture, in much the same way as a variable resistor works. If the soil is completely dry it will have no conductivity (infinite resistance) since low voltage electricity does not pass through dry soil, as water is added the resistance is decreased and with completely drenched soil almost having complete conductivity.
Unfortunately, I did not have any galvanized nails and with our current snow storm I wasn’t going to venture out to the local Home Depot. I did fortunately have something even better, a handheld soil moisture sensor, which I bought when I started gardening before I learned I can see if I need to water by putting my finger in the soil.
With a little manhandling I got the cover off the back and realized that this tool works with the same principle as the galvanized nails with just two wires with provide variable resistance depending on the water content.
[And I thought my soldering was bad]
Now all that is needed was to solder these wires to a couple open points on my PS2 Controller which I am already using as a cheap temperature sensor The great thing about this implementation is the “resistor” has a broad range from no conductivity to nearly zero. Which is great since it gives a very accurate representation of the soil’s water saturation. For the calibration I was a little lazier this time and only took two points “Dry” and “Really Wet” With these measurements I then calculated the water saturation percentage. So now I can see my plants are at a 43% water saturation level, which I have no idea what exactly that means, but I do know I don’t need to water for a few more days.
One warning though since electrical conductivity can be affected by application of fertilizer (especially synthetic fertilizer which may contain sodium) and temperature so accuracy may be around 70-85% but for higher accuracy there are other expensive ($500) alternatives out there but I can live with this for my application.
Tags: cheap, outdoor plants, vegetables
Plants reveal your gardening shortcomings through Twitter
15.9 years ago electronics, water
Botanicalls DIY Plant Twitter Kit is an electronic device you insert into your houseplants and by giving them access to the Internet via Ethernet jack, they kindly praise you when water them and scold you when you are slacking via Twitter for all the world to see. At $99 per unit and require assembly (soldering) might be more cost effective to just let your plants die or at least get watering back into your winter routine. Though I imagine with a PS2 Controller, handful of galvanized nails, some wire, and a little coding someone could put together a cheaper solution. Guess who grew up watching every episode of MacGyver, this sounds like possibly one more project to add to my long list…
Tags: cheap, outdoor plants, vegetables
Control two 120v electrical outlets with your computer
15.9 years ago computer power control, electronics, solid state relay
Here is one more component for "Project Everbearing" which requires the ability to toggle a 120V power source using my PC. Now there are a few interesting applications for this, home automation, music synced Christmas display, or just the nerd factor of being able to say I can turn on my coffee maker from your web enabled phone. Whatever your need, hopefully with these instructions you can do this yourself.
If we had lawyers, they probably would want us to say this:
WARNING: I am not an electrician and do not pretend to be one. I do not know the specific building electrical codes of your area, so please be sure your wiring is completed under the proper safety code for your area. As always, using high voltage electricity can result in self-electrocution or burn down your house if not done safely so if you are not comfortable doing this wiring please contact a qualified professional.
Materials:
- 2 – 20 amp solid state relays (got off eBay for $4.00 each)
- 1 – Outlet box (Home Depot for $2.00)
- 2 – 20 amp outlets (Home Depot for $1.25 each)
- 1 – 2 outlet switch plate (Home Depot for $0.50 each)
- 1 – PC power cable
- 2 – LEDs (optional)
The outlet I am plugging this into is 15 amps, though my use for this project will be considerable under this but best to place for worst case scenario and I would rather trip a circuit breaker than who knows what happens when solid state relays or outlet exceeds their limits. I could have saved a couple dollars and gone with cheaper mechanical relays but solid state will last much longer even with frequent toggling on/off.
Now for the build, this was actually surprisingly easy and took less than an hour from start to finish. I first fed the power cable through and three stands of low voltage wire through access in back. I cut about 6 inches of wire off the end of the power cable. Using the continuity feature of my voltmeter I verified the hot, neutral, and ground, then checked one more time. I attached the neutral and ground in parallel to both outlets. I then connected the hot from the power cord to left side of both SSRs. I then used the 6 inches of wire I cut off to connect from left side of SSR on both and connected a wire from the left side to the corresponding outlet.
Now to add the ability to turn the things off/on using low voltage. I hooked up the wires fed through the back (which will later be hooked up to computer’s parallel port) green to positive SSR #1, red to SSR #2, and black to both grounds. Now with 3-12 volts of power to these connections will activate the SSR and provide power to the outlet. For a little added effect and easy confirmation everything is working (even with the unit unplugged) I also attached corresponding red/green LEDs that match the wires (I am getting old color coding helps) I was doing this hack indoors though first thought was to use my soldering iron to burn a nice little hole into the outlet plate but didn’t want to stink up the house, so risked using a drill instead. As you can see from the pictures I should have gone outside. With a little solder and hot glue everything seemed to be staying together.
With all the wiring completed, I carefully packed everything into the outlet box. The SSR were already pretty snug but I added little but of hot glue in case they feel like shifting around after everything was put back together. Being careful that wires are staying secure and no shorts are being created carefully screw the outlets to the outlet box. Finish it up with a (cracked) outlet plate and the assembly is complete.
Now the scariest part still remains, which is testing, first part is plugging this monster in. If you plug it into the wall and no sparks occur you are in pretty good shape but not in the clear yet. Plug something like a nightlight into your switchable outlet box, should be off now. Using a 9-volt battery connect black to (-) and red to (+) if you didn’t cross your wires anywhere the red LED should come on and appliance plugged in should get power. Now switching to the other side do the same with the green wire and appliance comes on with sparks or fires looks like a successful build.
Tags: cheap, coffee grounds, led, vegetables
Create a cheap PC thermometer with PS2/Gamepad Controller
16 years ago cheap, electronics, PC thermometer
You might be thinking what does this post have to do with vegetable gardening? Bear with me, I don’t have time to do a complete write up on it right now but let’s just say this is a component for “Project Everbearing” I gave my 7-year-old the honors of coming up with the codename, since he is my faithful assistant and cheerleader.
For my current project I need the ability to measure temperature with my PC. Now there are plenty of gadgets out there I could have simply purchased a commercial product for around $40+ and saved myself a lot of time but I really wanted to brush some dust off my soldering iron and try to save some cash, this is the CHEAP vegetable gardener after all.
After a little searching online seemed like a good place to start was to pick up a few thermoresistors which is a special type of resistor which increases resistance as the temperature increases. With no luck at my local RadioShack I picked up a few on EBay for less than $1 a piece.
Now comes the hard part of actually using them, since the computer I was using was old enough it still have an old 15-pin game port I went that route first. This would have been my easiest method of implementation by simply connecting the resistor to pin 1 and pin 3, since analog joysticks work with variable resistance as well. They use what is called a potentiometer which as the user moved the stick to left/right it raises/lowers the resistance. If this would have worked all that I would have needed to do is get the measurement and start calibration. Unfortinately this port was no longer responsive so I have to go with another option
Fortunately I never throw anything electrical out and pulled an old PS2 controller with an USB adapter out of my junk box. Knowing that the analog controllers also work with potentiometers, I found my victim. After removing the screws in the back I started warming up the old soldering iron to completely void the long gone warrantee on the controller. Now all I needed to do was attach two wires connected to the thermoresistors, solder the wires to the point connected to the potentiometer and that is pretty much did it. Given there are two sticks with X and Y axises for both you could have up to 4 temperature sensors (I chose to go with 2) The controller did does have one feature where it automatically turns off the analog control after no use for a couple minutes. After thinking about some more complicated solutions, I went low tech by forcing the L2 button to the on position by applying a piece of electrical tape over it.
I won’t go into the gritty details of the software to actually get the numbers from the joystick since M Harris has already done that so well on his CodeProject writeup.
Last comes calibration, when I purchased the thermoresistors they also included detailed specifications on the tested resistance values at various temperatures, which with a little bit of physics and some fun math, in theory I could have avoided the whole calibration but given the length of wire and/or my sloppy soldering could skew the accuracy of the temperatures I opted for a more manual approach. I put my “thermometer” in a plastic bag along with my trusty $5 digital thermometer and dropped it in an ice cold water bath, while recording the temperature changes as the temperature increased to room temperature. I followed this by doing the same with hot water bath until it lowered to room temperature, recording values as the temperature decreased.
With this data I entered it into Microsoft Excel and got a nice graph (see below) which gave my nice magic formula of:
Temperature = 0.0059(joystick X Axis position) – 138.57
By simply doing the math I now can capture values on my PC.
Tags: cheap, led, vegetables