Electronics - Robust design methods - Theoretical example outdoor wireless environmental monitor.

Created; 17-02-2016, Update; 25-05-2018, 14-04-2018

Partly worked through example - outdoor wireless environmental monitor.

The peak detector circuits below are not straightforward because there is variable loop gain around the operational amplifier due to the non-linear nature of diodes or transistors used. Like other examples I have included components that compensate and other components to make the circuit function.

This example is worked through on a reasoned prioritised basis as opposed to a simple logical order. This priority based approach is necessary in order to create a natural flow so that fellow engineers can start there work soon. The method requires judgement based on an understanding of critical path analysis. It also requires that the designer plan to carry out techniques in shorthand that he is well experienced in doing in longhand. That also means the draft design will jump about ending with the most difficult work that is reckoned resolvable later and key component selection done as early as possible so the parts can be ordered soon to confirm what was expect of the part including that they can really be obtained.


  • I use words like Reckoning to mean judgement and calculation based on experience and handed down understanding.
  • How to read this article - Imagine doing many of the different things in the sections below but all at the same time.
  • I used CADSTAR for circuit and PCB design on this page. This is a medium performance CAD tool that is easy to start using and sophisticated so that doing good work is straightforward. 

A function based on the standard peak detector circuit below might be useful?
Peak detector (AL-0017-05A)
Link to models for this function
SiMetrix modelling CAD I have used is very straightforward 
basically also the addition of more component models.

Peak detector.
There are extra components such as C1, D2 and R4 to optimise the circuit stability therefore accuracy and bandwidth. The complication is that the loop gain changes because of the diode's variable impedance and consequently the circuit's bandwidth reduces as the input signal size reduces. 

Students do either jump back and forth or overly work on a small detail. It is usual for a kindly elder to watch out for these and advise the student to put it down and move on to another aspect for a while then come back to the problem later. It is also usual for an elder to advise a student to apply themselves and the elder may sit with that colleague to talk the problem through. The student and elder roles are always useful and can be interchange between engineers. It is of cause necessary for the engineer being mentored to say, not just now I need to work out what the question is? Conversely the question is never known clearly until the answer is found. This is a dilemma of problem solving.

Ultimately using good short cuts gets you to the best solution in the given time. But the design is finished when the assumptions have been stated the detail working out or discounted as a minor detail, reading and applying examples from data-sheets and all aspects fully. So keep notes such as;

  • a ToDo list - things noted as I am carrying out design work and deleted when done. Significant items listed for later.
  • a Mods list - recent changes only.
  • and brief design Notes of key design points that are kept as part of a set of design drawings or software files.
Full set of design files be kept elsewhere but these items be kept current for periodic maintainance. It is unlikely that any archive will be looked at except when major redesign is to considered.

------------------------------ Outdoor wireless environmental monitor example ---------------------------


ToDo - Running notes on scrap paper or design page in your CAD drawing kept with the drawings in progress.

Work in progress - this is as far as the article goes with this project.
CADSTAR 16 express - one of the router CAD tool screens. (AL-0016-06d)
  • Corrections, completion and more detail to follow.
  • Check temperature channels sampling speed interaction with power used (eg TX)
  • Check the frequency characteristic of the capacitors.
  • Check mounting holes and other component sizes and clearance.
  • Finally evaluate the vibration sensor circuit with a square-wave input and optimise the circuit for overshoot by changing and relocating the feedback capacitor.
  • Consider changing the transistor type to low noise flat gain that are likely to work at lower current?
  • Change the temperature reference resistors to 3K3 0.1%
  • Change the vibration circuit depending on the balance of time, risk and cost of purchase the pay for version of the circuit and PCB design tool you decide if you decide to go for a more complex but safe conventional circuit.
  • Substitute the vibrations sensor with a new type such as; PKGS-00LDP1-R
    • Post simulation refinements; In this case will be due to PCB capacitance that is not figured in the simulation. The circuit will most likely need the smaller capacitors to be increased or added by 5-100pF say, less or more depending on PCB layout. It is necessary to revise the component values when the real circuit board is made but before the Bill-Of-Materials is finalised. Therefore reassessing the values of the lower value capacitors empirically (trial and error).
    ------------------------------------------------------------------
    Description - Outdoor wireless environmental monitor.

    A piece of test equipment is required to work outdoors and monitor temperatures, vibration, air pressure and perhaps air speed. Battery operation is sufficient, designed to conserve power somewhat but not so much that the design work would be long, highly refined and minimised. This would not be a product for sale. Therefore some complication is in the electronics is okay if it saves software work.
     First sketch (AL 0016-01B)
    To start sketch a few things including circuitry from parts we have in the library then chat about it.

    In this case keeping the humidity sensor inside and fitting a flexible diaphragm was not pursued. Therefore keeping the design simple and also avoid calibration issues.

    Component selection; Wireless - Xbee module; 

    Thank you Digi International for the picture and 
    other support information. The gold circle is the
     antenna. The module's micro-controller is 
    underneath the best practical distance from
     the RF antenna.
    Digi Xbee wireless modules work well for this sort of application.

    I have used 2.4GHz short range (40M indoors or 120M in open space) Xbee radio modules. These modules have a serial port (TTL RS232) some digital I/O, SPI and some 10 bit analogue ports and you can configure the ports to trade-off for the desired combination of functions you require. These modules are similar to WiFi but are used for lower frequency signals.

    Low power 2.4GHz, Zigbee protocol sounds like the best option Xbee offer being a de-facto standard and fairly intentional modules.

    A pair or kit of these should be purchased, evaluated and development should start now;

    XB24-DMPIT-250 DigiMesh looks the most flexible but is proprietary though that would not matter. Mouser DigiKey £13 to £19

    XB24CZ7PIT-004 ZigBee can relay data through intermediate nodes and is called self healing is generic and slightly less flexible. DigiKey & Mouser £12 ea.
    http://www.digi.com/pdf/ds_xbee_zigbee.pdf

    XB24-API-001 XBee® 802.15.4 multipoint less flexible but looks adequate and it is generic protocol. This does not have the ability to relay data through intermediate nodes - so what, if they are near to each other and anyway consequently the behaviour may be the most predictable and least RF work load. Farnell DigiKey RS £13 to £18 ea.
    http://www.digi.com/pdf/ds_xbeemultipointmodules.pdf

    Note; there are very many other wireless network device around and also protocols. The board I have used as an example is well established with plenty of support. 

    Concurrently; 
    Concurrent meaning that all processes are carried out at the same time. Digital programmable logic
     carries out tasks concurrently but microprocessors carry out tasks or programmes sequentially.
    I am switching between tasks rather than designing concurrently but concurrently the other design aspects are in mind.


    The programmer should start studying the manual and developing program; http://ftp1.digi.com/support/documentation/90002002.pdf

    Notes from reading an Xbee module's manual at what looks possible and useful;
    • It appears that there is supply voltage monitor A/D channel. This is useful because there was no spare A/D channel or capacity in this evaluation version of the CADSTAR tool I am using to add more circuitry. In any case there is no intention to leave the module running more than a few days before recharging the battery's.
    • Turn on input pull up resistors as necessary in order to save adding resistors to the circuit.
    • Internal temperature channel is not available with the general purpose modules. But it is available with the PRO versions, I have read.
    • Because the board is only for internal use it can be patched if necessary. This would not be the case the the board were to become a commercial product. 
    These things need to be checked.

    And continuing with the hardware design;

    Sometimes I stop and contemplate my design rather than leap in and then leap back in again and undo it all.
    Other times I wish I had stopped longer to think first. Even-so it is necessary to weigh up and evaluate options.
     February 2016 with a Cannon IXUS 60, Crocuses by my front door step.
    There is a page on engineering management on my website.

    Component selection; Sensors;

    All the components could be susceptible to the radio fields from the Xbee module. So ensure that power rails and input output is has high frequency capacitor decoupling. R.C filter and that voltage level be set mid common mode voltage range to avoid any diode rectification of picked up emissions.
    • Motorola air pressure sensor - these are now made by NXP.
    MP3H6115A pressure sensor has a number of pins marked do not connect (this is not the same as no internal connection - that I tend to connect to 0V). Vs = 3V3, <8mA, O/p 47pF 51K.

    This sensor should be ordered now. Wires and decoupling attached when it arrives and evaluated for susceptibility to RF from the Xbee module when moved near to that module. A simple test that was little more than to see if the output changed when the unit was brought realistically near to the RF source and the pressure changed a bit.
    • PT100 temperature sensors on 4 wire cable + instrumentation amplifier. These will need good screening and/or filtering because of the cabling would act like an aerial. 

    Strategy for quick but confident design;

    The Wireless part; The easiest way to use the parts is to configure them to communicate openly to each other as they find others nearby but you can then use security to limit access as you get familiar with the modules.

    Electromagnetic compatibility and good general filtering; Bandwidth limit, use digital filtering and for the Xbee module located on two rows of pins with 100nF and 1nF capacitors on power and analogue signals next to the pins.

    Motorola air pressure sensor - we can solder wires to pins and connect a Digital Volt Meter to the output, decouple the power and wire it to a power supply and then see that the output voltage is as expected and that it changes with pressure and how close to the Xbee module it can be put without being adversely effected.

     It turns out that this component works fine.

    There is more on testing strategy's similar to this evaluation on my website.
     I quickly tested and observed the correct output and an output change from
     approximately known inputs (atmospheric pressure, change and varying RF field)

    Metal canning for the electronics - Decided to risk not fitting any canning but surface mount all the components under the mother board and the Xbee module on top. In any case we could probably retrofit canning if the idea does not work out it is not going to be smart unit for sale ever anyway.

    The analogue inputs have no additional special measures. There are series resistors and capacitors for each analogue input of the XBee module.

    Temperature sensor 
    Now we can do some more component selection and review the design.
    Circuit above was created with CADSTAR 16.0 Express but the number of components used is 
    too high for this limited capacity free tool. The PCB may be as small as 60mm^2 (AL 0016-01B)

    A price for PCB's for say 3 or more should be obtained now and all the detail required clarified so that a decision to continue or not can be made promptly.


    The humidity sensor was abandoned; There was not capacity within constraints of the limited capacity CAD. The mechanical design should ensure that is adequate ventilated to atmosphere without risk of the sensor getting wet was another issue.

    Vibration sensor  - There is an analogue solution but a better Digital solution could be developed instead but in this case that is likely take more time.
    • The digital solution relies on already having some developed routines plus a chosen micro-controller start up code. But then it would be straight forward. We do not have these things though.
    • Here is a preview of some ideas that I may develope later but I have some other work to do first.
      • Use a simple two diode voltage doubler full-wave rectifer with a forward bias resistor to a negative supply to do the rectification. Duplicating the rectifier but with no input to provide some temperature compensation.
      • Electronics - Peak detector  circuits and models
      • Electronics - Peak to Peak detector  circuits and models
    Also do some more work on the temperature sensor now we can see how things are fitting together.
    ----------------------------------------------------------------------

    The enclosure;

    Revised enclosure proposal (AL-0016-02b)

    Having listed and decided on sensors see below the enclosure shown above and deciding which functions to provide can be set or set aside for now.

    --------------------------------------------------------------------------------------------------

    Coming back to temperature function again;

    Review modelling to determine the approximate accuracy then revise the circuit and consider that new design.

    Temperature measurement function software work load;

    Look at circuit settling time and optimise for accuracy. there is an optimum fast and the circuit will be susceptible to moderate frequency noise too slow and the circuit will be susceptible to low frequency noise such as thermal drift.

    The Xbee module;

    See spreadsheet; Xbee module pinout

    All unused pins can be left not connected - some have pull up resistors (check this).

    Microprocessor used is; MC9S08QE32 (Motorola) now NXP These were leading edge products in there time, that means that the design process was then longer but on the other hand the part was lead in being low noise, wide temperature range and is now very cost effective, simple, highly refined structure and are well established now. The Cosmic C compiler produces very robust code that you can not put a razor blade between the expectation, the output when audited with PC Lint and what the part does. The on-chip one wire emulator runs the code you complied not special debug code so when it was developed 20 years ago was a very special feature of Motorola product and now is very well established.

    #RESET  - demo board uses an RC. This aspect of the microcontroller's data sheet is not clear you find that with Motorola good English writing but does not does not quite tell you precisely. but I know from using other parts that it most likely does need a reset signal to be input.

    There are a number of historical perspectives like this one on Motorola on my website.
    The plan is to fit 1nF filter capacitors to the connector pins but 
    not show them on the circuit because there is no capacity within
    this limited version of the CAD for doing that. (AL-0016-03b)
    -------------------------------------------------------------------------------------

    Whilst working through the circuit design I am breaking off and doing some PCB work primarily optimising component and perhaps track layout of each function block. There is more work pinching components from the design in order for the design to fit in this limited version of the CAD tool.

    The PCB is much bigger than how it will finish in order to make the initial design work easier. There is enough space to work on each circuit function then placing and optimising. Meanwhile this method helps me see and review all design aspects including RF fields susceptibility.
    ---------------------------------------------------------------------------------

    Component selection - other parts;

    PKGS-90LD-R Vibration sensor - the part is in my library but is now obsolete.

    85.7 f/C per m^2/s or 0.84 pC/G, 770pF, >500MR. Looking at the graphs the frequency response falls below 15Hz but there is a worthwhile frequency response at <5Hz.

    TP36 temperature sensor with shutdown. - Removed following first draft circuit in favour of a multichannel PT100 type temperature measurement.

    TS9011SCX 3.3V reg. 17p 50 off

    ZXCL330H5TA 3.3V reg with enable. 35p 10 off.
    • It is stable with a low ESR capacitor according to the data sheet. (this point checked after the final PCB layout because a COG/NPO 1nF capacitor is routed close to the regulator)
    • Is a lower voltage drop regulator/reference.
    S-80922CNMC-G8ST2G-ND      reset generator
    • Not used based on the Microprocessor and Xbee module datasheet review.

    MAX6596     ovp

    Change op-amp to:
    MCP652 MCP662   op-amp. Estimated max Ib is not given but the typical figure at 85'C may be good enough estimate for say 50'C and is; 130pA (typically), offset 200uV (max), 50MHz.

    The components that would be on a long delivery or there is little doubt about should be ordered by now. 
    --------------------------------------------------------------------------

    The peak to peak detector below (mid right) has ambiguous two feedback paths but this allows us to do some arithmetic whilst thinking how to implement a feedback switch or another solution. This design would fit within the CAD design limit. The problem could be resolved by using a conventional half-wave peak detector for example that would only capture peaks of one polarity.
    The vibration sensor function (middle right) of this circuit is more complex gives less information
    (there would be no spectrum analysing option) but the software is easer because not so much data
    needs to be collected or processed. The circuit is a positive and negative peak detector. (AL-0016-04c)

    This design for this vibration function would not work but the problem is put aside for now to be resolved later. Meanwhile we can work on the arithmetic based on what we have so far this should give us more clues on viability whilst considering how to resolve the problem.
    ------------------------------------------------------------------

    An engineer can apply worst case design tolerance and by using a statistical approach ensure that most product when assembled will work. That is close to how raw material and measured parameters come from nature and are first processed for use! But supplied components are made and specified, precisely and consistently with all components meeting there tolerance specified this is how electronics has changed since 1980.

    Solving complex resistor networks by trying standard value components in your equations and seeing. But first do the maths and solving Maxwell's circulating currents using Superposition can be done but rationalising to simpler Norton's current source or Thevenin's voltage source equivalents is usually quick. Therefore find the easiest way to see and apply maths to an electronic functions in order to work out the desired resistors ratios. But to come back to the first point the a resistor network needs to be solved to use standard value resistors that satisfactorily meet the design tolerances. That tolerance met by summing squares (of the errors) and this is called least squares. I have done this and it is powerful but it is rarely necessary because simple circuits are mostly adequate to get usable data into a microprocessor and then the arithmetic is carried out in that microprocessor precisely.

    A complex but known and understood electronic solution may be used because the software will take longer to be developed. This can infuriate a hardware engineer until he understands why and then he may offer a hardware solution if it is apparent that software work will be high. I do write software or software like programs to illustrate a point if the hardware solution is less than ideal. Do use embedded timers and insist on using interrupt routines to ensure that the desired activity is regular and precise with no missed or unduly delayed input or output events. That usually means that firmware must operating underneath the user interface. 

    Anyway you can do things in software such as precise period of time averaging, mode filtering that are more desirable than a simple exponential (tailing off) filter that hardware averaging will do.

    To sum up; By applying a standard deviation test will give you a small failure rate and an occasional super product in a predictable way this is the traditional approach. It is now possible to buy close tolerance components very cheaply and these do not have a traditional normal tolerance distribution so there will be no out of tolerance parts in a batch:- so simply add up the worst tolerance parts errors and put in a small margin for the remainder that you judged is trivial and everything will work out fine and that is a reasonable expectation.
    --------------------------------------------------------------------------------------------------


    During the 1970's I attended a technical college where working to two or three decimal places was required but not to five places. The effort was not required was the point of the lesson and to add to that point is a distraction from the flow of thought. But students had calculators - the Commodore scientific pictured is excellent American product and much like many UK products were. The best key entry with tactile feel I have ever used.

    The use of approximation is usual taught to engineers. For example say 1.2 or say 1.23 instead of 1.2299' unless you want to indicate precision. Or say 75 even though the answer 74 can be seen easily to reinforce the point you do mean approximately in discussion. In modelling I apply what I learnt, that is to first use an approximate equation for a circuit then come back and improve it once it can seen how the circuit works more clearly and to achieve the required accuracy - as I have done.

    What I am doing in applying maths to my electronic problem that is not necessarily correct but will do for now. Ultimately a judgement for each part of the design will be made in order to complete the work in a timely manor and an engineer will keep reviewing and improving the maths and the circuit until what is required is adequately achievable.

    There is more on my website about human factors in achieving design success.
    -----------------------------------------------------------------------------------

    Vibration sensor arithmetic;

    Holding capacitors;
    • The series resistor for the A/D is 5K set by the A/D's input leakage. If we were to compromise the performance to get less than 1000;1 the capacitor leakage needs to be > 5MR. What ceramic capacitor would that be?
    Kermet XR4 package 1206 is at least; 500MR.uF therefore up to 100uF capacitor could be used (with no margin).
    • Time constant; 500mS = 5K x 100uF. 
    50mS would be okay so let us split the difference and try 22uF. This gives us 100mS time constant.

    Would need to be sampled every 20mS (assuming 5 time constants would be enough) but missing some data and sampling less frequently may be adequate we could abandon this function at this stage it is taking some time?

    Kermet CL31A226MOCLNNC (better insulation resistance spec. than others at; 50MR ), 0805, X5R, 22uF 10V, +-20% (need to change the footprint and part on the PCB) is stocked in RS 891-9801 at 14p, 20 off.

    This looks wrong - driving a 22uF at 1KHz say would require a lot of current? (this is not serious at this stage because a lower value capacitor with the same footprint can be fitted)

    Holding capacitors effect on bandwidth;

    The op-amp MCP662 can drive >+-40mA But the curves only go as far as 10mA. The circuit was changed because of the flaw noted and transistor B-C junction will used as a diode but we must take care to select a transistor that will handle the maximum current which is op-amp output current of 150mA.

    From; i=C.dv/dt, Then; dv/dt = i/C
          dv/dt = 10mA/22uF (20mA typically)
          1V/2.2mS

    This is equivalent to turning 90' of a sine wave into a simple ramp. To find the maximum frequency limit multiply by 4 (4 x 90' is 360')

     About 100Hz = 1/(2.2mS x 4) - this looks rather a low frequency but may be okay. It is likely that the vibration sensor function would not be perused at this point because

    From above;  but try 4u7F
           dv/dt = 10mA/4u7F (20mA typically)
           1V/470uS worst, 1V/230uS typically.

    This increases the frequency to; 500Hz - 1KHz. (this is a useful frequency range but the circuit board - see below will need to be made stiffer by adding mounting holes)

    Holding capacitors time constant;

    Time constant; 2.5mS =  470nF x 4K7 this is very short and the A/D converter will need to be sampled every 250uS. This is not giving us an improvement over simply feeding the amplifier into an A/D channel.
    • Check to see the A/D sampling rate can be reduced and if so can the input series resistor be increased? Thereby increasing time constant. Unfortunately the microprocessor's datasheet gives no indication that this is possible.
    • But the number of bits accuracy can be sacrificed so that the input impedance can be increased.
    We need another solution and later on another solution does come to mind. See the last circuit that is at the bottom of this page. The solution may be;

    The hold capacitor loading resistors have been moved to a high voltages so that a more constant and small bleed current discharges those capacitors.
    • We do not know what the firmware in the Xbee module does but we do know that Vref can be; 1.8V to VCC, 12 bits and 2K series resistors are recommended for the microcontroller. But the module data sheets specifies; 4K7 and 10 bits accuracy.
    • From the microcontroller data sheet, We can calculate that the A/D's input current that would case a quarter bit error is; 375nA=3V/(4000*2K).
      • That is for our desired 3Vref.
      • We could reduce that for 10 bits to <100nA but we need to add on the transistor leakage current of 1nA to 100nA or more. So we use the figure; 375nA 
    • The resistors value that would draw this current from half minimum supply 1.5V is; R should be less than; 4MR = 1.5/375nA
      • An allowance should be added for the transistor and feedback resistor current. This would be less than 1V/3M9 say would add another 250nA (this will need to be considered again)
      • The total capacitor bleed current is; 600uA = 375nA and 250nA. Rising towards 1uA at maximum voltage swing (a case that is less important and is discounted). 
    The new time constant is;
    • For C = 4.7uF 
    When i=C.dv/dt. And therefore dv/dt = i/C.
    • . dv/dt=600nA/4u7F 
    Gives; 127mV/Second
    • Or 7.8mS/mV Corrisonds to 7.8mS per 0.1G
    Op-Amp stability
    • Op-amp datasheet Graph 4-7 suggests that the op-amp is stable with 2R for capacitors of >=10nF but the transistors provides resistance if it is needed anyway.
    • We work on the peak to peak detector but in the end find that the circuit can not be optimised to work over the signal amplitude range desired. At that stage the circuit board has been ordered and the designer has continued to work on component optimisation. The circuit is eventually likely to accurately record large vibration signals and this is useful.

    Change; R3 and R8 to; 10R or 0R (as shown or none)
    Change; C10 and C11 to 4u7F footprint 0805 (not shown in the section of the circuit above but is at the a/d vibration inputs)

    **** Put this hold up time problem aside and check some other aspects. ***

    Minimum frequency

    The minimum frequency of the circuit is; 5Hz = 22K * 1u5F * 2.pi (this calculation was carried out later and the capacitor changed in the final PCB see below)

    The ceramic capacitors have a temperature coefficient and X5F is about 10% over the temperature range. I have not checked this but selected a reasonable plastic capacitor. Temperature fluctuation would introduce thermal noise into the low frequency small vibration sensing. The temperature coefficient of the capacitor should be checked.

    Circuit accuracy and bandwidth due to operational amplifier gain bandwidth product - but without the holding capacitors

    The maximum frequency of the circuit due to feedback RC is75KHz = 2M2 * 1pF * 2.pi. (this capacitor may be changed)

    After doing some arthritic and coming back around again the assumptions become clearer and they should now be stated or amended therefore;
    • The loop gain is the ratio of the output to input voltages.
    • But in the large signal case the gain is 10 (this has been changed from 100 compared to the circuit above) 
    • And the loop gain is still the ratio of the output to input voltages but simply that in the small signal case.

    The op-amp's Gain Bandwidth product is; 60MHz

    For the large signal case the gain approaches 10 100 this gives a a bandwidth of 6MHz and accuracy to 1% up to 60KHz.

    For the small signal case the total diode drop is 2V 500mV  For 1mV input change (1G) the loop gain is 2000 = 2V/1mV and the bandwidth is 30KHz = 60MHz/2000 this gives an accuracy of 1% up to 300Hz.

     The performance of the Vibration sensor circuit is still not modelled because we do not know the size of the stabilisation capacitor. But we have a reasonable estimate.

    It is reasonable to say that my workings out are unclear at this stage. I have come back and improved the working and the circuit function. So now I have a good feel for the circuit. Peak detector circuits are slower than would seem at first in any case and this is because of the variable gain introduced by the diode(s) and the need for stability in all cases.

    This is a screen print and shows design rule errors outstanding (AL 0016-04c). I have added 0V plane
     underneath next to the connector so that i/o 1nF COG/NPO capacitors can be added. That 0V plane could
     be increased underneath and would be beneficial provided that many vias are added.
    More consideration on saving components;

    The PCB is more developed and some other aspects have come to more clear whilst working on the circuit. so the designer would go back to temperature and change the reference resistor to a single 110R 0.1%.

    Vibration sensor 1;

    Use a simple op-amp amplifier as in the first circuit followed by a double diode rectifier and a negative current bleed from a negative supply.

    Fit a second double diode to partly correct the large errors introduced by the variable diode voltage drop. This will need a current source resistor bleeding current from an appropriate supply.
    • Check offset error only typical is given; at 1mA is 75mV to 250mV (125'C to 25'C) and at; 10mA is 240mV to 300mV
    This is not worth pursuing. But this gives me another idea.
    Bandwidth may be improved but the accuracy would be poor. 

    Vibration sensor 2;
    Remove the input capacitor and move the sensor to the negative input.
    This helps and also adding a buffer amplifier also helps it can be seen by modelling. Keep this change in mind if it can be fitted a smaller decoupling capacitor could also be used conveniently. This turns out later to be necessary.

    Vibration sensor 3;
    Change the rectifier to a half-wave peak detector. This will introduce the op-amp offset of 8mV (8G). Two of the feedback components can then be saved if other calibration were added. The error turns out to be potentially less with (2) combined with using a a lower offset op-amp eg MCP651 or OPA365.

    Do not make this change but keep it in mind. 
    • But a DC non-symmetry now recognised due to the op-amp offset can be corrected by taking out the centre split two resistor network and replacing it with a single resistor.
    • The feedback needs to be switched and come from the diode that is conducting otherwise the arthritic is wrong or at least unclear.
    Whilst working on the PCB etc. a solution to the flaw in the vibration rectifier came to mind. A combination of these ideas led to a better solution.

    Vibration sensor function flaw in the can be resolved by this proposal;

    • Consider changing the double diode for an NPN and a PNP transistor to switch the feedback and also rectify.
    • Arithmetic will be the same but the circuit will eventually match the arithmetic expectation. 

    Revised Vibration sensor. The transistor shown have been changed from place holders.
    The designer now needs to select a switching transistor for low saturation voltage but
    must instead select transistors for adequate base current handling. (AL-0016-05b)

    There remains some undefined Xbee module pins. These will need to be dealt with later by suitable patching.

    Place holder transistors BC847 and BC857 were compared for saturation voltage with others. Many manufactures used to make switching transistors for example Ferranti used to make Digital to Analogue converters and other analogue IC's that contained BJT's with an on voltage drop of 1mV or less in about 1980. Diodes Ltd who now make those transistors may have something? Others are; Motorola now OnSemi, NXP and Fairchild also make specialised transistors.

    PNP:
    BC857
     - Base current maximum is; 100mA (pulse 200mA C or B) - Assume the same as the collector current.
     - Saturation does not fall below 40mV typically.

    DSS5220V Zetex
    • Curves give < 8mV at IC < 5mA
    • Ib 300mA pulse 600mA.
    FMMT717 Zetex
    • <17mV sat. Curves give; <1mV at IC <1mA.
    • Ib.max = 500mA
    • No footprint change.

    NPN:
    BC847 similar spec. to its complement BC857
    FSB619 Fairchild low saturation switching;
    • <20mV, typically <10mV gain 10 at IC=10mA. 
    • Base current is not given but the collector current is 2A max. and Ib is graphs go up to 200mA.
    DSS30101L Zetex
    • curves give <<20mV at IC<=10mA, gain 10.
    FMM617 Zetex
    • <14mV sat. Curves give; <2mV IC<10mA
    • Ib.max = 500mA.
    • No footprint change.
    The transistor solution should give a nice progressive change over from feedback from each polarity. But it is difficult to fathom out (to use a word meaning experience) The circuit will work well but may not have the bandwidth first envisaged.

    Both transistors have a high collector leakage current of 100nA at 25'C. Worst case is not given but a typical value of is 1nA given. It is likely that leakage current will double every 11'C to 7'C (at higher temperatures).  This is not good but is what we have to work with at the moment.

    The PCB could now be ordered and any remaining parts. But there is risk.

    In the mean time FMMT717 and FMM617 Zetex should be obtained and evaluated.
    • The PNP transistor; 
      • Connect the base to 0V and wire a 3M9 between the collector and a 2V supply.
      • Repeat the first step but with the collector resistor reduced to; 100R.
      • Connect a 47M between the emitter and a 2V supply.
      • Connect a high impedance voltmeter (DVM) between the C and E to measure the turn on voltage.
    • Repeat the test with the NPN transistor but with a -2V supply.
    The conclude will tell us whether the peak detector circuit will work or whether to omit components and directly connect the vibration circuit to an A/D channel. The alternative plan. The drawback would be the extra software work that I was trying to avoid.

    Having done the component selection here is some modelling using spice tools. That I could have done with vero-board or PCB design then modified and may be the best way of doing this work.

    But on returning to this function in a real case I would not have developed the idea as far but would have gone quickly to one of the conventional circuits such as the circuit at top of the page. The problem was also that I was trying to make this board using limited capacity free evaluation CAD tool. Although I have almost eliminated the need for this test following spice modelling of other variants of this circuit I am not really sure if the model is over pessimistic about the design. I could go back and argue for simply spliting the design into two boards.
    -----------------------------------------------------------------------------------------------------------------

    We can now check on other lower priority things.
    • The pressure sensor MP3H6115A warm up time is; 20mS So turns out to be almost trivial as far as power saving circuitry usefulness.

    This is the likely final circuit when the PCB has been made;

    The Vibration function has been rationalised. The buffer amplifier is not very necessary and is half a dual op-amp so is it included at marginal cost (AL-016-06d)

    Vibration function;

    • Depending on which version of the PCB was finally ordered some changes may be necessary and in the main just requires components be fitted between different pins that originally designed for. 
    • Some components not fitted.
    • But the most inconvenient is track cutting and thin wire addition.
    • Because of the change to transistor for rectification the realistic output voltage swing is reduced to 300mV - 500mV and that would give a maximum of 3G. Therefore the gain should be reduced by 10. {This change has been incorporated see above}
    • Move the loading resistors to a high voltages so that they form a small current bleed. {This change has been incorporated see above}
    • An allowance should be added for the transistor and feedback resistor current. (This has been incorporated above and will need consider again)
    If the circuit board has not been ordered then the arithmetic carried out above can be scaled to evaluate other solutions now that we have ball park design expectations. See below
    -----------------------------------------------

    The function blocks are all derived from standard circuits, application notes or in the case of the full wave peak vibration detector above, I have not used the circuit as shown.  The vibration peak detector case this type of function is generally not that accurate without some extra components that I have shown below appear to mitigate some of that risk. Resulting in a design may work well. I have also modelled some more conventional circuits see below and they may also fit on the PCB within this free limited version of the design CAD will allow. 
    Peak to Peak Detector    Link to models for these circuits
    Tina-TI model. This circuit model now works well and it is likely that the circuit will work as well as the conventional diode peak detector circuit at the top of this page? The added components probably means that this novel circuit is not viable though. (AL-0018-04B)
    • The full circuit with fixes to keep the component count down below 50 parts and at present has 46 parts. 
    • The above circuit would replace a dual op-amp with a quad op-amp and then requires 3 extra parts. This variant looks practical.

    The conventional dual peak detector circuit; above (AL-0020-05B is similar to AL-0018-02K),
    • It uses five extra parts including a quad op-amp that will also need an additional decoupling capacitor but removes two parts. The two diodes replaced by a BAV170 dual common cathode diode. So it looks like 3 extra parts are required so; This option might just fit.
    • The two A/D inputs then taken from the virtual 0V and the Output. 
    • U5 buffers at the output and would allow R8 to be increased to say 100M and C2 reduced to 220uF, this could reduce leakage. The resistor would be larger 0806 to 2512.
    • A bandwidth improvement would also be achieved by using the spare op-amp to buffed C2 and thereby allow C2's value to be reduced and R8's value increased.
    • There could ideally be 2x R + C into the input of the Microcontroller's A/D section of the data sheet says these are not always necessary - this will be the deciding factor on whether this option cap be used.
    Full wave rectifier and peak detector; This option also requires input amplifier stage = 3 parts, the op-amp changed to a quad op-amp. This circuit is a merging of  two conventional functions. The disadvantage is that this solution has a smaller output signal. (AL-0017-02B)
    •  Two parts are removed compared to the full circuit leaving us with up to 6 parts we can add.
      • 3 parts need to be added for the added input amplifier, 
      • Plus 5 parts for the circuit shown.
    • This option is not viable because of the high part count.
    +++ This circuit is based on a precision full-wave rectifier and can output rectified average. This is not what was required so the circuit was modified by adding D1/D2 and R3 plus C4's value is high. +++
    In the case of a real PCB that is different to this but uses similar filtering strategy; The temperature and other circuits worked fine with a mobile phone brought as close as 50mm to the circuit board but became inaccurate when the phone was brought to 25mm to the board.
    -----------------------------------------------------------

    Conclusion

    This design example has been worked through put in greater detail than is normally necessary. The points would be covered or note that have been dismissed or are unlikely to be worth the time working through. These can be consider for a revised design later. In this way the risk of misunderstanding and design failure is very low. First time right is a traditional and a good strategy I recommend but I do not recommend over engineering as doing such does not necessarily do what is necessary and expected. 

     
    These photographs were taken sitting on my front door step.

    This sort of engineering by pragmatic judgement, calculation and freedom for incite to happen is what distinguished British Engineering. There is less and less of this style permitted and in any case it seems war and money making are what drives UK. With that has been let in by political desire is risk aversion, insurance, the old forgotten cliché' US "suing culture" and other parasitic motives. See various projects (including on Dr Who and how TV has changed) on my website and I particularly recommend items on Temperament know for thousands of years and helps explain the differences in people that culture does not always explain.

    Associated pages with more details;
    Also see; http://www.andrew-lohmann.me.uk/engineer

    Please comment below - Alternatively comment generally on my electronics; Electronics Discussion

    Back to; Electronics, Software & Robust Design

    1 comment:

    1. The temperature measurement design has been moved to a new blog page.

      ReplyDelete