A relay is a physical switch that actually moves and is controlled by a small current. They are less reliable than solid state switches. But I had one.
I basically followed the example of using a relay that came with my ARDX. (This is Circuit 11 in that book.) It is important to note that it requires a transistor to switch power to the relay. The Arduino digital outputs provide so little current they can't reliably switch the relay.
The coil inside the relay is also an inductive load, requiring a fly-back diode to protect the circuit.
I dutifully:
- Spent an hour breadboarding this circuit,
- Spent about an hour laying out the soldered circuit board (this is a separate skill which I am very bad at),
- Spent about an hour stripping jumper wires and placing the components on the board in preparation for soldering,
- Spent about two hours soldering, and correcting my soldering.
Here is the circuit board with the transistor (there is a resistor on its input), the relay, and the diode. Soldered to it are the battery leads for power, and four wires going back to the Arduino: +5V and GND for powering the transistor and the temperature sensor. Their is one signal wire fro controlling the relay (basically "turn on the heater") and one wire leading back from the temperature sensor.
I had misunderstand the pinouts for the Relay --- I have to say that in my experience data sheets are not written well for beginners.
Below are the components of the system laid out.
Note the Arduino and Breadboard system on the left --- I originally used the breadboard, which is now empty. Although not powered on in the photo, the doll has an LED which shows if it is too cool, too hot, or just right. Note the doll and its Arduino, its temperature sensor and LED, are completely separated from the Incubator itself. I call the test system the "Test Preemie".
The Incubator (which is an ambitious title for a warmer with a thermostat) consists of the components on the left. I drive it with a lantern battery in part to show that the heating circuit is completely separate form the Arduino system as well. In fact you can hook up the batteries in series which gives 12V, and four times the wattage, as a demonstration. At 12V the heating cloth heats up VERY quickly, but of course the Preemie has much more thermal mass than the cloth. It is possible that people who might need this would have 6-12 V available from batteries or cell phone chargers or something.
I am now ready for real testing, I hope. I just have to take the sensor off the old circuit and solder it in here, and then I can make a physical incubator, adjust the temperatures in the "Test" sketch and the "Incubator" sketch and see if I can keep the Test Preemie happy.
Let me remind everyone that this project is in its early phases, and that I am doing it mostly to support Engineers Without Borders. I don't think we have done enough research into neonatology to understand the fitness of this system for actually trying to keep a child alive. However, I believe it is reasonable for prototyping and research to advance hand-in-hand.
There are a number of things that are potentially weird about this approach. Not least of them is that you could do the control of the heater at body temperature with a simple circuit, eliminating the Arduino and its expense and complexity. However, if you did that you would not have a platform available for other enhancements, and it is easier to control and report on this with the Arduino first.
No comments:
Post a Comment