The Blog

The Update You've Been Waiting For...

The time has come... I'm officially unveiling V2.0 of the MacroDuino webapp and boy is it nice. There's been many updates to the MacroDuino code to support the additional functionality. I've spent many a night testing the code making sure it's stable and trying to reduce the size of it in every way I could think of. What we're left with is this:

  • Send any data to cosm
  • All V1 webapp functionality
  • Ability to remotely change network information on the Arduino
  • Ability to use multiple Arduinos Remotely (router setup required)
  • Ability to display Cosm data on the webapp dashboard (with pretty graphs)

There are 3 new videos that I've uploaded and they've been posted to the MacroDuino project page. I suggest you check them out.

Where to next?

Codewise the only thing that will be changing are minor fixes and small additions like EC support etc. Now it's time to get support for additional sensors (DO, Nitrates etc.) so we can have some real fun. Oh, and LED lighting will be covered soon.

Upgrade To Drupal 7 Complete

Today, I upgrade the site to Drupal 7. It was a long time coming and it's finally happened (mostly because I need some of the functionality in D7 for the webapp). For the most part things should be functioning decently. There are some display issues that I'll have to get sorted out, but for the most part things should work.

New MacroDuino Webapp Coming!

My dream of having a single codebase to run a multitude of Arduino projects is starting to come to fruition. William has made some changes to the code that I need to merge in which should fix compiling problems on Arduino 1.0 and it adds some extra functionality to the LCD library.

The old MacroDuino webapp was kind of cool. I mean you could use any webkit based browser and configure an Arduino on the fly, but the only problem was that the framework that it used (jQTouch) is kind of limited. At the time I made the decision because while the other framework that I was considering (Sencha Touch) was suppose to be open source, they were charging developer licenses for it which rubbed me the wrong way. Well, they've since switched their business model and the framework is completely free and they charge for support.

What does this mean? Well, There is going to be 1 kick ass web app coming up soon. It's going to be based on Sencha Touch and it's going to be beautiful.

You can find the new webapp here: http://www.app.practicalmaker.com/

First up for me is to port the current function of the existing functions of the old webapp and improve the code. Over the next few days I hope to get a skeleton up so you can see what it's going to look like. That means I hope to get the settings and setting macros setup as well as a dashboard.

The settings is going to be rewritten so that it seems like a bonjour type connection. Basically, you just hit 'Scan for Arduinos' and it will scan your local network and list any that it finds.

Than, you'll be able to select which Arduino you want to work with and set macros for it.

The bread and butter is going to be the dashboard where it's going to query the arduino and display information to you. In addition, I'll be baking pachube support in as well (and others as I get into it).

What do I need from you? Well, in the next week or so check out the new webapp (will only work with Chrome or Safari) and give feedback on what you think about it.

Update 1:

The MacroDuino code is also being moved to Arduino 1.0. If you go to update the code please make sure that you update to 1.0 or else you'll probably get weird errors.

What's Coming Down The Pipe?

Wow, it's been awhile since I've posted an update on the status of the MacroDuino project. Lately I've just been putting the code through it's paces because it's important for some of the projects that I have in mind that it be rock stable. The good news is that for most applications it can run rock stable for days, but sometimes it locks up for weird reasons. Usually it's an ethernet related problem so I've been working on making that part of the code more stable.

There are also a couple of new features and ideas that have been percolating in my head. The first is support for the TLC5940 (found in the PWM Shield). Adding support for new chips is a little trickier now because it needs controlling the chip, macros and the webapp will need updating.

The TLC5940 also brings up some limitations. Currently macros are really limited to watchinig 1 input and having an action on an output. Since eeprom space on the Arduino is limited I'm going to add in support for a suggestion someone on the Arduino forum made. The SD card will have the ability to store commands. Eventually you may be able to store macros on it, but I'd have to write another macro parsing function and I haven't quite figured out how to implement that yet.

Storing commands on the SD card is also (hopefully) going to have a little bit of a scripting language. I'm not 100% sure if I can write a parser and have it run on the Arduino, but like most of the MacroDuino code I'm sure it will come together. Right now the idea is you write commands in a text file line by line. Something like this:

200/100
4/9/1
6/9/1
201/100
4/9/0
6/9/0
210

If you've followed the project for awhile you'll know that I changed all commands to integers because it's a lot less memory intensive to use strtok rather than strcmp (one splits the string and the other compares strings). Each line gets passed to the command function and it's interpreted by MacroDuino as a regular command. 200 would be a for loop and 100 would be 100 times. It would set a counter variable and also the line number (to go back to). 4/9/1 and 6/9/1 turn pins 4 and 6 on respectively. Command 201 would be a delay commmand and 100 would be 100 milliseconds. 210 would be the command to go back to line number x and increment the counter.

I haven't quite figured out how to trigger it yet, but it's slowly coming along. I've got big plans for this because I'm going to use this to power my Christmas (with PWM shields) lights this year.

One more update before I sign off. I'm going to start doing a weekly project that I post on Friday of each week. Each project will use MacroDuino code (because it's designed to be 1 sketch to do everything). If you have anything you'd like to see or project suggestions let me know.

Do you have any suggestions or things you'd like to see come to MacroDuino? Let me know! Probably 80% of the features found have been from people making suggestions.

Arduino MacroDuino Webapp Updates 8/19/2011

The latest MacroDuino webapp update brings some much needed UI and usability improvements. If you've seen the webapp in the past you know it looked rather horrendous with many different configuration options and settings. In this update I've gotten rid of all the cruft and replaced it with what I think is a webapp that functions much better.

Here's a list of what's been changed:

  • Controlling outputs now supports pcf8574 and you can give names to pins
  • Macro setting is now moved to a single page and setting macros is much easier
  • setting pinmodes has been moved to settings
  • setting RTC has been moved to settings
  • lcd setup has been moved to settings

You can find the webapp here. You'll need to upload the MacroDuino code to your arduino and you'll need an official ethernet shield (find more info here). And of course a new video demoing all the new changes:

25G Reef Tank Build Part 2

Part 2 of the 25 gallon reef tank build series. The tank has been up and running for a little over a week right now. The live rock has been added and a couple functions have been enabled from the MacroDuino code. The most important I guess is the temperature control. The temperature macro is setup so that if the temperature drops below 80.5F the heater turns on and if it goes above 80.75F the heater turns off.

I had hoped to have more stuff finished after a week in (want to have the tank completely automated by the time I introduce fish), but code updates have slowed me down a little. I wanted to do an update to the webapp to make it more user friendly and also needed to add PCF8574 support to the macroduino code (RTC and DS18B20 macros still don't have that support, but it's coming). Once that support is added in though it opens up a whole new realm of possibilities.

One note about my LED lighting. I'm not sure exactly what's going on (I think the LED's are old, they're from 3 years ago), but they aren't putting out nearly as much light as they should. I guess it's a good enough excuse to buy some more and finish up the CAT4101 driver for them.

I have to say that I'm debating not even including an LCD display on this build. I find myself taking out my phone and using the webapp to check the status.

Oh, and if anyone knows a good place to get 3w or 5w blue,white luxeons for a good price let me know! I'll be needing a bunch soon.

Arduino + Reading PCF8574 Pins as Inputs

A reader contacted me and asked if I would be so kind to put an example up showing you how to use the Arduino Port Expander Shield as digital inputs. I primarily used this as digital outputs before, but after writing the sketch I've got quite a few ideas for new projects (as always). Here's the code you need to read a pcf8574 pin:

 

#include <Wire.h>
#define expander B0111000 //pcf8574 with all address pins grounded
/* see <a href="http://www.practicalmaker.com/tutorials/port-expander-shield-documentation
for">http://www.practicalmaker.com/tutorials/port-expander-shield-documentati...</a> more info on configuring a pcf8574.
 
That article will also give you sample code as to how to toggle pcf8574 pins on
and off.
 
on the port expander shield the top row of pins is the one which you use to test statuses
 
*/
 
void setup() {
  Wire.begin();
  Serial.begin(9600);
  expanderWrite(B11111111);
  pinMode(13, OUTPUT);
}
 
void loop() {
  byte pin_number = 0; //check status of pin 0
 
  /* querying the pcf8574 returns a byte. each bit is the current status of each of
  the 8 pins. 0 = low, 1 = high */
  byte returnByte = expanderRead();
 
  // we can use a funciton called bitread to get the status of any bit in the byte
  // pin number starts at 0
  boolean bitStatus = bitRead(returnByte, pin_number);
 
  if(bitStatus == 1) {
    digitalWrite(13, HIGH);
  } else {
    digitalWrite(13, LOW);
  }
 
  Serial.println(bitStatus, BIN);
 
  delay(500);
}
 
void expanderWrite(byte _data ) {
  Wire.beginTransmission(expander);
  Wire.send(_data);
  Wire.endTransmission();
}
 
byte expanderRead() {
  byte _data;
  Wire.requestFrom(expander, 1);
  if(Wire.available()) {
    _data = Wire.receive();
  }
  return _data;
}

And of course it wouldn't be complete without a demo video:

MacroDuino Webapp Updates

The latest update for the MacroDuino webapp fixes a couple things and adds support to control pcf8574 pins. When I first made the webapp it was more of a proof of concept and didn't really look or function all that great. I'm starting to do a complete UI overhaul to the app and the first change was in the control of outputs.

The digital control link has been replaced with a link that says control. This page allows you to add pins that you want to control (along with a name to help you remember what it does). This single interface allows you to control either digital or pcf8574 outputs.

If you need to change a digital pin to an output that has been moved to the settings page.

Here's the video you've been waiting for which demos the webapp controlling an arduino.

8/11/2011 Newsletter

I have some more exciting news regarding the aquarium controller. I've started a new build and will be documenting the entire process (with videos). The tank was setup a couple days ago and I've got the heater hooked up and temperature controlled.

I've re-written the aquarium controller page so you can more easily follow any updates:

http://www.practicalmaker.com/projects/arduarium-controller

As each function gets completed I'll be posting a writeup so you can implement that function yourself. Check out the 'Control heater on/off based on temperature (writeup here)' for an example.

The MacroDuino code also received an important update which added support for pcf8574's. This means you can use a port expander shield and add up to 64 additional digital pins that can be controlled.

The pcf8574 code is also tightly integrated with the macros. What this means is that any macro that you use can use pcf8574's as outputs which greatly increases the capability of the controller.

The road ahead includes some very interesting things. The webapp is going to be updated to be a bit more user friendly. What's up right now was a bit more than a proof of concept and over the next few weeks I hope to get it updated to a final fully functional version (including new macroduino functions).

In addition to that, the MacroDuino code is going to be getting some more updates as well. The biggest one will be the ability to store macros on an SD card. I haven't started on this yet, but hope it will be easy to implement. If I can it means that the number of macros you can store will be way more than you'd ever need.

If I can get the macros stored on an SD card than I'll be decreasing the number of macros stored in eeprom and using that freed space to store data such as ATO last run time and other logged data that could be displayed on an lcd.

I think that's pretty much everything. It'll be really fun to see the new tank take shape (lots of pictures I promise).

Pages