Documentation > Instruction Manuals
Quad Sensor Controller - 2.01.003
Introduction
The Quad Sensor Controller (2.01.003) is an USB controller that allows you to connect 4 train detection sensors to your computer.
USB Communication Protocol
Introduction
From firmware version 2019.01.1 onward, the quad sensor controller has two communication protocols: a binary one and ASCII one. Older versions of the controller only have the binary communication protocol. The binary one is used by nControl™ to communicate with the controller. The ASCII protocol is fully documented and can be used to integrate the quad sensor controller into a your own custom software application.
This section is only useful if you want to integrate the controller in your own software. It's not relvant in case you're using the controller with nControl™
The information on this page is intended for personal, non-commercial, use only. Commercial use without prior written approval by 4DBrix LLC is prohibited.
Connecting to the Controller
You can communicate with the quad sensor controller over a serial connection. The default baud rate is 38400. Keep in mind that the controllers start up using the digital communication protocol, so you need to switch them to the ASCII protocol before you can use the commands listed in this manual.
To connect to your controller, make a serial connection using 38400 baud and then send the command:
mod,asc;
to switch the controller to the ASCII protocol. Once that's done, you're ready to start using the controller.
ASCII Commands
Auxiliary Device Commands
cmd,port,data;
Send serial data to an auxiliary device. This command can only be used if the port has been configured as a serial out port.
  • port specifies the port of the controller.
  • port specifies the data string that has to be sent to the auxiliary device.

Controller Info
get,serial;
Request the serial number of the controller.
get,type;
Request the type of the controller.
get,version;
Request the firmware version of the controller.

Communication Mode
mod,asc;
Switch the controller to the ASCII communication protocol.
mod,bin;
Switch the controller to the binary communication protocol.

Port Configuration
prt,port,serwri,baud;
Configure the specified port as a serial out port. This mode allows to send serial data over the third pin of the port.
  • port specifies the port of the controller.
  • baud specifies the baud rate for the serial communication.
prt,port,sen;
Configure the specified port as a sensor port. This is the default, this command only has to be executed to return to sensor port mode after the port had been configured as a serial out port.
  • port specifies the port of the controller.

Sensor Commands
sen,port,off;
Switch sensor feedback off. The controller will no longer return any feedback from the specified sensor port.
  • port specifies the port of the controller.
sen,port,cont,interval;
Request continuous sensor feedback.
  • port specifies the port of the controller.
  • interval specifies the interval between two consecutive data samples, expressed in milliseconds.
sen,port,above,interval,threshold;
Request continuous sensor feedback only if the value is above the specified threshold value.
  • port specifies the port of the controller.
  • interval specifies the interval between two consecutive data samples, expressed in milliseconds.
  • threshold specifies the value above which sensor feedback has to be provided. [0 - 1023]
sen,port,cross,threshold;
Request sensor feedback only if the value crosses, goes above or below, the specified threshold value.
  • port specifies the port of the controller.
  • threshold specifies the threshold value. [0 - 1023]

Controller Settings
set,baud,rate;
Change the baud rate of the serial communication. The new baud rate is stored in the EEPROM of the controller and will be used next time the controller boots.
  • rate specifies baud rate.
Example
Use the following procedure to get a sensor value from port 1 every 100 milliseconds:
  • Make a serial connection to the controller using 38400 baud.
  • Send the command mod,asc; to switch the controller to ASCII mode.
  • Send the command sen,1,cont,100 to get sensor feedback.
You should now get a message with the port number and sensor value, every 100 milliseconds.
Versions
2017.03.1
  • Support for nControl™ (digital communication protocol)
2019.01.1
  • Added support for ASCII communication protocol
  • Added support for auxiliary serial devices