Intellectual Property
After much consideration I came to the conclusion that I would probably not profit from manufacturing my incubator. After having learnt so much from others work, and having much apreciation from open source material, I dectited to license my incubator under a creative commons license. That way, if anyone else thinks this idea could benefit their own environment, they can freely adapt it.
Getting the control system up to speed. I wanted to try and cut corners and use PCB's that I had already milled out and worked a bit with. When I was researching the DHT sensor and its libraries I found a problem that all the libraries found for the DHT sensor were way too big for the AT 45. It took me a while until I found a library that was small enough/modifiable to the point of being able to use it. I have some C background but nowhere near enough to take on the project of making one myself, or even doing it in fullfledged C, so I used the arduino environment.
I tried uploading several programs to it, such as idDHT-master, simple DHT, Adafruit DHT unified etc. They were all too big so I needed something more elementary and something that didin't include all the DHT sensor family, just the DHT 11 sensor. Eventually I came across this library on the arduino playground forum. It works, but the example that I used to modify the code included float variables and that needed to be changed to integers. Then it fits for the ATtiny 45.
Arduino code I used for the DHT PCB.Now I wanted to try and use communication protocols and have an output device and a network. My ethernet module took a while to figgure out since I had screwed a few things up so I decited to last minute change the project and just use the motorshield to drive a fan in case things were getting too humid or too warm.
I knew I had gotten it to work in the outputs week but I hadnt worked with it since. I used a 12v variable powersupply that I put on 6v while I was testing a few things out, besides, I knew the motor that I was working with would function down to 5v. But nothing worked, I thought maybe the h-bridges were screwed because there was a constant feed of 6v from the h-bridge pins. I uploaded several programs to test it out and all of them gave me wierd results. After about 6 hours of using the multimeter and the oscilloscope, changing out the h-bridges, uploading various debugging programs, researching online, reading the datasheet thourogly... I finally found out that the h-bridges don't work if the power variation between Vcc and Vref is not greater than x V. So by getting 5v from the microcontroller and 6v from the powersupply, it went into another trouth table and I got false readings. Yay.
I now wanted the motorshield and the temperature shield to chat. I didint anticipate this since I wasnt really thinking about networking at the time of making these pcb's. I was able to communicate with both the temperature sensor and the motorshield through rx and tx on the 6 pin header line, but my problem was that on one of the boards, mosi was occupied, and on the other clock was ocupied. So I needed to make a cable/a board and switch the respective lines so the temperature sensor's clock line could talk to the motorshields mosi line. Fun when you add a level of unnessecary comlication. I managed to talk to the temperature sensor through the computer and send me 1's when the temperature was above a certain degree and nothing when it was below - the idea being that when the motorshield would get a 1 it would run a fan for a few seconds and then read again to see if the temperature sensor was sensing something too high. Then I managed to send 1's through my computer to the motorshield and that worked, but connecting the two and nothing happened...
Keep on working the control system. I finally got something to work, but not fully. It needs some aditional tinkering with, but for show purpouses its fine. I found myself an old computerfan to connect to the incubator. I made plexiglas mount for it on the incubator it self, made cases for all the PCB's.