DesignSpark Electrical Logo
  • Brought to you by
  • RS Components
  • Allied Electronics

May 16, 2017 12:36

Designing and Building a Bed Monitoring System for hospital use

So far in my posts documenting the making of my bed monitoring system, I have covered writing the code and designing the circuits for a device that integrates a moisture sensor and a weighing mechanism, and made a custom acrylic case for these. The device logs a patient’s weight and a bed status of wet/dry to a CSV file that can subsequently be displayed in graph format, but also in the case of a wet bed, turns on an LED corresponding to the bed number on a LED bank located at a nurse’s station. The aim is to make a system that can be utilised in a hospital environment as wet beds increase the risk, severity, care time and cost of pressure sores. The hope is to reduce these aspects, which will in turn mean a speedier recovery and a better experience, and save some money in the process. It should also greatly benefit the patients and the nurses alike. Patient’s dignity in upheld through not having to ask publicly for help and those that are bedbound don’t have to get out of bed to be weighed several times a day to be able to quantitate their doses. It should also be a great tool for nurses to save them time and track some of the information they need. It’s all coming to a head now and the only thing I have to do is to solder all of my components to a prototyping board and assemble it. It’s the moment of truth and the pressure is on. Plus, being a bunglemsome lefty, soldering is not one of my strong points. The whole right handed world is against us, but that’s a different blog entirely. Here I’m just going to look at soldering the prototyping board, and my sensors and bringing it all together.

The Prototyping board

To minimise my chances of totally botching up my prototyping board — which I did anyway — I planned my prototyping by drawing countless plans and layouts before I started. First of all I combined my moisture sensor circuit, the IN1255P amplifier circuit and my MCP3008 analogue to digital converter circuit into one. That can be seen on the fritzing shot below.

I then used the Adafruit prototyping board for the Raspberry Pi to solder it in the hopes of creating a more professional prototype.

The board itself is half breadboard half perf board allowing for the use of DIP chips and sensors etc. There are screw blocks so you can make the sensors semi-permanent — something I decided against, but I’ll come back to that later. It is worth noting that this kit is best used for the Raspberry Pi Model A or Model B. You can use it with any "2x20 GPIO type" Pi (A+, B+, Zero, Pi 2, Pi 3) but only the 'top 26 pins' will be available for use. Luckily this didn’t affect me, but if your using those in any projects your undertaking a little re-jigging will need to be done. I drew out my set up on countless pieces of paper before I had one that I got right and then I set about soldering.

Above you can see a half way through stage as it was starting to come together. Once I’d finished that I started on my sensors.

The sensors

At this stage I could have just soldered the sensors or used the screw pins, but I wanted to do a little more than that. Even though the casing for the prototype was open sided, I still wanted to make it as close to a final functioning device as I could, including sockets that meant that both the moisture sensor and the weight cell could be taken out and replaced easily if broken etc. I didn’t want to create a prototype that seemed really cheap to produce, but then once you started to develop it and add in hospital environment standards the price sky-rocketed; I wanted to be as accurate as I could from the outset. I chose IP rated sockets, and selected a 3-way panel mount socket and cable mounted plug for the moisture sensor, and 4-way panel mount socket and cable mounted plug for the weight cell. Below are a few pictures of the soldering process for my moisture sensor

The sensor terminated in very fine wire which was sewn into a piece of cloth. This is obviously not ideal, but for the purposes of the prototype was fine.

I then mounted my Raspberry Pi and the prototyping board and put the case together.

The nurse’s station was a similar process.

My prototype was now complete.


Connecting the Sensor to the station

To send information from the sensor to the nurse’s station I looked into a few different messaging systems. Message Queuing Telemetry Transport (MQTT) was introduced in 1999 by IBM. MQTT is a straightforward messaging protocol for machine-to-machine (M2M) communications that permits the transfer of data in the form of messages. Data Distribution Service for Real-Time systems (DDS) was another option. DDS and MQTT share some factors, such as frugality and efficiency, temporal decoupling and anonymity, but each have some inimitable features that make it more, or less suitable to a certain job. MQTT is most suitable for intermittent messages whereas DDS is most suitable for those applications that require real-time data exchange. While both have Raspberry Pi library’s that can simply be imported and used, as stated before the MQTT is pretty straightforward, and where DDS provides support for both Device-to-Cloud (Device-to-Data Centre) communication as well as Device-to-Device, MQTT provides very good support for Device-to-Data Centre communication. Since I am looking to send lots of information to one centre this appears to be the best solution. Coding can be written much in the same style as my previous code that controlled my bed monitor in my previous post. The bed monitor would run and the nurses station would send out a message to the bed monitors to return it the data regarding the beds status and patient’s weight, this would then the returned and logged on the central nurse’s station to a file or SD card etc.

Completing the project

Over the course of starting to intern at AB open and undertaking this project, I’ve learned more here than I did in my whole time in formal education. Well, that might be a slight exaggeration, but only slight. In such a short time, I’ve gone from never having even heard of Python to being able to understand functions, strings etc, to look at code and understand its purpose and write my own code. I’ve learned a lot about industry standards, do’s and don’ts, especially within prototyping. Though by no means an expert as you’ve seen, I’ve improved my soldering techniques, learned to laser cut, learnt about the design process as a whole and enjoyed myself along the way. I’ve added a few strings to my bow and I can’t wait to use them in future projects.


I Graduated from the University of Bradford with a degree in Chemistry and Forensic Science and currently I am studying towards a HND in Electronic and Electrical Engineering while interning at AB Open.



June 8, 2017 12:42

Having seen the type of ulcers caused by soaked sheets the project could be a ideal way of monitoring patients especially with the declining number of nurses on wards pressure sores and ulcers are caused by immobile patients so some method of detecting patient movement would also be desirable .


June 6, 2017 07:43

Oh wow - and I didn't have to go thru this - but since we're talking invalid, not to mention a patient possibly laying on urine soaked sheets, you'll need to withstand defib tests:


June 6, 2017 07:37

As to bat operated wireless -

They don't really dig more bat operated wireless stuff... been there, done that.


June 6, 2017 07:37

BTW - that BF section of 60601 includes isolated power... not easy...


June 6, 2017 07:37

Uh - I think you'll need a patient barrier of 8mm to be accepted for heathcare use.

See IEC 60601...
You'll need to purchase the standard. I can't reprint it here...


The standard requires a device have two isolation
barriers as means of protection (MOP) where the
device may come into contact with a patient."

Part of that means no galvanic connection to anything that is in contact with the patient. my guess, since its a bed in long term contact part BF:


"Type BF is less stringent than CF, and is generally for devices that have conductive contact with the patient, or having medium or long term contact with the patient."

I did a design for Welch Allyn that required it. Youll also need Y rated caps across the patient barrier.

Here it is on nextag:

Here's the prototype:
Typical Patient barrier-- 8mm patient barrier knocked out on all copper layers as per IEC 60601

Completed first unit on my bench:

Also- you'll never get that thru any type of EMI testing. I went thru this with W-A. It's much more rigid than than typical FCC CFR 47 part 15...


More information on my lab and shop:
"Success is going from failure to failure without a loss of enthusiasm."
~~ Sir Winston Leonard Spencer-Churchill (1874-1965)

"I've failed at so many things so many times I make Abraham Lincoln look like Bill Gates"
~~ Wayne Mitzen (1959- )

"What makes an expert isn't so much what they know,
It's that they've done similar things so many times wrong
They know what not to do"
~~ Wayne Mitzen (1959- )

"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."
~~ Rene Descartes 1596-1650

"I hate the way people just go from ignorance to despair so quickly; it's the lazy man's option"
~~Professor Tim Flannery (1956- )

"When you do things right, people won't be sure you've done anything at all."
~~ God, in Futurama episode "Godfellas"

"Two things are infinite: the universe and human stupidity;
and I'm not even sure about the universe."
~~ Albert Einstein (1879-1955)

"Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe."
~~ Frank Zappa (1940-1993)


June 5, 2017 12:46

Nice job .. I've attached a picture of a Particle Pi shield I designed for one of my projects