Introduction: Magnetic Depth Meter
In this instructable we’re going to show you how to build you own magnetic water depth meter. Our depth meter works with the concept of communicating vessels. The sensors are attached to a vessel that is connected to the water body that you want to measure, in this case a measuring beker. The vessel with the sensors will have a floating magnet in it, which will float with the water level, allowing you to measure it quite precisely. With the following steps we hope that it will be clear for you how to make this sensor
Step 1: Material Needed
What you're going to need to build this hall sensor driven water depth meter is the following:
- 6 Hall sensors (more can be used as well, but the minimum is 3)
- 1 Particle photon
- 8 to 10 electrical wires of 50 cm length. (this allows you to keep the photon away from all elements that are directly in contact with water)
- Motherboard to put photon on
- Soldering iron
- Power unit/Laptop to power the photon
- Vessel to mount Hall sensors on (water bottle in our example)
- Measuring cup of minimally the same height as other vessel
- Tubes to conduct water from one vessel to the other (around 3 cm in diameter in our case)
- Wood for Base structure: one rigid plank (10x30cm) and 4 legs (1x5x10cm)
- 1 to 2 rings that can be tightened with screws
- 1 semi-circle shaped attachment with screw ports
- Rubber connection piece for tubes
- Common building tools
- Tape (lots of it)
- Relatively strong magnet(s) (we used 2)
- 2 pencils (or sticks of the same length; as long as it’s not magnetic)
- Cork (something with enough buoyancy for your magnet)
- Wood: one small thin plate: (5x10cm)
- Fishing wire (10 cms max)
Step 2: Hall Sensors
The most important aspect of this sensor is to make sure that the hall sensors register a magnet passing by. First, one wire has to connect the Vin port of the photon to the plus row on your motherboard. Second, the GND port of the photon has to be connected to the minus row. Each individual Hall sensor has three pins. Each pin has to be assigned to a different element. To connect the right element with the right pin, you need to know that the front side of the hall sensor is the side with smallest ‘’square’’. The left pin is attached to the plus row, the middle to the minus row, and the right to an analogue pin. We used analogue pins A0 to A5 (we used 6 hall sensors). To give yourself more space to work with, you can weld these pins to longer electrical wires, and connect those to the motherboard. The welded, open, parts of the wires have to be taped over to prevent them touching each other. Otherwise your sensor could short circuit, and your photon could stop working. We have added some pictures to better illustrate what we is described.
Step 3: Structure/Base
As said, this sensor works with communicating vessels. Therefore you need to have two vessels, one with the sensors mounted on it, and one at minimally equal height, connected via a tube. To mount this tube on the vessels, you need to drill a hole through both using a normal bore. In our case we only needed to drill one since we used an upside down water bottle for one of the vessels. Use the rubber "adaptor piece" to connect the tube to the measuring beaker, and use a pressure ring to mount the water bottle to the other side of the tube. To let this structure stand on its own, make a wooden structure consisting of four legs and a plank. You do not need to drill holes for the tubes if you let the tubes go across the wooden plank, by placing the vessels on opposite sides. The hall sensors have to be placed very accurately on the water bottle as they are very sensitive. Place, using tape, the sensor connected to A0 at the bottom, around 2 to 3 cm above the ending of the tube. Place every sensor 1.5 to 2 cm above each other. You can use other distances of course, but we have not worked with that and do not know how accurate the sensor will be then.
The photos indicate how we’ve built it.
Step 4: Floating Magnet
The floating magnet is made by attaching two corks to two magnets using waterproof tape. The magnets are placed on either side, with the corks in the middle for buoyancy and to maintain balance. The floating magnet has to pass the hall sensors very closely due to the sensitivity of the hall sensors, and therefore has to be guided. Two small loops of fishing wire are attached to the corks, and the two pencils are put through into the water bottle to make sure that the floating magnet follows a designated path. Use a wooden plate with two holes of the same diameter as the pencils, about 2 to 3 centimetres apart to hold the pencils (or sticks) in place. As the water rises in the water bottle, the magnets will now float along the hall sensors. We have also put some tape at the bottom of the pencils, to prevent the magnet from falling off when the water level gets too low.
Step 5: Code
The code that we used can be seen in the picture. The language we’ve used is C++. If you want to use another language that is of course fine, but then you do have to change it. You should rewrite the code as well if you changed some parameters, like the distance between the hall sensors, or if you want less frequent measurements. But for our set up, this code was used.
Step 6: Finishing Touches
An important feature of the water vessels is that they are waterproof. Do this by gluing the connections. You can also use more stabilisation rings to make the structure more rigid, and make sure that the water bottle or measuring beaker is completely straight.
This should make you good to go! Hopefully we’ve instructed you well enough to build your own magnetic depth meter.