REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 3

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 3

Post by Glovisol »

The Picoscope screen shows PWM and filtered PWM output to the Data Logger
The Picoscope screen shows PWM and filtered PWM output to the Data Logger


3. PLANNING STRATEGY FOR DrDAQ / ARDUINO MICRO IMPLEMENTATION


3.1 Arduino Micro Outputs
With reference to the schematic diagrams of the Master and Slave units, the Arduino Micro has 14 output pins. All these pins are digital and handle ON/OFF signals. Some of them also handle PWM signals, as shown further on. Therefore special provisions have to be made for driving the Data Logger’s Analogue inputs.

3.2 Inputs/outputs to the RS485 Serial Modem
The pins to be used as channel outputs to RS485 Serial Modem M2 must be carefully selected as follows.

Pins 0 (Rx) and 1 (Tx) cannot be used, because they are in parallel to the USB handling hardware. Anything connected here would interfere with the USB uploading and Serial Port communications with the controlling PC.

Pins 3/11, 5/6 and 9/10 (in red) are software programmable and the only PWM capable. Being controlled by the Micro’s three Timers, they are best reserved as data outputs to the Data Logger . They also have the potential for higher speed/resolution, as it will be shown in a future series.

Pins 2, 4, 7, 8, 12 & 13 (ON/OFF ONLY) are those best suitable for the RS485 interconnection. The Modems require three pins as follows.
RO Serial Receive: Pin 7.
DI Serial Transmit: Pin 8.
RE and DE Data Enable are connected in parallel and driven by Pin 2.

Connections above are only valid for the Master. In the Slave connections are reversed as follows.
RO Serial Receive: Pin 8.
DI Serial Transmit: Pin 7.
RE and DE Data Enable are connected in parallel and driven by Pin 2.

3.3 External ON/OFF outputs with System in operation
In the Master unit pin 4 goes HIGH (5V @ 20 ma). IN the Slave unit, pin 4 pulses ON/OFF at the iteration rate in the first Slave DEMO Sketch: in later sketches pin 4 goes HIGH permanently in operation. Two pins, 12 & 13 can also be used as ON/OFF spares.

3.4 Outputs to the Data Logger
As we have seen in 3.2 above, pins 3/11, 5/6 and 9/10 carry the sensor signals to the Data Logger. Being digital, they can only supply a PWM (squarewave) signal. Output amplitude is proportional to duration of the ON time, i.e. the average amplitude. Without software modification to the Timers, the PWM frequency on all output pins is between 450 and 500 Hz, with the exception of pins 5 & 6 which work at about 1000 Hz and these frequencies must be filtered out to a high degree in order not to disturb the Data Logger’s input circuitry.

On the other hand a simple RC circuit would severely reduce the system’s frequency response. Operational Amplifier IC11A and associated components implement a low-pass filter having a 3 dB frequency at 30Hz and providing an attenuation in excess of 80 dB at 450 Hz. If faster response is required, filter cutoff can be raised by re-calculation of filter components, obtaining a better compromise for speed. Amended as of 4/3/2016: later tests showed the remarkable tolerance to ripple riding over D.C. input voltage of Picolog Data Loggers and sophisticated filtering is not necessary, see NEXT PART 10.


3.5 Overall system resolution and precision
With reference to the Slave unit, remote sensors are connected to the A0 to A5 Analogue inputs. These are true Analogue inputs (e.g. served by an Analogue to Digital Converter) with 10 Bit resolution. This resolution is referred by default to a not suitable top voltage (DEFAULT REFERENCE) of +5V, which depends on the low accuracy Arduino internal voltage. The solution is to supply an accurate and extremely stable EXTERNAL +2.5V REFERENCE (LM336 IC). With 2.5 V, the input resolution on each channel (A0 to A5) becomes: 2500/1024 = 2.44 mV.

Unfortunately Arduino’s digital outputs (with standard setup of the Timers) can assume only 256 discrete PWM duty cycle states and hence the output resolution (e.g. the overall system resolution) degrades to 8 Bit, e.g. 2500/256 = 9,8 mV. Correspondence between input and output is obtained by software mapping the input to the output. A very accurate reference voltage is also mandatory because differences between Slave and Master references will cause a reading error in every channel.

The use of PWM at the outputs also influences the overall accuracy because any voltage error or offset and/or noise will be far more significant at low sensor voltages. Therefore a negative voltage supply is used in the Master unit to eliminate Operational Amplifier offset near and through zero output voltage. Amended as of 4/3/2016: the negative voltage no longer necessary because the Op Amp Active Lowpass Filters have been replaced by simpler RC networks.

3.6 Power Supply strategy.
The Slave unit is fed by a small +9V mains supply, connected to the Micro Vin pin. This voltage is lowered to +5V by the Arduino’s internal regulator chip. There is no power supply conflict with the temporary connection of the PC to the Slave unit via USB, because the Micro’s internal circuitry will automatically cut off the +5V USB voltage when the +9V external voltage is connected. The Micro’s internal regulator outputs +5V at the 5V pin. This voltage feeds the Precision Reference Generator and the RS485 Serial Modem. The Slave unit will carry on working with no external +9V, but with reduced precision and accuracy, when connected to the PC USB only.

The Master unit, being always connected to the PC , works exclusively with the USB +5V. As with the Slave, the accessory circuitry: Precision Reference Generator, Negative voltage supply and RS485 Serial Modem are supplied by the Micro 5V pin.
Attachments
Master unit diagram. This diagram much simplified, see Part 10 (4/3/16)
Master unit diagram. This diagram much simplified, see Part 10 (4/3/16)
Slave unit diagram
Slave unit diagram
Last edited by Glovisol on Sat Mar 05, 2016 7:34 am, edited 5 times in total.

Glovisol
Advanced User
Advanced User
Posts: 0
Joined: Sat May 11, 2013 10:03 am
Location: San Marzano Oliveto, Asti, Italy

Re: REMOTING SIX SENSORS ON ONE TWISTED PAIR - PART 3

Post by Glovisol »

ERRATACORRIGE

With reference to schematic digrams of Master and Slave, where the value of R1 is missing,
R1 = R2 = 4.7KOhm. Even better replace the two resistors with a 10 KOhm multi-turn pot with the wiper connected to the adjustment pin of the reference Zener IC D1.
Apologies,

================================
Although the active lowpass filter shown in the Master sketch has shown faultless performance in the System tests and therefore the uploaded schematic can be used, I anticipate that the final version of the Master unit will employ the LINEAR TECHNOLOGY LTC 1062 active capacitor switch mode filters, which require less external components, do not need the negative supply and provide even better performance. The new schematic will be uploaded after build & tests will be completed.

glovisol

Post Reply