Articles Hierarchy

Articles Home » Arduino Projects » ARDUINO PROJECT: MULTIDROP LINK


when i play with 2 Arduino's and serial link i wanted to work on a RS485 link,
but not again DMX, what i never could test.

more like a MODBUS MULTIDROP ( already exists for ARDUINO )
but in a simple ASCII way.
using a frame ";01,UOK,(data)" and slave answers ";01,AKN,"
for the slave i use the DIY DUINO,
a shield with RS485 chip i must build soon.
as cable use a 2 wire twisted, or a 4 wire and also bring power (Vin) to the slave,
a normal inhouse telephone cable will do.

for the software i use the "new soft serial" on D2, D3
and the master gets the newest serial menu revision, for USB terminal operation.

later a processing window could show my network status....

working on master and slave software
at the same time is possible, with both arduino windows open
must only change com add ( and board type (if different))

with this setting can download and start terminal window,
the other com add can be monitored by HTERM parallel.

sometimes you loose concentration and download slave software into master...
but no harm done.

actually its the first "protocol" i am writing
despite all the communication, arduino PC for menu and processing scope..
and to make it easy for me i do it syncron,
means the master send a slave command and waits for the answer.
( by newsoftserial.available and a small delay )
now this timing will get difficult when there is more load on the slave, and also when change baude rate.

software features:
baude rate fix, later with RS485 check whats possible.
from datasheet (TI) there is no info about this???
but when i used MODBUS in industrial environment 10 years ago,
we only talk max 19200bd.
As start slave address and D output configuration in flash ( code )
but later it will come from EEPROM.

The slave read I/O every second
options: selectable use VCCread calibration, use digital filter on Ain's
master can get that value anytime later.

master can set digital output LOW HIGH / 0 .. 255 (PWM)
if configured as output PWM in slave.

MASTER: conti job:
-- measuring (10sec)
-- check 00 .. 32 slaves on ALIVE

-- check communication quality by sending a known text

here the code from the RS232 version

what you see here is
TOP: arduino 2009 no CPU (FTDI to program/communicate with:
with 3 wires D2 -- D3 ; D3 -- D2; GND ( RS485 comes later) to:
BOTTOM: arduino uno
both connected to computer by USB ( and powered),
+ only one to arduino Terminal,
+ other port by hterm

First work on that project to move it ( from "0022" ) to "ARDUINO 1.0"

i like to test some more features for a multi drop link,
a init set up of a slave in EEPROM
start with the slave add.
Now there is in the (master) main menu a feature to check
for a uninit slave ( like a slave with a add '0' ),
you can give a new slave add ( ! should not exist ! ),
what is saved at the slaves EEPROM;
so one by one you can add new slaves to a link and init its add by master menu
( a common working style i have seen at HART instruments multidrop links )

one byte for each configurable DIO ( 4 .. 12 ) init as input, input pullup, output, PWM.
even this can be changed from master online ( into slave EEPROM )
it is valid only after slave reset/reboot ( automatic )
this version SLAVE8 will be now be renamed as REMOTE_I/O ( fully configurable and operable from master)

A new version now includes PID control

for input use A0, for output use D9 PWM
operation and loop tuning from master
tuning and setpoint, mode.. in slave EEPROM, so powerfail, linkfail no problem
so installing a new controller requires a link with a master,
to setup slave add, I/O and optional PID control with tuning and setpoint and mode.
After that the new controller could be stand alone.

master menu operation of control loop is basic, finally there will be a processing appl.

now working again on hardware, i first need the ARDUINO PROTO SHIELD
with the RS485 link hardware, because its a older shield i leave some unused options on it.
and for the DIY SLAVE here the SLAVE SHIELD

and the code of the version 1.0 REMOTE I/O + PID, RS485 running.

test with a short 4 wire telephon cable

here the SLAVE with shield ( and FTDI for development und diagnostic )

but that was just a first test, next need one more slave on the link
and i want modify the DIY DUINO to a LINK SLAVE CONTROLLER,
so RS485 should be on main board.
DIY LINK SLAVE layout and DIY LINK SLAVE circuit and more info partslist
so, thats the new SLAVE CONTROLLER for 284Baht / 7 .