Star Trek: Real Working Sick-Bay – Build #2

If you haven’t read the previous article (part 1) then I suggest you follow this link otherwise this write-up won’t be of much use!

In the last article we got the screen and the MAX30100 pulse/oximeter up and working. In this one we’re going to add everything else! A video has been produced that accompanies this article and should be viewed along with it.

The Dallas DS18B20 Temperature Sensor
These can be purchased in a metal can or in their naked form as shown below;

It is important that you buy it in it’s “naked” basic form and not the one encased in a metal can. This is because the response time if within the metal can is very poor, meaning that the temperature takes some time to change and is not very responsive to changes in temperature. The metal can ones are however waterproof so are great for out-of-doors applications. But for body temperature measurement we want it as shown above so that the system quickly responds to you body temperature when you apply your finger.

Connect just one up to your Arduino as shown in the circuit diagram of the previous article. Especially not forgetting the 4K7 resistor going to 5V. The sensor will not work without it. Download the sketch below to test it, this will display the temperature on the screen, try putting your finger on the sensor.

Using multiple Temp. Sensors
Now, lets add another, connect up another sensor exactly as the previous one except you do not need another 4K7 resistor, they can share the same one with no problems. Run the sketch below and you should see two temperatures on screen, try putting your finger on each sensor in turn and seeing which one changes.

Why two sensors?
A healthy human should have an internal “core” body temperature of around 37°C (36.1 to 37.2 is a medical accepted range). But to measure that requires putting something typically in your mouth or even other openings of your body! Infra-Red ear thermometers are now available but they are not cheap or easy to connect to our Arduino’s. Therefore the easiest for us as basic makers is to measure skin temperature using a cheap sensor and estimate what our internal body temperature would be based on this reading. As it makes sense that the hotter your internal temperature then the hotter your skin should be, and yes, that is the case. But it’s not quite that simple. You skin temp is also affected by the temperature of your surroundings, the hotter your surroundings the hotter your skin will be for a given internal body temperature. So we need to measure the environment temperature and your skin temp in order to work out (or estimate) what your actual core temperature is.

Luckily for us Loughborough University in the UK have done some research and written a paper ( link ) on this very subject. There overall aim was to monitor (by taping a temp sensor to their skin) the internal body temp of emergency services personnel (such as fire rescue etc.) to check they weren’t under to much temperature stress. In their paper they present a equation to calculate internal temperature based on skin temp and the temp of the immediate surroundings. It’s this equation that this project borrows (and tweaks the values slightly).

Designating the body temp sensor
So we need one body temp and one environmental temp sensor. How do we designate which is which. Both sensors connect to the same pin on the Arduino. Well, these sensors talk to our MCU over that wire using a serial communications protocol called the one wire bus. Many devices (in this case temp sensors) can share this connection and they all have a unique device ID coded into them at the factory so we can talk to individual ones if we need to. The source code of the main project includes code that allows you to tell the system which one of the sensors is the body sensor and which is the environmental one. For now as long as both sensors are working we don’t need any further testing.

The DF Player Mini MP3 Player
These devices are quite amazing, they cost around the price of a cheap disposable pen and yet accept an SD card, read MP3’s from it and have an in-built audio amplifier capable of driving a small speaker directly. Amazing! We are going to use it to play the heart beat sound when the system detects a pulse. These devices can be driven to access a track and move to the next or previous etc. but (for program space reasons) we are going to get it to simply play the first track it comes to just by simply pulling one of its pins low for a few milliseconds. As it will play the first track it sees it’s important that only one track is on the SD card that you are going to use. They accept up to 32Gb but as we are not going to use more than a few Kilobytes I suggest you find an old small card for this project or the smallest you can buy (it’ll be cheaper).

Wire it up as shown on the circuit diagram of the previous article, this includes adding in your speaker. The heart beat MP3 is below, put this (and only this file) on your SD card.

Place your SD card in your MP3 player and use the sketch below to test this set up.

This should sound a beat every 2 seconds.

Nearly there – just the switch to go!
The switch is used to be able to navigate the set-up menu. The set-up menu allows you to change which tempo sensor is the body sensor, whether to sound the heart beat or how the device boots up. To enter the set up menu you hold this switch down whilst powering up (or resetting). This is show in the original demo video. These settings are stored in the Arduino’s EEPROM and so keep there settings even when powered off. Wire up the switch as shown in the circuit diagram, here’s mine on the board.

The switch is a simple device (Durrr..) but never-the-less I’ve presented some simple code below that you can use to test it’s functionality prior to using with the full code. Upload to your Arduino and it should display the text “Button :Not Pressed” (presuming your not pressing it!). Pressing the button should change the text to “Button :Pressed”. If this is not the case then check the wiring is correct, one side of the button should go to pin 3 and the other to ground (0V). If this is correct then check the orientation of your button by turning it through 90 degrees and re-inserting. If you look underneath your button you will see that this type show via embossing on the plastic that two connections are connected and two are not.

The full Source
All parts are now in place and tested working. So download the full sketch below and upload to your Arduino. On starting it should ask you to set your body temp sensor. Just put your finger on the one that it is, when it’s warmed up a certain amount (3°C above the other sensor) the system will store that one as the body sensor and display this on screen. Press the reset on your Arduino or power off/on to reboot. The system should now be ready to work.

That’s it.
That’s it, all built. I do have additions I’m thinking about adding (such as more MP3 sound files) so keep on eye on my You Tube channel or these pages. Thanks for watching and reading 🙂

4 Comments

  1. done everything as stated all works ,but cant seem to download star trex sick bay monitor to aruino ??? can any one help

Comments are closed.