Archive for November, 2009

Looking for a new project

Sunday, November 29th, 2009

Like the title says, I’d like to hop on a new project. A few thoughts:

  • I don’t think I’m going to continue with the stack processor. Mainly, I don’t think I will learn much, other than how to get really frustrated at very little functionality. So I’ll pass up on that.
  • The RainDance/Sprinkler controller is still asking for a last few hours of wrap-up/polish, and I will do that before I really sink my teeth into a new project.

Now, to the new project… I’m a student now, so I don’t want to spend a lot on building a hardware prototype or anything. But here’s what I have at my disposal right now:

  • NetBurner dev board (a ColdFire controller with an ethernet port and a bunch of peripherals)
  • PIC Dem2 Plus dev board
  • SitePlayer dev board
  • Xilinx FPGA dev board
  • A laptop with a CUDA-capable NVIDIA GPU
  • Student version of Matlab and LabVIEW

So, some thoughts about the actual project:

  • I COULD re-implement the RainDance stuff on the NetBurner, just for fun. But mainly that would consist of slapping together existing RTOS, TCP/IP, Webserver, etc. packages for this processor. I may do it yet, but I’m not sold on it, really.
  • I was considering implementing a system from the ground up on the ColdFire using FORTH. Basically, write a low-level boot loader thing and a basic interrupt handler in assembly, and on top of that do everything in FORTH, all the way up to … well, realistically, up to the point I get bored, but in theory up to a working TCP/IP stack and webserver.
  • I’ve been studying control theory this semester, and something in that realm might be interesting, but I can’t think of a good application. Maybe something with a dsPIC (which I don’t have, but if there’s a really interesting application, I’m sure I could scrounge up a dev board somewhere). One thought was a regulated power supply of some sort.
  • Some sort of DSP application – I have labview/matlab and the NVIDIA CUDA (massively parallel processing) available, so something where I can process large amounts of data (video/image processing, for example) might be neat. But it would definitely require a lot of reading/learning on my side. But still, something I’d like to get into.

So, thoughts? suggestions?

RainDance – Sprinkler Controller

Wednesday, November 4th, 2009

I am nearing completion of my first actual brought-to-completion microcontroller project. The application: to control sprinklers and drip hoses in the back yard through a web interface, with multiple timers for each valve and power back-up. This was accomplished by creating a custom electronic platform, along with a dynamic website for the user interface.

The hardware consists of a SitePlayer network module, a PIC 18LF2321, a 3V coin cell battery, and glue logic. The valves that control the waterflow are turned on and off with relays that switch 24VAC power. The relays themselves are driven from the PIC I/O pins using driver ICs. Twelve valves in total are in use for this project, the number being limited mainly by the memory of the PIC device selected.

The SitePlayer module implements all the handling of network devices. It includes a flash memory that stores all the web site files. In the files, strings of the form ^foo are replaced by the content of the variable ‘foo’, which is one of a number of data types, automatically when the website is served by the site player. A UART (RS232) link between the PIC and the SitePlayer allows the PIC to read and write the variables in the SitePlayer’s on-board memory.

Additionally, a serial I2C eeprom is available for logging events.

Software & Logical Design
The logical design of the device is as follows: the SitePlayer serves up a website with information regarding the current configuration of the system (current time, day, status of the valves, etc.). Most of the dynamic information is retrieved via AJAX. When the user makes a change to the web interface, a specially formatted string is written to the SitePlayer (again, using AJAX), and the SitePlayer module toggles an I/O pin, raising an interrupt on the PIC. The PIC notices this interrupt, reads the command string out of the SitePlayer, updates its internal parameters, and then updates the SitePlayer’s memory, reflecting the changes. Then, the SitePlayer propagates the changes back to the browser.

Furthermore, the PIC reacts to a timer interrupt generated every 2 seconds, and updates its internal clock. On every minute roll-over, it checks whether any valves need to be turned on or off.

There is a back-up battery, which makes sure all the settings (which are stored in PIC RAM) are preserved across power losses. In battery mode, the valves are not being activated, nor is the SitePlayer running. The PIC wakes up every 2 seconds, updates the internal time, and goes back to sleep, so minimal power is consumed. When power is restored, the SitePlayer is re-initialized with data, and can be accessed via the network again.