Introduction: SIMULANT - Remotely Controlled Multi Purpose Simulator 4-20mA, PT100, Pulse Generator and Counter
SIMULANT is handy tool for commissioner engineers who works with industry standard measurement interfaces.
SIMULANT is controlled locally by inbuilt potentiometer or remotely from Android App over Bluetooth.
1) Simulating 4-20mA active or passive sensor
2) Simulating PT100 sensor (thermometer)
3) Pulse generator and counter
4) Built in battery and charger
5) Bluetooth interface
6) Android App for remote control
Repository of all project is available on https://github.com/bcsedlon/simulant
Step 1: Android App
Android App is written in Android Studio as open source. Source code and app is avaliable on https://github.com/bcsedlon/simulant/tree/master/s...
Compiled APK is available on https://github.com/bcsedlon/simulant/tree/master/s...
User interface offers comfortable control of simulated value by setpoint and + / - buttons. Measured current and frequency is displayed and current is recalculated to target technological value.
Step 2: Use Cases
Step 3: Box and What Do You Need
1) Box with transparent cover, approx 15x8x5cm (transparent cover is good to see various LED indicates state of tool)
2) Arduino Nano https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
3) Bluetooth module HC-05 https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
4) DC Step up booster https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
5) 0-5V voltage to current 4-20mA converotr module https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
6) 18650 battery with holder https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
7) TP4056 battery charging module https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
8) Potenciometer aprox 10kOhm
9) 7pcs bannana plug socket https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
10) 4pcs universal diode
11) Universal NPN transistor
12) DC barrel jack 5.5x2.1mm panel mount https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
13) AC/DC 5V 2A power supply adapter 5.5x2.1mm barrel jack https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
14) Capacitor 100n
15) Resistors 5pcs 1,5kOhm, 50Ohm, 2x 10kOhm, 80kOhm, 5kOhm, 2kOhm, 2x150Ohm
14) White LED
15) Photorestor, low light resistence https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
16) Dupoint wires https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
17) 2pcs 2 pole 2 position switch https://www.ebay.com/sch/i.html?_from=R40&_trksid=...
Step 4: Scheme and Does How It Works
1) 4-20mA I OUT, switch S2 in I OUT position
In this mode voltage from battery is step up to 24V for voltage to current convertor. Convertor is controlled from Arduino PWM output D6. Simulated current flows from current convertor to terminal X3 - 4-20mA I OUT throw external measurement instrument (for which we make simulation) back via X3 - 4-20mA I OUT - and internal measurement resistor R7. Voltage form R7 is measured by Arduino a correspond to current flow.
2) 4-20mA I IN, switch S2 in position I IN
Current source is in external circuit, plus is connected to terminal X2 - 4-20mA I IN + and power up voltage to current convertor. From convertor output current flows via ballast resistor R6 and measurement resistor R6 to terminal X2 - 4-20mA I IN - and back to supply circuit. In this connection measured doesn't include own converter consumption (aprox 2mA) witch flows on converter GND to X2- 4-20mA I IN -. This deviation could be handle in Android App.
Diodes D2, D3, D4 are protecting tool against wrong external connection.
Voltage from R7 is measured on A7 pin and tool display simulated current and check if loop is closed.
Feedback measurement can be used in closed-loop regulation in future improvements.
Battery voltage is measured by voltage divider R12 and R13 and could be used open-loop regulation in future. (PWM voltage depends on battery voltage, therefore output current depends on battery voltage).
3) PT100 simulation
150Ohm resistor is in parallel connection with photoresistor. Photoresitor is in dark room together with white LED diode. LED diode is PWM driven from pin D5 and provides result resistance between terminals X1 - PT100 aprox 80-150Ohm.
4) Pulse Generator
Pin D4 controls transistor Q1 and pulses are on terminal X4 - PULSE IN / OUT. Depends on position S2 output pulses are with amplitude 0V 24V from internal source or from external source connected to terminal X2 - PULSE +.
5) Pulse Counter
Pulses from terminal X4 - PULSE IN / OUT are taking via voltage divider R10 and R11 to pin D8. Transistor Q1 is closed. Power source from pulses could be internal or external analogical to function in Pulse Generator mode.
Step 5: Arduino Code
Arduino source code is open source and is available on Github https://github.com/bcsedlon/simulant/blob/master/s...
Code opens software serial port for communication with bluetooth module. Native serial port is kept for communication over USB and programming.
For pulse generating is used TimerOne library and it is interrupt driven.
For pulse counting is used interrupt on PORTD. For this reason must be used modified SoftwareSerial library, where is PORTD kept free for counting.
Inside loop() are communication routines for data exchange with App and setpoint setting from inbuilt potentiometer.
For internal measurement of current is calibration constant stored in EEPROM (voltage to current calculations depends on R7.
Future improvements is measure battery voltage and adjust PWM output according battery voltage.
Step 6: Inside
Step 7: PT100 Opto Coupler
Participated in the