Unknown Domain

AAN: Arduino Area Network

Earlier this year I started to investigate how I might go about implementing the circuitry and communications between a computer and a micro controller for my long term split-flap display project which seems to have taken over my blog of late!

The setup I finally settled on was to use a simplex (single direction) serial protocol called RS-485, the ‘bigger brother’ of RS-232 used in almost every computer, commonly known as ‘the serial port‘. Using RS-485 would require some special circuitry which could convert to a signal that an Arduino could understand so I went about building a converter circuit which I had built up as a small PCB, my first proper PCB, designed by me alone, and it worked first time!

Next I worked on some software which is designed to receive six byte commands from a master control board allowing full control of all modules together or each module individually. The commands are structured as follows:

  • STX (Start of text)
    Denotes the beginning of a transmission, the ASCII byte 0x02.
  • Address
    A byte representing the intended receivers address. 0x00 addresses all units and 0x01–0xFF are receiver addresses, 255 unique addresses in total.
  • Command
    A byte representing the command:
    0x00 – Blank all units (Go to space character).
    0x01 – Control status LED on main board (0x00 = off, 0x01 = on).
    0x02 – Reset (Clear EEPROM lockout).
    0x03 – Store new address in EEPROM.
    0x04 – Go to flap.
  • Variable
    Depends on command byte.
  • Checksum
    This byte is the value of all other bytes XORed together, to help ensure the integrity of the received data… STX ^ Address ^ Command ^ Variable ^ ETX = Checksum
  • ETX (End of text)
    Denotes the end of a transmission, the ASCII byte 0x03
This command protocol is simple but effective for my needs, it has plenty of space for expansion of the command set and the one byte address range is plenty for a single ‘universe’ (DMX speak) of modules as the RS-485 chip I use has a theoretical maximum of 256 devices on one chain, and including the command module and 255 addresses that is reached using this protocol.
With the RS-485 board finally working I started looking at building my own basic Arduino, based off the open source schematics and Standalone Arduino I meticulously designed a schematic in EAGLE for my own Basic Arduino, and then laid out a PCB and set it for fabrication with OSH Park. This board came back last week and I assembled all three, to my amazement they all worked perfectly first time also!

The next thing to do was hook up both my boards as originally intended and use my command protocol to test the devices, even on just 9600 baud I am able to make the LEDs dance one after the other like a fair ground attraction using the computer as a controller.

You can see in this video the end result which I am very pleased with, to have all three work perfectly and do what I originally intended is absolutely amazing, and really gives me the confidence I need to push on and work on the sensing of flaps passing and homing of the deck then trying to combine the two schematics I have designed with the EasyDriver and a few tweaks to produce an all in one module controller board which hopefully will work as well as the previous two boards. I may look into using SMD parts too!

If you want the schematics I have posted them on GitHub:

Basic Arduino
RS-485 Adapter