All extra circuitry: 2.49V reference, 2.5V regulator and Optocouplers are assembled on a standard Arduino perforated board shield, as shown in the photos. This Shield plugs into the Micro sockets directly, but the Micro/Shield interconnections are wired to the screw terminals to obtain a high degree of flexibility.
Dynamic range and resolution
A very useful accessory is the TEST VOLTAGES BOARD (TSB): a perforated board with 5 fixed voltage dividers plus one variable voltage divider, connected to the Micro’s +3.3V output. Data is enclosed for three boards for the following dynamic input ranges: 0 – 2.5V ; 0 – 2V and 0 – 1 V. The Buffer/Isolator presented here has the widest range of 0 – 2.5V, or a resolution of 2500/255 = 9.8 mV. Changing the Voltage Reference (AREF) voltage and the Optocouplers’ feed to 2V resolution improves to: 2000/255 = 7.8 mV and going to 1 V we obtain 1000/255 = 3.92 mv. Reference Voltage modification requires modification of the Optocouplers voltage feed to the same voltage as well, but this is simply done by adiustment of the series regulator IC11.
In many cases dynamic range is dictated by the sensor: the LM 75 digital (I2C) temperature sensor output (that we shall use for demonstrating I2C operation) swings from 0 to 1 V between 0 and 100 °C, so this range would be advisable for maximum accuracy.
Test Equipment: Oscilloscope & DVM. Two calibrated DVM's recommended.
Once the shield is built, the following checks should be done before plugging and wiring it to the Micro.
1) Isolation between Input Ground (Sensor's ground) and Output Ground (Optocoupler's ground).
2) Reference voltage of 2.49V across D1, by using an external +5V PSU.
3) Optocouplers output feed voltage of 2.5V, by using an external +5V PSU. Multiturn pot R12 must be set to 2.5V.
With reference to Photo Micro Shield 4 (M) connections are as follows.
• Terminal A connects +3.3V from the Micro to the Test Voltages Board.
• Terminal B connects sensor’s ground to the TSB.
• Terminals C-D-E-F-G-H are the sensors’ A0 – A5 inputs to the Micro, now connected to the outputs of the TSB. The variable 0 – 2.5 V output is connected to C (Micro input A0).
• Wire I (orange) brings +5V from Micro to Voltage reference D1.
• Terminal J connects the Optocouplers’ ground to the DA (in this case the DrDAQ).
• Terminal K gets the USB +5V from one of the +5V terminals of the DrDAQ. This is the supply voltage to the regulator that outputs +2.5V for the Optocouplers’ feed.
• Terminals L-M-N, Optocouplers’ outputs, are connected to the inputs of the DA. Note that only three channels are used in this test. The fourth unused terminal R can be seen between M & N.
• Wire P brings the +2.49V reference voltage to the AREF pin.
• Wire Q (black) brings the sensors’ ground to the Voltage reference circuit.
• Terminals D3-D5-D6-D9-D10-D11 are the Micro PWM outputs to the Optocoupler inputs. In this test only D3-D5-D6 & D9 are connected, because only four Optos are mounted on the board.
1) The sketches are uploaded to the Pico Forum in WORD format. Copy the entire sketch, open the Arduino IDE, paste it on a blank sketch page and save. Compile the new sketch: if there are problems, carefully check that all elements have been copied, especially initial and final text.
2) Plug the shield into the Micro.
3) Connect the Test Voltages Board as described above. Do not make any connections to the DA and do not apply +5V to terminal K yet.
4) Connect the Micro to the System Testing Laptop, open Arduino, check the COM PORT and load the sketch.
5) Once loaded, open the Serial Monitor: you should see the sequence of six voltages iterating every 4 seconds (timex = 4000).
6) Now connect the oscilloscope probe (ground to sensor’s ground) to Micro output terminals D3 to D11 to check the different PWM’s due to the different input voltages. All the PWM signals will have an approximate amplitudeof 4.5V. D3 corresponds to input A0: here the PWM duty cycle will change by adjusting the multi-turn trimpot on the TSB.
7) Connect the DA to the System Operation Laptop and turn on Picolog.
8) We are now ready to test the Optocouplers: connect terminals J & K to the corresponding ground and +5V of the DrDAQ, or to an external supply, if you are using another DA.
9) Now connect the scope probe (ground to Optocouplers’ ground) to terminals L,M.R & N: here again the same PWM signals will be noted, but with an amplitude of 2.5V.
10) Connect terminals L, M, N & R to the DA (only L, M, & N to the DrDAQ): Picolog will read the DC voltages corresponding to the PWM Duty Cycle.
Limitations in accuracy
The voltage – to – PWM conversion introduces imprecision at the extremes of the dynamic range. At voltage levels near zero, you can have zero or 9.8 mV (the first step) and in general values between 0 and 100 mV need correction. At voltage levels near 2.5 V, the barrier junction voltage of the Opto’s output transistor takes its toll, so it is advisable never to use levels above approx. 2.3V. Very good accuracy can be obtained by implementing a scaling data table, as shown in schematic diagram. The scaling table is prepared by reading and noting input and output voltages on A0 and D3 with two calibrated DVM’s. Seven values, as shown provide good results for a scaling table. For improved accuracy, collect more values and prepare a 16 step scaling file.
In the next post we shall discuss I2C operation.
Post discussions on projects you are working on
1 post • Page 1 of 1
- Advanced User
- Posts: 0
- Joined: Sat May 11, 2013 10:03 am
- Location: San Marzano Oliveto, Asti, Italy
- sketch_Analog_IN_PWM OUT.doc
- Analogue sixchannel sketch
- (34.5 KiB) Downloaded 405 times