You are currently browsing the mcp tag archives.

MCP Update

Posted 2012.03.18 14.35 in Computers/Internet/Technology

It seems like every other day I’ve been tinkering further with my Master Control Project. Since I last blobbed about it, there have been a number of revisions and modifications.

First, I ran into all kinds of crashy problems which I traced back to the String object class. What worked perfectly under the older Arduino IDE no longer worked properly under version 1.0 – specifically it appeared that String objects were gobbling up dynamic memory until there was a stack heap collision and it would sieze up till I rebooted it. Very frustrating.

So the solution was to rip all the Strings out and use fixed char arrays. It only took about an evening to rewrite all that, and the end result was a surprising 5kB savings in the final compiled sketch size.

Along with all that, I made some changes to how tweets were sent, streamlined the content, and cut it back to one status tweet per hour. I’m still having some problems with tweeting – the Arduino Twitter library sends tweets through a 3rd-party host and sometimes that is inaccessable or non-responsive, but I’ve made the tweet function non-blocking so if a tweet does fail it won’t jam up the rest of the works – nor will it hang while waiting for a response from the 3rd-party server.

Hardware wise, I have made some more changes. I moved the Chronodot off of the back of the GLCD and mounted it on the Mega Proto board. It didn’t make sense being on the GLCD since it has nothing to do with that, and being on the Proto board means it’s more self-contained. It also let me use the temperature sensor in the Chronodot to get a feel for the temperature of the MCP’s main Arduino board. Which led to…

The Arduino was running quite hot. It was consistently around 120°F which is almost too hot to touch. This is because it’s got a lot of stuff going on, drawing a fair bit of current. It draws too much to power it from the USB port, so I had a regulated 9vdc supply going into it. That however meant the linear regulator in the Mega was turning the extra 4v into heat, adding to the problem.

So I got a descrete efficient DC-DC converter and wired that to my desk’s dc supply (13vdc for ham radio gear). I modified the Mega so it would accept a regulated 5vdc source without any further adjustments, and that has allowed the board to run cooler – down to about 100°F. (Though the DC-DC converter isn’t exactly calibrated, it’s about 300mV high. Shouldn’t be a problem though.)

Log Tape

The newest hardware upgrade was the addition of an Adafruit Thermal receipt printer. The idea here is to be able to get hard-copy logging of things, and printing out messages. Right now there’s two things that get printed regularily – first, every time it sends a status tweet, it also prints the current radiation level along with a timestamp.

And second, based on the Adafruit Internet of Things Printer, it checks with Twitter and prints out any tweets that are addressed to it or to myself. Twice per hour it accesses the twitter search api then prints out any new tweets. (It is throttled so if there’s a lot of traffic, it won’t go crazy.)

One last software “upgrade” was that the Arduino sketch was getting rather large – it was pushing 2,000 lines, and it was getting harder to find specific lines when working on it. So I broke it apart into separate files, so similar functions and routines are grouped together. Hopefully it will make it easier to read, and easier to debug problems.

If you are interested, you can download the latest project files here:
MCP_V3.zip

The next major upgrade I have in mind is to add a second GLCD – two of them stacked vertically will give me 128×128 pixels of monochrome graphics. I’ll probably retire the character LCD as it won’t be necessary at that point.

Also, maybe some controls, finally. So I can, like, control it, and stuff.

It Tweets!

Posted 2012.01.09 20.13 in Computers/Internet/Technology

I took a few minutes this evening to geek out a wee bit. My Master Control Project has been sitting there working perfectly, staring me in the face, reminding me that I haven’t messed with it in a few weeks.

It didn’t take long to add a whole new layer of functionality to it, as this one is all software: I got it a Twitter account and programmed it to tweet status reports!

You can see the results first-hand by visiting the MCP’s twitter page.

At the moment it tweets a radiation reading at the bottom of each hour, and a temp / humidity message at the top of the hour. I’ll be adding some more tweet-content as things progress.

Master Control Project

Posted 2011.12.25 9.40 in Computers/Internet/Technology, Hobbies

Last weekend I finally mostly-finished the project I’ve been working on, on and off, for the last several months. My Master Control Project, or MCP*, was designed to be a central controller and information display that would sit on my desk in my livingroom, and give me all sorts of useful information while allowing me to control various things.

The idea grew out of my DIY thermostat project – after getting a taste of what could be done with an Arduino and an ethernet connection, I wanted more!

Plus, the thermostat is located up on a wall and I can’t see it from my desk in the livingroom . I wanted a cool project that I would be able to see all the time!

Unlike previous brief glimpses at this project, this time around I’m going over the whole thing in detail – mainly because it is, as I said, mostly-finished. (It’ll never be fully finished, because I’ll always be adding to it.) The other reason why this is a good time for a write-up, is last weekend was when I rebuilt the whole thing from the ground up, and took the project from ‘beta’ to ‘1.0’.

Thermostat 2.0

So here’s what it does so far:

  • It is a clock, with full day / date and time display.
  • It mirrors the HVAC information from my DIY thermostat.
  • It displays the current temperatures of my two aquariums.
  • It controls the lights of my two aquariums, turning them on and off automatically.
  • It controls my Game of Life wall display, turning that on and off automatically.
  • It displays the amount of background radiation detected by a geiger counter.
  • It displays the number of active connections on my linux server.
  • It displays the current weather conditions for my area.
  • It allows me to directly override the thermostat, aquarium lights, game of life display.

For communication, the MCP is connected via ethernet to my LAN, and also has an XBee wireless module allowing it to communicate with other devices in and around my house (eg. the thermostat).

Pile of Parts

For the most part, the MCP is made with off-the-shelf components. Some components were kits, some came fully assembled, and a few things were ‘homebrewed’. Here’s something of a BOM:

  • Arduino Mega 2560 – the brains of the operation.
  • Arduino Mega Proto Shield – provides connections for I2C (secondary LCD and Chronodot), Serial (XBee), the geiger counter, and the GLCD.
  • Arduino Ethernet Shield – does what it says on the box, this adds 100/10BaseT ethernet, allowing the MCP to receive data and commands from clients on my LAN or out on the internet.
  • Arduino Patch Shield – provides simple plug-in connections using normal Cat-5 cable so you can easily access inputs and outputs some distance from the main unit.
  • KS0108 Display – a monochrome graphic LCD that can dispay text and images.
  • Chronodot – a highly accurate RTC with its own battery backup and an I2C interface.
  • Protoboard GLCD backpack & Wiring Harness – some standard proto-board and ribbon cable, to connect the GLCD and Chronodot back to the Arduino, via the Mega Proto Shield.
  • 20×4 LCD Display – a monochrome LCD character display, for displaying text-only.
  • Adafruit I2C LCD Backpack – an Adafruit kit that lets you use character LCDs using I2C.
  • XBee – a transceiver that lets you communicate with other devices using standard serial protocol, wirelessly at ranges up to hundreds of feet away.
  • Adafruit XBee Adaptor – an Adafruit kit that makes it easy to use a 3.3V XBee module with a 5V Arduino.
  • MightyOhm Geiger Counter – a self-contained geiger counter kit that is easy to interface with an Arduino, and has a fairly sensitive GM tube.
  • Adafruit Perma-Proto Board – an ingenious proto-board from Adafruit, which lets you transfer projects from a breadboard to a soldered, permanent format.
  • Waterproof DS18B20 Temperature sensors – submersible digital temperature sensors, they only require one digital line and you can put more than one sensor on a single line.

The MCP is mostly assembled in layers, each layer is a ‘shield’ using the Arduino lingo. Here are the assembly steps:

The MCP is installed on the upper part of my desk, above the primary display of my computer. This puts it just slightly above eye-level, almost at the centre of my ‘hub of activity’. I spend most of my home-hobby-time at my desk, where my computer and tv are located.

This shot shows the MCP installation, with all its peripherals and cables etc. The modular construction means that if any part fails or needs attention, I can easily access and isolate that part, or replace it if necessary, while leaving the rest intact. And all without desoldering anything!

In terms of software, the whole thing is running with a sketch written in the Arduino IDE. It compiles to a binary of about 47kB in size, and generally uses about 3kB of RAM while it’s running. Prior to last week’s rebuild, I updated the sketch to version 1.0 of the Arduino platform.

The libraries used include:

I’ve added some special characters to the GLCD font definitions, such as the degrees symbol, and used a few graphic symbols as well, such as the fish and snail icons. A couple of the indicators on the GLCD are ‘text’ but I’ve used a graphic to squeeze the text into smaller area than the standard fonts would allow.

For all that I’ve got completed though, there are still some significant aspects that I have yet to include. The most-glaring omission is the lack of any kind of controls on the MCP itself – there are no buttons or switches or anything. I can’t control the Master Control Project, without firing up a terminal and accessing it over a network connection.

On the one hand, this isn’t a huge problem as it needs very little ‘help’ in doing its job – the aquarium lights turn on and off when they should, my Game of Life display is on when I’m around to enjoy it and off when I’m not. And the various data displays show me what I want to see.

However, it would be nice to have some buttons or something, so I could override things quickly and easily. I have some ideas on how to do this, and have already explored some options – touchscreen, rotary control, buttons, etc. Sooner or later, I’ll make a decision and put something into place.

Another obvious step will be a proper front-panel, so that the LCD displays aren’t just haphazardly screwed into the edge of the desk shelves. I’m planning to get a laser-cut acrylic panel made, which I think will look quite snazzy – but I need to finalize my plans on the buttons/controls first.

I’m also toying with the possibility of upgrading the displays. Obviously the GLCD wasn’t enough, hence the added 20×4 character display. Even that feels cramped, so I’m looking at the option of a second 20×4 display… Or maybe there’s some way to replace both of these displays with something all-together bigger – like a little VGA screen.

I have one of those digital photo frames, that I mean to disassemble and see if there’s any way to merge it to an Arduino… but that’s way down the road.

For now, the MCP is ‘done’ and it’s done well enough for me to leave it alone for at least a little while. Should anyone be interested in having a closer look at the ins and outs, I’ve attached a zip file containing the Arduino sketch, the related headers, and a text-file which contains my overview and some wiring and design notes.

Click here to download the MCP zip file.

(* Yes, I’m a fan of the original TRON movie. Not long after I started this project, I couldn’t help calling it the MCP and the name just stuck.)

Two Screens: Still Better Than One

Posted 2011.06.21 23.11 in Computers/Internet/Technology

So with all the features and functions I’m adding to my Master Control Panel, one screen just wasn’t enough any more to display all the data it’s collecting.

I’ve used standard character LCD screens before, on my Thermostat and the randomizer, so I figured I could just add one to the MCP as a secondary display. Then I thought, why limit myself to a measly two rows of 16 characters?

The 20×4 screen sounded like a way better idea… I just didn’t realize it was going to be so physically big!

It feels bigger than the primary display. Now I’m all unsure if I like it or not. I want more display resolution, to display more data. I don’t know whether to stick with two displays, or these two displays, or try different displays…

Decisions decisions.

Meanwhile, the radiation sensor is telling me that at the current rate cosmic and gamma rays are passing through my livingroom, I can expect to develop superpowers in approximately never.

Slow Progress

Posted 2011.06.19 20.36 in Computers/Internet/Technology

I’ve been working now and then on my Next Project. It’s slow going but there is progress happening.

This weekend I added a power supply (boring) and a radiation sensor (interesting). The radiation sensor is basically a geiger-muller tube detector. Instead of making audible tick sounds, I modified it to flash a blue LED whenevever it detects ionizing radiation. The counts are tabulated by the MCP’s microcontroller and available as a cumulative counts per day or current counts per minute.

What else can it do?

  • It is a remote display and remote control for my Thermostat.
  • It controls the lights in my aquariums.
  • It monitors the temperature in my aquariums.
  • It controls my Game of Life display.
  • It monitors and displays outdoor weather conditions.
  • It notifies me of activity on my home file server.
  • And now it monitors ionizing radiation.
  • It allows me access to all of this information and all of these controls both in-person and via network.

So I can monitor and control any of this stuff from my iPhone, iPad, at home or at the office, or anywhere.

The main board is an Arduino Mega. It’s using an Ethernet shield and an XBee shield. The radiation sensor is next to the Arduino. The display is a ks0108 glcd. More geeky goodness will be coming next week.