Today I got an email from Mouser. They cancelled my Melexis sensor order...
Dear Mr ...,
First of all I would like to thank you for your order!
We have received information from the manufacturer Melexis that due to the worldwide situation and high demand of the temp. sensor 482-90614ESFDCI000SP an allocation status has been created and therefore first the medical applications will be supplied and orders of other private use have to be cancelled.
Unfortunately I have to inform you that we have to cancel the above order.
Before I start programming, I thought about how the graphical user interface could look like. I decided that the time and date cannot be set manually. It always annoys me when I have to set a clock manually. I use TimeSerial here. To do this, the thermometer is connected to the computer via USB and then a small Processing program is called. One mouse click and the current time and date on the computer is transferred to the thermometer. Details can be found here.
Intro starts when the ON-button is pressed.
After the intro, the main menu is called up, through which sub menues you can scroll by moving the joystick to the left or right. If the center button on the joystick is pressed for sub-menu "OFF", the device switches off. The device also has an automatic shutdown. If the joystick is not moved for two minutes, the device will also switch off, no matter if you are in the main menu or a submenu.
Sub-menu "MODE", which can be accessed by pressing the center button on the joystick. Here you can choose between ear or temporal artery temperature measurement.
Sub-menu "UNIT", which can be accessed by pressing the center button on the joystick. Here you can choose between °C and °F. Default setting is °C.
Submenu "CLAS", which can be accessed by pressing the center button on the joystick. Here the thermometer asks questions about symptoms and calculates how likely it is that you have caught a flu or cold.
Submenu "TIME", here you do not need to press the center button on the joystick. The time is shown immediately in the upper left corner of the display.
Submenu "DATE", here you do not need to
press the center button on the joystick. The
date is shown immediately in the upper left
corner of the display.
Self-tapping screws, M2 and M2.2, in various lengths are required for assembly. Holes in 3D printed parts are usually smaller than dimensioned. The drill holes can be re-cut with an appropriate drill bit. Additionally two spacers with a length of 6mm are needed. I use here pictures extracted from the 3-D drawing, because they are much clearer and easier to read than photos.
First the buttons for the tactile switch and the miniature joystick are attached and fixed with a drop of super glue. Here you have to be very careful not to let the superglue penetrate the switch housings, otherwise they are ruined and have to be replaced.
After the batteries are inserted, the cover of the battery box is fixed with a self-tapping screw M2x4.
In this log I will explain how I use a naive Bayes classifier to distinguish between flu and common cold by just knowing a few symptoms.
A naive Bayes classifier is based on applying Bayes' theorem with the naive assumption that the data are independent from each other. Bayes' theorem can be written as
where
h: Hypothesis, d: Data, P(h): Probability of hypothesis h before seeing any data d and P(d|h): Probability of the data if the hypothesis h is true.
The data evidence is given by
where P(h|d) is the probability of hypothesis h after having seen the data d.
Generally we want the most probable hypothesis given training data. This is the maximum a posteriori hypothesis
where H is the hypothesis set or space.
If our data d has several attributes, the naive Bayes assumption can be used. Attributes a that describe data instances are conditionally independent given the classification hypothesis
I didn't get any data how many people catching a common cold a year, but this can easily be fixed. I know that every human depending on the age catches a cold 3-15 times a year. Taking the average of 9 times a year and assuming a world population of 7·109, we have 63·109 common cold cases a year. Around 5·106 people will get the flu per year. This lead as to the following probabilities:
That means only one of approx. 12500 patients with common cold/flu like symptoms has actually flu!
Next we need to know more about the symptoms. How often occurs a certain symptom when you have common cold or flu? After a bit of search, I got the needed data, see here, and we can derive our probability-look-up table for supervised learning:
Prob
Flu
Common cold
P(h)
0.00008
0.99992
P(Fatigue|h)
0.8
0.225
P(Fever|h)
0.9
0.005
P(Chills|h)
0.9
0.1
P(Sore throat|h)
0.55
0.5
P(Cough|h)
0.9
0.4
P(Headache|h)
0.85
0.25
P(Muscle pain|h)
0.675
0.1
P(Sneezing|h)
0.25
0.9
Finally we can compute our classification hypothesis:
You certainly know this, but let's mention it on that point: the probability that an event A is not occurring is given by
Multiplying a lot of probabilities, which are between 0 and 1 by definition, can result in floating-point underflow, but this can be avoided easily. Since
we can just summing logs of probabilities rather than multiplying probabilities. The class with highest final un-normalized log probability score is still the most probable. Hence
First batch of housing parts, 3-D printed by Shapeways. So far everything fits nicely:
Second batch:
To cover the USB port opening when not in use, I designed a compound cover, consisting of a 3-D printed part and a molded silicone plug. The picture below shows the 3-printed part on the left and the (also 3-D printed) mold for the silicone plug on the right next to it. I treated the inner side of the mold with an release agent, stuck the two parts together with a piece of tape and poured 2-component silicone into the mold.
Next I painted all the housing parts. I was using acrylic spray paint and a special primer for plastics. I had actually planned to paint the highlighted text on the case surfaces in a different colour with a very tiny brush to make the text more visible, but that was impossible given the porosity of the material, the low height and the fragility of some letters.
As usual I start with the creation of the schematic for a project. As already mentioned that the circuit is powered by two 1.5 V alkaline batteries. The LT1300 forms with L1, D1, C2 and C3 a 5V step-up converter. The 5V output voltage is guaranteed to a minimum input voltage of 1.8V. The 5V are then feeded into the Teensy.
Q1, R3 and SW1 form a simple latching style power circuit. On power up the R3 resistor pulls up the gate on the U1 p-channel mosfet which prevents current from flowing through U1. When the user presses SW1, the gate on U1 gets pulled to ground which allows the current to flow, the LT1300 and the Teensy turn on. The Teensy then drives the GPIO pin to ground. When the user releases SW1 the GPIO pin keeps the gate low. The Teensy (or user) then just Hi-Zs the GPIO pin when it needs to shutdown. This way it can make sure the data is safe when it shuts down.
Resistors R4 and R5 are wired as voltage divider to monitor the battery voltage. R1 and R2 are pullup resistors for the I2C bus, R6 to R10 are pullup resistors for the miniature joystick. PZ1 serves as an acoustic signal generator. BAT1 feeds the internal RTC of the Teensy. For this purpose a 32.768 kHz crystal must be soldered to the bottom of the Teensy board, for details see here.
Since we're going to be powereing the Teensy from the 5V step-up converter, we want to cut the jumper that bridges the USB bus voltage to the Teensy power input.
I designed the PCB layout with Fritzing. The board has a custom shape. For this I used Inkscape - an excellent tutorial can be found here. As usual I routed the PCB by hand. And as usual I am using AISLER to manufacture the board. They are quick, cheap and very reliable.
Top layer rendering:
Bottom layer rendering:
Before the housing can be designed, a 3-D model of the populated board is required. I use Sketchup for 3-D modeling. Fritzing is not able to generate a 3-D rendering of the board, so I had to draw everything by hand again, using dimensional drawings and data sheets of the components.
I won't reflow the board, just hand solder the few SMD components. For SMD soldering it is important to use a lot of flux (flux pen). Flux residues can be easily removed with 100% ethanol and an old toothbrush after soldering.
Populated top side (just the infrared Thermometer is missing - back order):
Populated bottom side:
By using our website and services, you expressly agree to the placement of our performance, functionality, and advertising cookies.
Learn More