Created; 17-02-2016, Update; 08-05-2025, 10-05-2025
This blogger page does not display all pictures in some web browsers but at the present time current version of Edge seems to work in May 2025.
Partly worked through example - outdoor wireless environmental monitor.
This example is worked through on a reasoned, prioritised basis as opposed to by a simple logical order. This priority-based approach is necessary to create a natural flow so that fellow engineers can start their work soon. The method requires judgment 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 expected of the part, and that they can really be obtained.
- I use words like Reckoning to mean judgment 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, C1, D2 and R4, to optimise the circuit stability to achieve accuracy and good 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 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 interchanged between engineers. It is, of course, 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 shortcuts gets you to the best solution in the given time. But the design is finished when the assumptions have been stated, the detailed working out or discounted as a minor detail, reading and applying examples from data-sheets and all aspects are fully covered. So keep notes such as;
- A To-Do 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.
------------------------------ Outdoor wireless environmental monitor example ---------------------------
ToDo list - 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) Circuit Diagram (not used) |
- 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 types 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 vibration 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).
------------------------------------------------------------------
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 complications in the electronics are okay if they save time, such as software work. A similar design was used on a micro wind turbine project in 2009.
To start, sketch a few things, including circuitry from parts we have in the library, then discuss the plan. In this case, keeping the humidity sensor inside and fitting a flexible diaphragm was not pursued. Therefore, the design became simpler and also avoided some calibration issues. The battery charging from the anemometer was removed, and the vibration sensor was enhanced by adding a very simple rectifier so that the wireless bandwidth could be minimised, but the component count was kept within the capacity of the free limited CAD.
![]() |
First sketch (AL 0016-01B) |
Component selection: Wireless - Xbee module;
![]() |
Thank you, Digi International, for the picture and
other support information. The gold circle is the aerial. The module's microcontroller is underneath as far from the RF aerial as practical. |
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 Wi-Fi but are used for lower-frequency signals.
Low power 2.4GHz, Zigbee protocol sounds like the best option, Xbee offering 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 devices around, and also protocols. The board I have used as an example is well established with plenty of support.
Concurrently;
Low power 2.4GHz, Zigbee protocol sounds like the best option, Xbee offering being a de facto standard and fairly intentional modules.
A pair or kit of these should be purchased, evaluated, and development should start now.
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 devices around, and also protocols. The board I have used as an example is well established with plenty of support.
Concurrently;
The design process was continued while the parts were ordered. That is, I am switching between parts of the job using the breaks to consider my next step while I am working on other aspects.
The programmer should start studying the manual and developing the program; http://ftp1.digi.com/support/documentation/90002002.pdf
Notes from reading an XBee module's manual on what looks possible and useful;
- It appears that there is a 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 batteries.
- Turn on input pull-up resistors as necessary to save adding resistors to the circuit.
- The 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 testing, it can be patched if necessary. It will not be resold.
These things need to be checked.
And continuing with the hardware design;
Here is my page on engineering management
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 have 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 several 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 are attached when it arrives and evaluated for susceptibility to RF from the XBee module when moved near 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 the cabling would act like an aerial.
- See: Electronics- Temperature measurement (resistor networks) - The temperature measurement circuit design is on another page.
Strategy for quick but confident design;
The Wireless part: The easiest way to use these modules is to configure them to communicate openly with 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. In retrospect these additional filter capacitors are probably not required.
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 strategies 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 motherboard 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 the 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.
The circuit above was created with CADSTAR 16.0 Express, but the number of components used
is too high for this limited-capacity free tool, so some filtering at the temperature input mux was
reduced. The PCB could be up to 60 mm^2 (AL 0016-01c).
A price for PCB for say 3 or more should be obtained now, and all the details required clarified so that a decision to continue or not can be made promptly.
Temperature sensor
- The first draft temperature measurement circuit is at the top left corner of the diagram above. It is expanded so it can be seen more clearly at Electronics- Temperature measurement (resistor networks)
The temperature circuit is changed to three channels instead of two, see AL-0016-02b The 8 input filter capacitors on the left are placed best, but the circuit has been compromised to 2 input filter capacitors. but in mitigation, the mux switch is an ESD protected type.
Vibration sensor - There is an analogue solution, but a better Digital solution could be developed instead, but in this case, that will likely take more time.
- The digital solution relies on already having some developed routines, plus a chosen microcontroller start-up code. But then it would be straightforward. We do not have these things, though.
- Here is a preview of some ideas that I may develop later, but I have some other work to do first.
- Use a simple two-diode voltage doubler full-wave rectifier 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.
- The simple half-wave rectifier at the top of this page should be sufficient.
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 the temperature function again;Review modelling to determine the approximate accuracy, then revise the circuit and consider the new design.
Temperature measurement function software workload.
Look at the 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.
Look at the 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.
- As before, see Electronics- Temperature measurement (resistor networks).
The XBee module.
All unused pins can be left unconnected - 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 compiled, not special debug code, so when it was developed 20 years ago was a very special feature of Motorola products 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 it 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.
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).
The PCB is much bigger than it needs to be to make the initial design work easier. There is enough space to work on each circuit function, then place and optimise. Meanwhile, this method helps me see and review all design aspects, including RF field susceptibility.
PKGS-90LD-R Vibration sensor - the part is in my library, but is now obsolete.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 compiled, not special debug code, so when it was developed 20 years ago was a very special feature of Motorola products 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 it 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 many historical perspectives like this one on Motorola on my website.
The PCB is much bigger than it needs to be to make the initial design work easier. There is enough space to work on each circuit function, then place and optimise. Meanwhile, this method helps me see and review all design aspects, including RF field susceptibility.
---------------------------------------------------------------------------------
Component selection - other parts;
85.7 f/C per m^2/s or 0.84 pC/G, 770pF, >500MR. Looking at the graph, the frequency response falls below 15Hz, but there is a worthwhile frequency response at <5Hz.
ZXCL330H5TA 3.3V reg with enable. 35p 10 off.
- It is stable with a low ESR capacitor according to the data sheet. (This point was checked after the final PCB layout because a COG/NPO 1nF capacitor is routed close to the regulator)
- It is a lower voltage drop regulator/reference.
- Not used based on the Microprocessor and Xbee module datasheet review.
Change the op-amp to:
MCP652
The components that would be on a long delivery or there is little doubt should be ordered by now.
--------------------------------------------------------------------------
The peak to peak detector below (mid right) has two ambiguous 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 analysis option), but the software is easier because less data
(there would be no spectrum analysis option), but the software is easier because less data
needs to be collected or processed. The circuit is a half-wave positive peak detector. (AL-0016-04d)
Vibration will only be sensed from one direction if this is considered not adequate for safety monitoring then a multi-axis MEMs sensor ic will need to be used this connected via a serial interface to the wireless module. Meanwhile, we can work on the arithmetic based on what we have so far, which should give us more clues on viability, whilst considering if there is a 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 electronic functions to work out the desired resistor
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 is 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 develop. 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 the firmware must
operate 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,
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 usually 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 I can see how the circuit
works more clearly, and to achieve the required accuracy, as I have
done.
What
I am doing is applying maths to my electronic problem, which is not
necessarily correct, but will do for now. Ultimately, a judgement for
each part of the design will be made to complete the work
in a timely manner 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.
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 electronic functions to work out the desired resistor
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 is 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 develop. 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 the firmware must
operate 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,
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 usually 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 I can see how the circuit
works more clearly, and to achieve the required accuracy, as I have
done.
What
I am doing is applying maths to my electronic problem, which is not
necessarily correct, but will do for now. Ultimately, a judgement for
each part of the design will be made to complete the work
in a timely manner 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.
-----------------------------------------------------------------------------------
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 electronic functions to work out the desired resistor
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 is 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 develop. 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 the firmware must
operate 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, 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 usually 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 I can see how the circuit
works more clearly, and to achieve the required accuracy, as I have
done.
What
I am doing is applying maths to my electronic problem, which is not
necessarily correct, but will do for now. Ultimately, a judgement for
each part of the design will be made to complete the work
in a timely manner 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.
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;
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. Likely, the vibration sensor function would not be pursued 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 the capacitors' time constant;
- 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 of 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 high voltages so that a more constant and small bleed current discharges those capacitors.
The hold capacitor loading resistors have been moved to 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
- . dv/dt=600nA/4u7F
Gives; 127mV/Second
- Or 7.8mS/mV Corresponds 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 provide 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 is; 75KHz = 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 the 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
For the small signal case the total diode drop is 2V
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 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-04d). 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.
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
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.
The vibration sensor function flaw 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 has 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 remain 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 manufacturers 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:
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.
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 the graph that goes 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.
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 a risk.
In the meantime, 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 conclusion 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 maybe 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 the top of the page. The problem was also that I was trying to make this board using a 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 splitting the design into two boards.
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 maybe the best way of doing this work.
- Electronics - Positive and negative Peak detector circuits and models
- Electronics - Peak detector circuits and models
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 the top of the page. The problem was also that I was trying to make this board using a 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 splitting 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 it is 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 were 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 voltage 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 to be considered again)
-----------------------------------------------
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 for 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 that may work well. I have also modelled some more conventional circuits, see below, and they may also fit on the PCB within the 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 the circuit will likely work as well
as the conventional diode peak detector circuit at the top of this page? The added components probably mean 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 are 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.
- 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 input amplifier.
- Plus 5 parts for the circuit shown.
- This option is not viable because of the high part count.
-----------------------------------------------------------
Conclusion
This design example has been worked through in greater detail than is normally necessary. The points would be covered, or notes that have been dismissed or are unlikely to be worth the time working through. These can be considered 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 good strategy I recommend, but I do not recommend over-engineering, as doing such does not necessarily do what is necessary and expected.
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 drive the UK. 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, known for thousands of years and helps explain the differences in people that culture does not always explain.
Associated pages with more details.
- Electronics - Peak detector circuits and models
- Electronics - Peak to Peak detector circuits and models
- Vibration monitor: Digital solution
- Electronics - Simulation and Judgement LT Spice simulations.
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
Please comment below - Alternatively, comment generally on my electronics; Electronics Discussion
Back to; Electronics, Software & Robust Design
The temperature measurement design has been moved to a new blog page.
ReplyDelete