NGConnect 0.3

It’s now with gray-coded encoders support on board. Sample config is included in package. Encoder’s common must be connected to the GND pin while A & B channels to successive digital pins (in example config – pins 6 and 7). Put first of two pins in configuration and never use other pin for any other inputs/outputs (anyway it’s not available physicaly).

Download it here

If you start with this version you still need to read installation manual here

Feedback is always highly appreciated.

NGConnect and Encoders

Important thing I forgot to include in program archive is encoders firmware, which has been tested with ATTINY2313. It allows to connect up to 6 encoders of 2 different types: standard and gray code. The first type also requires hardware debouncing.

Download encoders firmware here

You will need Atmel studio and your favourite programmer to upload firmware to device (Google says, that you can also use Arduino board for device programming – I’ve never tried that). This firmware is intended to be used with 16Mhz crystal, so the fuses to be used are:

Extended 0xFF

Below is drawing with generic ATTINY2313 circuit and one encoder connected (without debouncing circuit). Standard and gray code encoders are connected the same way.


As seen from schema tiny uses serial method to communicate with Arduino. Tiny’s RX goes to Arduino TX and TX goes to RX. Do not use RX0/TX0 on Arduino (they are used for USB connection).

In module configuration put serial port number (1-3 for Mega2560) into Serial Field.

Type field must contain 8-bit integer value. Each of the first 6 bits is for single encoder. 1 means gray code, while 0 is for standard type. The first encoder is in the least significant bit. For example, 0b00000010 means, that 2nd encoder is gray code and you have to put 2 in Type field. Other example: 0b00100010 means, that 2nd and last encoders are gray code, so that you have to put 34 in Type field.


Encoder offset pin mapping (ATTINY2313):

PB0 – PD6 0
PB1 – PD5 1
PB2 – PD4 2
PB3 – PD3 3
PB4 – PD2 4
PB5 – PB6 5

One of the future updates will also include gray code type variable, which will allow to connect encoders of this type directly to Arduino.

NGConnect 0.2

First public release of NGConnect is available now.

Download here

Few words about this release

First of all, it’s still deep beta. Software can operate only as IOCP server now and it can be used with ProSim:737 and any other software, which has client abilities. FSUIPC is deeply experimental.

Arduino firmware now includes partly implemented ethernet support, but host software does not. So it’s useless and disabled by default.

Quick start

First of all you need to upload firmware into Arduino board. In my project I use Mega2560. I think, it will also work on Due (I have now one on order, will test soon). Uno requires some memory tweaking.

Download Arduino IDE 1.0.x, install it and open INO file from NGConnect folder. Select Board and Port under Service menu and upload firmware. Firmware will compile with IDE 1.0.x (tested with 1.0.5) only.

Please note that I’ve placed 3rd party LedControl library in project folder to avoid additional installation routines. If you have already installed LedControl, simply remove LedControl.h and LedControl.cpp from project directory.

NGConnect is built for .NET 3.5. Normally it will work under Windows 7 and higher without any extra downloads. For XP and Vista you may need to get .NET Framework 3.5 from Microsoft’s website.

I have included simple configuration file in archive. You’ll find there examples of IN, OUT and ANALOG variables. Theese types can be used without any extra circuity, so you can simply connect your switches and leds to all 54 pins of your board.

IN type uses internal PULLUP’s, so you don’t need to use any external resistors. All you need to do is to connect your switch between necessary pin and GND.

Sample config includes script for ANALOG pin variable, that converts 10K resistor value to 0…250 range.

About modules

Modules is very special feature, that I designed firstly for my project. Each module prototype is associated with physical configuration. You can’t just create new configuration under modules directory – it must be also supported in firmware. Under Modules page you can create custom configuration (pinouts) for each of 4 currently available prototypes.

SHIFT OUT is for shift registers. I use 74HC595 paired with ULN2803. This allows me to use just 3 Arduino board pins for lots of outputs (my MCP has 24 outs using 3 ICs).

7-SEG DRIVER is for MAX7219 ICs – very efficient driver for 7-segment displays.

MCP23S17 INPUTS is for MCP23S17 IC, that is used for inputs only in this configuration. You can use up to 8 ICs on device selection pin.

ROTARY ENCODERS is based on ATTINY2313 with custom firmware.

Connect with IOCP client

Use port 8811 to connect.


Allthough I do all tests using USB connection, in future I plan to use TCP/IP communication between all hardware.

Ethernet connection has some significant advantages in comparsion with USB:

1. It’s more stable.

2. It’s faster and TCP/IP manages data integrity.

3. Device identity (IP address) is hard-coded (or stored in EEPROM memory) so there’s no need to change serial port name every time device is reconnected.

Being now away from home (and all my hardware) I’ve decided to intergrate ethernet support into Arduino firmware and router.


The few things I’d like (and still don’t know how to) figure out are:

1. Detecting when ethernet shield is connected to arduino. Now there’s a variable telling firmware to initialize TCP/IP server and it’s required to set it to TRUE before uploading firmware.

2. Setting up IP address. The same as above – now it’s hard coded. IP address must be somehow definded at the first connection between PC and arduino (assuming there’s no access to source code or no skills to change it).