Designing 'Underwater Instruments/Electronic Equipment' poses it's own unique challenge. They have to be waterproof and airtight to keep the electronics safe from water damage.
Since underwater devices are fully submersed into water, implementing regular mechanical switch/buttons or touch based input interfaces for user input is very challenging.To solve This Problem I think Magnetic Field Based Input Control is the best strategy.
3D Magnetic Sensors, Hall Sensors and Reed Switches can be used to design underwater equipment. As magnetic field can pass through plastic enclosure, this project demonstrates how 3D magnetic sensors from Infineon can be used to give user input to a fully enclosed, waterproof or airtight equipment without no direct electrical contact.Demo Video: It's under the water !
Following video demonstrates how 3D Magnetic Sensor and Hall Switch are used to sense switching input from user through a plastic enclosure:-
Device Demo Underwater
Details are explained below, please continue reading....Hardware Build: Device Operation
This is the list of hardware (BOM) are used to build this demo prototype:
- XMC1302 Microcontroller(XMC 1300 Boot kit) : XMC 1302 microcontroller is a wide operating voltage range ( 1.8 V - 5.5 V ) microcontroller from Infineon, it is great for sensors, motor drive, electronic equipment control applications. This mcu can be programmed by Arduino IDE or DAVE IDE or Modustoolbox IDE.
- TLI493D-W2BW A0 3D Magnetic Sensor(Shied2Go) : TLI493D-W2BW is a 3D Hall sensor for sensing magnetic field in X, Y, Z direction, enabling measurement of magnetic field strength, position and angle measurements. This sensor can be used for electrical contact free user inputs through magnetic field. I have used this sensor in this project to sense rotary selector switch positions.
- TLE4964-3M MagenticHall Sensor (Shield2Go) : TLE4964 is a low power hall effect magnetic sensor, that can be used as a switch. As the south pole a magnet approaches this sensor, at certain magnetic field strength it will detect the magnet and the output of this sensor will go from high to low. I have used two magnets and this sensor to make a momentary slide switch.
- Generic Magnetic Reed Switch:A glass enclosed reed switch to turn on/off power to the whole device from outside with a big magnet. This reed switch is in series with the batteries and positive power rail.
- 1306 I2C OLED Display Module: An I2C OLED display with 1306 driver chip to display the GUI interface to the user
- Neodymium magnets: Small but strong Neodymium magnets are used for designing alternative to mechanical spring and mechanical friction in slide switch and rotary selector switch. Also, another 2 magnets are used to input position sensing to 3D magnetic sensor and hall sensor.
- 2AA Batteries: 2 AA batteries are use to power the demo project and provide 3 volts supply.
- Airtight Enclosure: To secure the battery and keep the electronics safe under water
- Custom Magnetic Rotary Switch: Made with plastic bottle cap, some magnets, cable ties, superglue, an old pot for rotational support. 3D magnetic sensor is placed under the rotary switch to sense switch positions
- Custom Momentary Magnetic Slide Switch: Made with 2 magnets, inner magnet will hold the outer magnet, as the magnetic field will pass thought the plastic enclosure. The outer magnet will slide on a plastic track when user pushes it and it's south pole will go over hall sensor switch for position sensing
Please note that, if you have access to 3D printers, you can design these magnetic rotary switches and momentary slide switches with 3D printer, I am just using scrap plastic bottle caps and some plastic chunks for this demo
All the hardware are connected according to the following schematic:-
Actual Physical Wirings
Here is the picture of actual wiring of all the hardware components, after connecting, they are placed in a waterproof airtight container.
This is a Momentary Slide Switch consists of two Magnets and one Unipolar Hall Sensor. One of the magnet is outside the enclosure, which acts as the user switch. The other magnet is inside the the enclosure which attracts the outer magnet and acts like a 'virtual spring'. When the outer magnet's South Pole is dragged/puhed on the Unipolar Hall sensor by then user, the Hall Sensor is activated and registered as a button press from user. Once user releases the outer magnet, it will go back to it's off position/original position as the inner magnet will pull it back magnetically. It's a mechanical switch but no mechanical parts, as the magnetic field can pass through the solid plastic enclosure without any opening.
MagRotate is a Magnetic Rotary Selector Switch, where a bunch of magnets are used to magnetically lock the switch at selected positions. North Poles of the Magnets on the Rotary Knob are attracted to the South Poles of the Magnets on the Rotary Track, thus giving a Tactile Feeling when changing selector position. At the center of the switch there is the main Rotation Sensing Magnet, which rotates as the selector switch position is changed. The whole switch setup is on one side of the plastic enclosure. Infineon 3D magnetic sensor is used to sense the position of the center magnet or Rotation Sensing Magnet and determining the selector switch's angular position.
Here is a 3D model of this switch :
Infineon's XMC microcontroller can be programmed with Arduino IDE using following steps:
Download Arduino IDE
Download the latest Arduino IDE from here. IDE version 2.1 and latest are recommended for better compatibility. There are starter codes and demo examples for Arduino IDE with XMC microcontrollers to get started.
Install SEGGER J-Link
To flash/program the Infineon XMC microcontrollers with the Arduino IDE, SEGGER J-Link must be installed on your computer. Download SEGGER J-Link and install the J-Link Software
(note: If you already have J-link installed then skip this step)
Install Java Runtime Environment
The XMC-for-Arduino BSP installs the XMC Flasher tool. This tool is used to flash the compiled firmware (.hex) into the XMC device. For this tool to work properly, download Java(TM) SE Runtime Environmentand install it in the computer.
(note: If you already have Java runtime installed then skip this step)
Add XMC Microcontroller Package to IDE
To program the XMC series microcontroller with Arduino IDE, add appropriate mcu packages from :
Tools > Board > Board Manager
then type XMC or Infineon to fine the board package, click on it to download and install it. Install the latest package ( version 2.0 +)
Add 3D Magnetic Sensor Driver Library
Inside Arduino IDE, go to Sketch > Include Library > Manage Library
Then type TLI493D to search and install the device library for 3D magnetic sensor
I first drew following 128x64 pixels images in bmp format.
http://javl.github.io/image2cpp/ this webpage can take the images and convert them into bitmap array, which can directly be copied to the code to product images on the display.
Simply select an image, set the dimensions, check the preview and then click generate code to convert the bpm into pixel dataConclusion
This project demonstrates how magnetic sensors can be utilized for under water equipment design. This is not a finished product/solution, rather part of a solution. Feel free to use this design techniques for your waterproof products design.
All the equipment data shown in this demo are not real data from real sensors, those are just demo data shown to demonstrate the selector operation. The purpose of this project is to demonstrate user interface design for underwater equipment with magnetic sensors.References