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.
Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts
Wednesday, May 5, 2010
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.
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.
Subscribe to:
Posts (Atom)
