Search This Blog

Wednesday, May 5, 2010

First Data

So...it's almost been a month since my last post.  Too bad I haven't done a month's worth of work on this project. I recently found my soldering iron.  And that means I could hook up the sensors I have and get them working.  It didn't take long.  I spent some time looking over data sheets and looking through the Arduino forum to figure out how to properly hook up the sensor and write the program.  Although I have no way to confirm the output I am getting, the data taken from some testing I did appears to be consistent with what I expected.

The first sensor I have is a HIH-4030 Humidity Sensor.  This sensor is analog, which makes it very simple to extract data.  The tricky part is computing the correct humidity from the raw data.  From the data sheet, the raw analog signal has to be converted to a "sensor" relative humidity.  Then this value has to be corrected depending on the temperature.

The temperature is read from a TMP102 digital sensor.  This sensor communicates using a two-wire system and allows multiple sensors to be connected to the same two wires.  This two-wire system, called I2C, makes the communication more complicated, but there is an Arduino library that makes it almost as simple as reading an analog sensor.  This sensor has different wiring schemes to address them separately.  I read the data sheet to determine which address I wanted to make the sensor respond.  Then it was a matter of calling the specific address in my code, then the sensor responds with the temperature.  Easy as pie.

Enough talk, more doing.  DATA!!!!!  I made some cool charts. This first chart shows the overnight living room data. Fairly constant temperature and humidity.  The spike in humidity towards the end is from my morning shower.


The following chart is data taken from a full day inside of Mojo's habitat.  The red data is from the warm side of the habitat and the blue is from the cool side. The heating lamp was turned on at 7 AM and off at 10 PM. The small drop in temperature around midnight on the cool side could be explained through a number of means.  I found the sensor not laying in same place that I had placed them, meaning Mojo moved them.  Or the air conditioning came on at that time and caused the drop, which wouldn't have been seen on the warm side because it is controlled more strongly through the heating pad.  From this data, I have determined that I do need to create more distinct cool and warm sides.  The temperature differences are not great enough for the habitat.

This chart shows the relative humidity during the current normal cycle for both the hot and cool sides of the habitat.  I sprayed the habitat at 7 AM and again at 10 PM.  This is the area that I knew beforehand that needed to be better controlled.  This fact is very obvious from the data.  Once the project is finished, the humidity will never drop below 60% on either side.  But I do have a humid box with wet paper towels inside for Mojo to use when he is shedding, which he does crawl into whenever he likes to soak up some extra moisture.


That's all for now.  Until next time, continue being creative.

Wednesday, April 7, 2010

Budget

I know it has been a while since my last update.  I believe I have underestimated the time requirements of a full time job while looking for a job.  I also picked up another hobby recently, rock climbing.  But all of that has nothing to do with my snake.

I have taken the short time available and worked up a budget table for this project.  And just like any engineering project, I am over budget and behind schedule.  I knew that I would not be able to build a prototype cheaply.  And I think I will be on budget for a production system.  Take a look for yourself:



Item Unit Cost # of Units Total
Arduino 29.95 2 59.90
HIH-4030 Humidity Sensor 16.95 1 16.95
TMP102 Temperature Sensor 5.95 1 5.95
2 Gallon Round Up Tank Sprayer 19.97 1 19.97
Sprinkler Solenoid 14.97 1 14.97
Proto Shield 12.5 1 12.5
Breadboard Wire Kit 5.99 1 5.99
Transistor 2N2222 (15-pack) 2.59 1 2.59
Diode 1N4004 (2-pack) 0.99 2 1.98
5V 1 Amp Relay 4.69 2 9.38
Universal Breadboard 8.99 1 8.99
1K-Ohm resistors (5-pack) 0.99 1 0.99
9V Battery clip (5-pack) 1.99 1 1.99
PCB Screw Terminals (4-pack 1.99 1 1.99
Project Box 3.69 1 3.69
Electrical Receptacle 0.59 1 0.59


For a grand total of: $168.42

I had to buy a second Arduino because I fried the first one.  I hate electronics.  On that note, I still haven't solved the solenoid issue.  I actually haven't even worked on it, but that doesn't change the result.  Today, I purchased the last of the necessary  equipment to get the daylight automated, which will be helpful for when I have to leave before the wife gets up so she doesn't have to remember to turn on the light. I plan the have this up and running this weekend.  Until next time, continue being creative.

Wednesday, March 24, 2010

Week 3 and 4 Update

So it's been a little while since my last update.  I've done some work though.  I received my sensors in the mail last week and bought most of the electronic components necessary for the project.  I built up the control circuit for the light, heating pad, and solenoid on a small breadboard.  I've got the circuit working, but have only tested it on an LED.  The picture below is the first go around and I believe it's wrong, but I doubt anyone would have noticed. Click the picture to see the rest.


As for the solenoid, I'm still having trouble figuring out what voltage to send it to get it to operate.  I get the feeling this will be the choke point in this project.

I have finally located some mister nozzles that I feel confident in purchasing.  They are 0.5 gallons/hour mister nozzles intended for outdoor patio cooling.  They connect to 1/4" flexible tubing which is really cheap.  To affix the tubing to my solenoid valve, I'll use an off the shelf adapter from Garden Hose Thread(GHT) to 1/4" barb adapter.  I have found the female GHT adapter, but can't find a male version.

In the short future, I plan to make a cost table.  I'll make two of these, one for the prototype build costs, and the other for production build costs.  The prototype cost table will include everything bought for this project, while the production cost table will only include parts used in the final build and will be a better measure of the cost for anyone that wants to duplicate my work.

Until next time, continue being creative.

Sunday, March 14, 2010

Week 2 Update

I haven't done much to show since my last post. I've done a ton of brushing up on my electronics knowledge. Everything including voltage regulators, diodes, resistors, transistors, and relays. I even opened up the automatic watering system valve to confirm what I thought the insides would look like.


Just a simple DC solenoid, although I didn't expect exposed wire. I still need to figure out what voltage and current to send to it. Another mystery to be solved.  On a different note, I just looked at this picture on the computer and realized that I need to remember to use the manual focus on the camera when taking these pictures.  It's sorta blurry.

On another note, I ordered a temperature and humidity sensor. These should come in the mail sometime this week. That's all for now.

Tuesday, March 9, 2010

New Stuff


Yesterday I stopped by Lowe's after work and picked up some new toys. I bought a 2-gallon pump sprayer, an electronic valve, and a 6 ft. garden hose. The only part of the pump sprayer I'll be using is the tank and hand pump, so if anyone wants a new wand for their sprayer, maybe we can cut a deal. I spent a little time playing around with it last night, doing some "testing." I filled up the sprayer, pumped it until it would pump no more, and sprayed Mojo's cage to see how long it would take to get a proper soaking. Surprisingly, only about 3 seconds. Then I took the sprayer to the tub to see how long it could sustain a spray. I got bored of counting at around 360 seconds and decided that was plenty. So, in use, the sprayer will last 120 sprays at 3 seconds each every 4 hours. That's about 3 weeks on one charge. I was only planning on this setup lasting for a weekend without having to pump it. This is added reassurance that my pet will be properly cared for whenever I leave for a few days.

The electronic valve is just one that goes with a automatic lawn watering controller. It has a male and female hose threads and a cord, which I assume just plugs into the controller. The only problem is it didn't come with any documentation, so I don't really know what kind of power to feed it to get it to switch. At first, I thought it might take 24V just like most of the solenoid I've seen around, but after doing some research on the brand, I found out that the controller runs off 3 AA batteries. At most, this could provide only 4.5V. The Arduino has a 5V output, lucky for me. But I have a sneaky suspicion that the current requirements for the solenoid will be more than the Arduino can provide. The contacts on the valve are buried inside an environmental plug, which I'm assuming keeps the water out. I'll be trying to solve this problem for the rest of the week.

I'm taking the garden hose back. Yeah, it nicely hooks up to the valve, but nowhere else. Not the tank and not the misting nozzles I plan on getting. End of that.

If you don't know where this project is heading, take a look at this similar project: http://www.trix.com/binx/mister/
This is where I got my inspiration to build my own system.

Sunday, March 7, 2010

Week 1 Update

So I figured it be easiest to write these things after a weekend of working on this project. Mainly because I will be doing most of the work on the weekend and I can write these with the project fresh on my mind.

Progress since my last post:

I have acquired any more hardware, but after doing some software coding and research, I have found a flaw in code. According to the manufacturer of the processor onboard the Arduino, the processor's internal hard drive(only 1kb available) is reliable to only 100,000 erase/write cycles. I was planning on using this storage to keep track of the time, writing to it every minute. This means that the address I would be writing the data to could become unreliable after approximately 70 days. Therefore, I have been researching ways to fix this problem. I am thinking that I can monitor the power source, and when it goes off, then write the time to the hard drive. Hopefully this can be done using the power left in the capacitors onboard the Arduino. If not, I may have to get a larger capacitor to power the board until the writes can be performed.

Enough of the pitfalls, back to the progress. I have finished the code to set up the time, initialize the day/night cycle, and continue the day/night cycle after the initial cycle. I have also started coding the control of the solenoid for the water sprayer. While coding this control structure, I have had to keep in mind that later in the project, I will be using a sensor as input to this control, but for now the control is a simple interval, every 2 hours. This means that every 2 hours, the solenoid will fire, allowing water to flow through the spray nozzles. Later, when I have a hygrometer, if the sensor falls below a set value, only then will the solenoid fire.

That is the update this week. I hope everyone has a good week. Sorry, no pictures on this one as all I've done is coding.

Wednesday, March 3, 2010

Description of the Problem/Solution

My pet ball python, Mojo, lives comfortably inside a handmade wooden cage. Inside the cage is three hiding spots, a water bowl, a log, and various small rocks. The heat is provided by a heat pad under the sub-floor and basking light. I switch the basking light off every night and back on every morning. Humidity is supplied by the water bowl and a spray bottle that I try to use twice a day. I had two thermometer/hygrometer sensors, one on each side of the cage to monitor the hot and cold ends. A couple of weeks ago, the batteries in both of the sensors died. In part to my laziness and in part to my confidence that I could maintain proper conditions for a ball python, I have yet to buy replacements.

This led me to think of a better way to control the environment inside the cage. At first, I just wanted to be able to spray/mist every so often. This led me to many commercial systems available for pet reptile care. These systems provide few settings to change how often and how much spray is released. I would also like an intelligent systems. Why spray when it is not necessary? I wanted to be able to spray according to the humidity level. The first thing that came to mind was the Arduino microcontroller, which I had seen many times during my daily web-surfing on the Hackaday website. If you enjoy playing around with electronics, I suggest you take a look at this site. I now plan to use this microcontroller to make the environment completely autonomous. It will measure temperature, humidity, and time, and make the appropriate adjustments. For now, due to budgetary confinements, I will use the Arduino to control the day/night cycle and spray on a predetermined schedule. I will later update the system to full autonomy when the funds are present.

Wow, this is a long one. I hope to keep these shorter in the future, but I wanted everyone(although I'm sure there won't be that many) to be up to date on this project. I plan to update once a week until finished and include cool pictures along the way. The project has just begun as I just received the Arduino in the mail yesterday. I will be working on programming until I obtain more materials. I hope you enjoy reading about this project. Good night.