Advice about build environment for medical device

Hi everyone,

I'm a doctor, and also an academic. I've an interest in electro-physiological modelling among other things. Together with my department we have developed an interactive virtual patient which is intended to help teaching in low income countries (as well as elsewhere).

The original program was built in flash. This is because of market penetration, especially within hospitals where users are not allowed to install their own software so can only really access applications through the browser. By and large they can't install other RIAs such as Java and Silverlight.

We ran into performance limitations, so there is now another version in Java. This also runs on android, which is cool.

What we want is the ability to interact with pacemaker devices, using either Flash or Java (although Java is preferred for performance reasons). The output would be two voltages, between 0-2mV (generated by the program), and inputs would equally be two voltages from 0-20mV from the medical device. There would be no patient contact, purely device interrogation and teaching.

The modelling code is all written and validated, but regarding the interface with an arduino module:
is this possible? is it easy? What build environment would people recommend?

Grateful thanks,

Kenneth

PS like the way that 'Arduino' is highlighted by the spell checker.

Depending on your background it is very easy or almost impossible. If you are an academic and can find some students of computer science or electrical engineering they should find it easy. If you have never coded and have other interests you will find it extraordinary hard.

Compared to how hard things can become in the microcontroller world, Arduino is to be considered super easy.

With regard to you voltage levels: you will need some care to keep interferences out. But again, no rocket science. Do you have more details on the interfaces?

Udo

Udo, thank you for your reply,

Well i'm good at coding, i've written the two parent programs myself which are each ~10000 line of code and I hope are of production standard.

I do have good access to CompSci and Engineering students too, mind, so the question is whether it is feasible before I investigate it further.

The output essentially recreates a 'surface' ECG waveform, (which is what a pacemaker would see) and is about 1mV in amplitude, although different models measure amperage instead - there is no agreed standard. The circuitry inside the pacemakers is simple: if a target voltage is achieved, then that is considered a detected normal heart beat. The waveform of the output voltage would not matter, for example a square wave lasting about 50ms would be fine (although the accuracy of the voltage is important)

The input would be the pacemaker device output. The device (I think) also tends to output a simple square wave of whatever voltage the user dials up. What I would need is the maximum applied voltage, and time it was applied.

The really hard stuff, which is the complex electromechanical model of the heart, is written, and the pacing interfaces work when they are virtual. However the challenge of attaching real pacing devices is very interesting.

kenneth

What I would need is the maximum applied voltage, and time it was applied.

You would need to connect the analog input of the arduino to the device (using appropriate methods) to measure the device voltages. You could run your programming on a laptop with a wired or wireless connection to the arduino to preclude connecting to the facility computer network.

What you want to achieve is definitely possible. If you have coded >10000 lines in any language, then Arduino should be pretty easy for you to pick up. You will need some trivial voltage divider to get the voltage down to the desired level. Generating square waves is easy. Varying the voltage requires some DAC. Probably a simple resistor ladder might be sufficient. Also easy to do.

Detecting 20mV is possible but if you want to analyze the waveform some input amplifier would be needed in order to get better resolution. Assuming that the required frequencies are comparatively slow this is easy as well.

With regard to the build environment: most people use the Arduino IDE of course. It is easy to setup but it is below average compared to other IDEs. Some use Eclipse. I use only a text editor (Kate to be precise) and version control. My largest project so far uses a 644 and exceeds 10 000 lines. Still no need for Eclipse. Kate is powerful enough :slight_smile:

With regard to the build environment: if you are experienced you want to get rid of the Arduino IDE anyway in order to code C++. You can still reuse the libraries. I do not like makefiles. I prefer scons. A link to an sconstruct is found here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243337080

In the finished product you may want to get rid of all the redundant components that Arduino introduces for your purposes. But for a quick start in prototyping it is definitely a good approach.

Udo

I tend to use eclipse already. So could you have the main body of the program in Java, with some sort of interface coded in C++?

Perhaps you could run them both, and access the arduino through it's port in Java, so have complete seperation of the projects?

kenneth

Where will the "main body" of the progam run? In the PC? If so, then the program can never run standalone. If you want to run the main program in the Arduino, then forget about Java. The Arduino has not enough horsepower to run a JVM.

Udo

So an arduino can run standalone programs on the chip detached from a PC? I intended that it would run attached to a laptop, controlling the JVM and user interface. Is this possible?

k.

Both is possible.

Udo