One of the first steps in setting up an aquarium or aquaponics system is proper control of the water temperature. Using a couple shields, a relay and a ds18b20 temperature sensor you can be up and running in less than 15 minutes. In the following video I show you exactly how to hook everything up.
*update* I must've been a little tired when I shot the video. You can do a continuity test from the small side of the plug which is the hot side and use that. Don't get electrocuted doing it the way I did!*
A couple notes:
In the macro pcf8574_device #0 is the one with all the pins grounded. Look in the sketch to figure out which address yours is (they're an array of addresses)
If you want to use celsius change #define CELSIUS to 1
Make sure you have the latest code (link on the project page)
Make sure you've enabled relevant parts of the code (the #define statements in MacroDuino.pde). Ones you should enable are: SERIALINTERFACEON, ONEWIREENABLED, DS18B20ENABLED, PCF8574ENABLED, MACROSENABLED. To enable them just change them to a 1 instead of 0.
MacroDuino Commands:
Run them in this order
13 (discover 1wire devices)
15/0 (verify it's the probe you want to use)
5/TEMP/4/0/1/81/75/254/1/0/0 (if temp is less than 81.75 turn pcf8574 device 0 to on... check docs for full explanation)
5/TEMP/4/0/2/81/75/254/0/0/0 (if temp is greater than 81.75 turn pcf8574 device 0 to off... check docs for full detail)
This is the first practical application of the MacroDuino code and I really think it lives up to what it was supposed to do... no coding, but still able to configure it to do useful things. The recent code update leaves 1kb of free space with everything enabled so there's quite a bit that can still be done. Of course, I'll continue optimizing the code so hopefully I can free up a couple more kb of space (weather and moon cycle here we come!).
The MacroDuino just received it's first major code update. This update brings space reduction as well as macro support for PCF8574's (which are used on the port expander shield). Currently the macro's that support the PCF8574 as outputs are digital, analog and ds18b20 with support for RTC macros coming soon. Here's a quick video showing you how everything is working.
There's lots of good news happening at Practical Maker! We moved to a new server this week which will help with our growing pains. Hopefully everything will be a bit faster now. It's been quiet post wise on the website because I've been working on getting everything together for a new tank build where I can document everything from initian setup all the way to a fully automated tank that reports to pachube and is controlled via a web interface.
I actually haven't had a tank for the past 8 months (we moved). The old 75 gallon one was simply too much of a pain to move so I had to get rid of it. I spent quite a bit of time trying to figure out a setup that will be somewhat easy to move again (because we'll be getting a house sometime in the future). I settled on a 25 gallon tall tank (same dimensions as a 20 gallon, but taller).
As of this moment nothing has been done in the way of automation which means you'll get to see how everything is done. All that's setup right now is the sump, circulation system and it's been filled with water (3 days for the RO filter!).
You can checkout a little video I made where I discuss my plans and you can see that there's really nothing hooked up yet here:
I've also figured out a way for anybody wanting to follow progress to do so easily. I'll be tagging posts with 25 gallon build and clicking on the link will list all the posts tagged with that. I'm actually going to be doing this with all the posts from now on so it's going to be much easier to find the information you're looking for.
Next steps with the tank are to get some live rock into it and hookup the heater to the controller. That video should be going up tomorrow. In it I'll show you how to hook up the temperature sensor, how to wire the relay and how to setup the macro.
Success! What I thought was going to take a couple days to implement got done in 6 hours! You can now use the MacroDuino code and talk with pachube (with ~300 bytes to spare).
Originally I had said that I wanted to have zero programming required to run this... I lied. You do have to do a little programming (a couple lines is all) in order to setup your pachube feed, but I'll be doing a write and videos showing you how to set that up.
You can send the following data to pachube: digitalRead, analogRead, pH and temperature readings. There's also a very cool unintended (seriously) side effect.
I didn't know that pachube had triggers that can act on data received. Since the MacroDuino code does work online (dyndns + forward a port on your router to your arduino port 80) you can actually use pachube triggers. This opens up a whole new can of worms in terms of what you can do.
A couple examples:
Lets say you run out of macros. You can store mission critical macros on the arduino (ie. controlling pH) and use pachube triggers for less mission critical ones. You could even not use macros and just use pachube triggers (if you trust your internet connection enough... I don't).
Let's say you want to be notified when values go out of range. I'm hoping to setup a url that will send an email or text to you if values go outside your specified range.
The second demo of the MacroDuino webapp is here. Among the improvements are: naming macros instead of numbers, ability to list and delete macros. Another big plus is that this will also work over the internet! (you'll need to forward a port on your router to port 80 of the arduino. All in all an excellent update that I'm thinking will become version 1.0. Here's the video of the webapp:
Apologies for not posting too much up on the website lately, but I've been finishing up the MacroDuino code. There's some pretty cool stuff featured in the video.
I can't believe how long this took to make! I guess I was a little naive to think I would be able to finish something that would work with multiple communication interfaces (serial, ethernet etc.) reliably in 2 weeks. That being said, 6 rewrites and an untold number of hours later a beautful piece of code has emerged.
What we have now is a piece of code that is dynamic. By simply changing a couple values in the sketch you can enable and disable different parts of the code. The idea here is to build 'drivers' (closest thing I can think of) that will drive different devices that you hook up to your arduino. Want to drive an ethernet shield + some ds18b20 temp sensors? No problem, just enable those modules and upload. The beauty is that I can eventually support a ton of devices and enabling them all would make the code more than 30kb, but you disable everything except for what you're using and the sketch magically fits (provided you don't enable too much).
For those of us who hate typing commands in a serial terminal (which I do) I've designed a neat little webapp. There's a really long description of all the functions it has in the video (it's really cool). Although there is only support for ethernet (official shield) right now, I plan on adding in support for other ethernet shields as well as things like wifi and even GSM (remote monitoring and on the fly setup anyone?).
The video does a much better job of showcasing the capabilities than I can here so I suggest you watch it fully. I will however, hint at some ideas I've had in the past couple of days.
I mentioned earlier that I really want to support more interfaces like wifi, GSM and even XBEE's. The nice thing is integrating these is going to be a piece of cake (<50 lines of code). As money permits I will add support for these in.
The other thing that is missing is data logging. I know pachtube and twitter support would be awesome and I plan on adding it in and letting you configure it via the webapp (or whatever interface you choose). For me, pachtube support would be the missing link. You could have the arduino log data and access it via the webapp and do whatever you want with it!
I guess that's enough torture for now. Below is the video of the MacroDuino code and webapp in action. Enjoy! Let me know what you think!
The ethernet interface for the MacroDuino code is coming to life! I've made a small little demo video showing the webapp (which is hosted on my iphone) controlling the arduino over the local network. Eventually, remote access (read only I think) is going to be added. It's a great proof of concept and demos what you can expect to see as the code progresses.
For those wanting to see the webapp point your browser to http://practicalmaker.com/app/macroduino. It won't do much for you yet, but in a couple of days you should be able to use it (webkit browsers only for now).
Who would have thought that there is so much work involved with making code more manageable? For quite some time now I've been wanting to put all the sketches and code that I've done up on github. This will make it much more accessible and easier for me to manage. Plus, in the future if there are interested developers they could be given access to commit changes.
Well, today that's a reality. I've moved over the MacroDuino code over to GitHub (check it out here). This means that instead of me needing to upload new versions of everything (which I'm not good at keeping up with, you can simply check the repository to see if there are any updates. I think this will make pushing out new code to you guys that much easier.
As for the MacroDuino code, I've got a wonderful update. After taking a couple days to figure out exactly how to implement it I was alerted in my RSS reader about a neat project called RESTduino. It seemed like a perfect base to start the ethernet controller interface. With this code I should be able to get a webapp up and running to be able to demo to you guys shortly. The nice part is you'll be able to download it as soon as I'm done from github!
There are a couple other updates as well. There will most likely be an AC board available sometime this month. It will be I2C based. To start I'm thinking of offering two varieties: a mechanical version and (possibly) an SSR version. The problem with the SSR version from what I read is that it's not that great for very low power loads as they 'stick' on.
I'm just about finished designing the enclosure (which will be available as a download you can get made at ponoko) for the Arduarium Controller. There are a couple bugs that need to be ironed out first (ie. how to hold it together).
For those who are following I just wanted to give a status update. This isn't an easy update for me to write simply because I've had to make some very hard choices in the last few days. Most of them are due to financials being strung a little bit too tight and the return simply isn't coming back on time and money.
First, the good news. The Arduarium Controller is fully designed and ready to go. Still waiting on some backordered Arduino Headers, but they are fully assembled and ready to rock. The MacroDuino code that's been written to run the controller is pretty great. There's already been some great feedback about additional features to add. Add to that the fact the my Ethernet shield finally came in that means it's time to take the controller to remote monitoring and controlling.
Now for the bad news. Despite my best efforts to develop an EC circuit that is reliable there's still no luck. The problem lies in the fact that you basically need a scope to set the darn thing up and you can't really leave it in the tank. It always needs re-calibration and simply isn't stable so it is being tabled. If anyone is interested I can post the schematics up.
I will also not be selling any enclosures for the Controller nor will I be making an AC board. It's not all bad though because I am designing an enclosure and you can get it printed up at ponoko. At the moment I simply can't afford to design and print enough volume to be able to sell it at a profit.
As for the AC board, the solution I've come up with is to simply use an PCF8574 breakout hooked up to a relay board. There will be an enclosure designed for that as well.
For those that think the project is dead fear not. I've simply had to make some decisions about what I will support and what I won't be supporting. Few realize how much time and money goes into designing something from the ground up. With the recent Arduarium Board release I had to buy a whole bunch of stock which simply isn't selling as well as I thought it might. It's put me in a position where I have to choose either to shut it down or cut it back to something more manageable.
Before I sign off I want to let everyone know that the Ethernet portion of the code is coming along quite nicely. Expect a web app demo sometime soon.
I have exciting news for everyone. For many of you who started following my work oh so long ago (2+ years now!) you know that I started this website as a hobby. During that time I was off and on again with other projects although my love of electronics kept me coming back. There was a couple times when I almost gave up, but the people who emailed for my help kept me going through the tough times. Now I'm happy to announce....
PracticalMaker.com is my full time job! If you asked me 2 years ago I would have said that it was a pipe dream. There were already several large players in the open source electronics world and who thought I could take them on??? Certainly not me. That was before I realized that my unique take on shield design and programming was different than pretty much everyone else... and people loved what I was doing.
Moving forward my core vision remains the same... make electronics for the people that are user configurable. Of course, I always build to solve a problem I want solved first, but that user configurable part is soo nice to have (ie. BNC Sensor shield lets you select which analog pin and which CS pin to use). For those who have supported me in the past (and those who will support me in the future) I say thank you!!!! I'm honored that my solution to my problem also fixes your problem as well.
All that aside, there's a huge update. The I2C HD44780 LCD/Keypad Backpack is now available as a PCB or Assembled. You can find the full documentation here (including the Arduino library and sample code).
I've been using it with the USB hookup (though there are headers for jumper wire hookup) and it's the nicest thing I've used in awhile. There's nothing quite like modifying a USB cable and plugging it in and everything just works.
Arduarium Controller Basic
The Basic boards are in, assembled and everything works! The first batch will be going on sale as soon as the double high headers come in (they were on backorder). If you're interested sign up for the newsletter as they will be the first to be notified when the boards are available (hopefully sometime next week).
Here's a video to give you some idea of what's been going on
MacroDuino Code
It's amazing what you can accomplish in 3 full days of coding. The MacroDuino code now supports multiple DS18B20 sensors and you can setup macros based on temperature readings. There is support for 9 temperature sensors and you can display 3 different temperatures on an LCD screen.
The Serial Control module for the code is almost finsihed (it's a bit embarassing to release the code as it is so I'm going to clean it up before releasing it).
For those just learning about the code think of it as a little operating system for the arduino. You have your control interfaces (which can be serial, ethernet, etc.) which control the control and macro functions.
Here's a small list of the things you can now do:
Set a digital pin to change state based on a reading (digital, analog, RTC or DS18B20)
Find 1Wire devices using a single command (addresses stored in eeprom so you can poll them by number)
Display time, temperatures and pH on an LCD screen (you can turn on and off any of the elements as well as change their position all through serial commands ... ethernet control is coming soon)
Hook up multiple 1Wire sensors and be able to query individual ones (addresses stored in eeprom so you just say... give me temp of sensor 1)
Control the RTC (setting time, printing time etc.)
Hook up the I2C HD44780 LCD/Keypad Backpack and print to it
That's just a small sampling (go to Projects -> MacroDuino Code to look at all you can do). Here's the most important part... this program is 40kb and yet I can still get it to fit on an Arduino with an Atmega 328.
The reason we can do that is because you don't actually need all the functions so you can turn them off and on by just changing variables at the top of the code. So, if you want to have serial control, ds18b20 and a ds1307 you just enable those parts of the code and turn off the rest which trims the code down to 20kb or so.
The best part is I'm just getting started with this code. Next up is integrating a PCF8574 port expander. That means you'll be able to use time, analog or digital readings and temperature to control each individual output of the port expander... and you can set it up via whatever communication protocol you want (serial and ethernet are being worked on at the moment).