REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 2

Post any questions you may have about our current range of USB data loggers
Post Reply
Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 2

Post by Glovisol »

Complete System
Complete System
2. DESCRIPTION OF SYSTEM OPERATION

This description will give a good idea of the capabilities of the Communications System, which employs two Micros talking to each other: the Master and the Slave, interconnected by a twisted wire line. Please simply read what follows, as the detailed examination of the software will be posted later on. The Slave unit sits in the remote position and accepts up to six 0 to +2.5V outputs from as many sensors. The Slave unit requires a local PC for software uploading and/or troubleshooting only, because the Arduino Micro permanently stores the operating software, even with no power and does not require a PC driver.
In normal operation the remote Slave works with only a small A.C. mains supply delivering +9V.
The Master unit sits in the local position, reads the remote data sent by the Slave and delivers the same 0 to +2.5V to the Pico Data Logger inputs. Both the Master and the Data Logger are connected to the local PC by means of USB connections and they are compatible, if connected to different USB lines on the same PC. Let us suppose that we have uploaded the Demo Software and we have both the Master and the Slave connected to one PC .
NOTE: The proposed sketch software works with any Arduino IDE, but, if Windows XP is used as OS, I advise using IDE 1.0.6 + the Arduino ERW edition 1.0.5 (readily downloadable from Internet) because it automatically opens the Serial Monitor as soon as the upload is completed and one does not have to open it manually. Furthermore the ERWedition also offers a handy "RESET" pushbutton on the Serial Monitor itself.

We start the Arduino IDE on the Master PC and we upload the Sketch_MASTER_485_DrDAQ_DEMO_2. The Serial Monitor opens and shows:

=====RS485 DrDAQ DATA COMMUNICATIONS======
=====StandBy = a; Start = b; press RESET to Stop====
============ITERATION SETTING = 899==========


Now scroll the Sketch until you find //SETTINGS: here you can change the NUMBER OF ITERATIONS (up to several million) e.g. the number of interrogation cycles and the RECYCLE TIME, e.g. the time lapse between one interrogation and the next in mS (1000 mS = 1 sec.). Without modification the System will recover 899 samples of the Slave sensor input A0 in a time period of 15 minutes.

We then start the Arduino IDE on the Slave PC & we upload the Sketch_SLAVE_485_DrDAQ_DEMO_2. The Serial Monitor opens and shows:

SERIAL RS485 DrDAQ SLAVE READY

The system is now ready and in Standby.
Type “a” in the Serial Monitor input window of the Master PC and press ENTER. The reply is:

=========SYSTEM IN STAND-BY=======

Type “b” in the Serial Monitor input window of the Master PC and press ENTER. The reply is:

=====DrDAQ RS485 - SYSTEM ON – RESET TO STOP=====
ITERATION No. xxx OUT OF 899
RECYCLE TIME = 1.00 SECONDS
TOTAL DATA ACQUISITION PERIOD = 15.00 MINUTES
…………………………………………………………….
SYNC VERIFIED BY SLAVE = 123
…………………………………………………………….
SLAVE CHANNEL/0 = yyy - mV = zzz


Where “xxx” is the number of past iterations, growing by 1 per second; yyy is a number between 000 and 255 showing the level of channel/0 (pin A0 of the Slave unit) and zzz is the value in mV on Channel/0. Meanwhile on the Serial Monitor of the Slave PC we see the following.

DrDAQ RS485 SERIAL SLAVE
Sync received = 123 – (same as on Master)
Iteration No. = xxx - (same as on Master)
Local data = yyy – (same as on Master)

During System operation pins 4 on Master unit goes from state LOW to state HIGH and can be used for external signaling or other. On Slave unit pin 4 pulses LOW to High: if a steady HIGH signal is needed, this can drive an external retriggerable monostable. Amend as of 20/2/2016: true with first version of software; in all later versions pin 4 on Slave is steady ON state in operation. Once the system reaches Iteration No. 899, it automatically stops. Operation is as follows.

The System start command is given by letter “b” on Master Serial Monitor. Master unit sends Sync byte123” to the Slave unit, which checks that it is “123” and then sends it back to the Master, together with the 0 - 255 level of input A0. Master receives the yyy data and converts it to mV. Master and Slave count the Iterations and the System automatically stops at the pre-set value of 899.

The operator can stop System operation at any time by pressing RESET on the Master Serial Monitor (only ifthe ERW IDE is used). This is a local reset. There is no reset for the Slave from the Master, as it is not necessary for System operation. Of course Slave can be reset locally. Amend as of 20/2/2016: true for the first DEMO version; in all later versions RESET acts both locally & remotely.

If transmission path is interrupted, System stops working, advising that there is no reply from the Slave. If the sync returned is different from the sync sent by the Master, the System Stops and the Master Serial Monitor shows the following: (amended 24/2/15: this mode of operation modified,as shown in Part 7)

=====DrDAQ RS485 - SYSTEM ON – RESET TO STOP=====
ITERATION No. xxx OUT OF 899
RECYCLE TIME = 1.00 SECONDS
TOTAL DATA ACQUISITION PERIOD = 15.00 MINUTES
…………………………………………………………….
ALARM OR NO CONNECTION TO SLAVE


The System is brought back to the StandBy / initial condition by pressing RESET on the Master Serial Monitor.

Post Reply