Home > News > Content

Sensor How It Works

The number of Sensor in the entire surface of the earth and people living around the space surge, providing the world of various data messages. The price of the sensor is the development of the Internet of Things (IoT) and our society is facing the digital revolution behind the driving force, however, connecting and getting the data from the sensor is not always straight ahead or so easy, the following five tips To help ease the engineer's first war with the transmission interface to the sensor.

The first step, the engineer should take the first time to connect to the sensor when it is through a bus tool to limit the unknown. A bus tool connects a personal computer (PC) and then to the sensor's I2C, SPI or other protocol that allows the sensor to "speak". The PC application associated with the bus tool provides a known and working source for sending and receiving data, and is not an unknown, unauthenticated embedded microcontroller (MCU) driver. In the working environment of the bus tool, the developer can send and receive messages to get an understanding of how that section works, before attempting to operate at the embedded level.

Once the developer has tried to use the sensor for the bus tool, the next step is to write the application code for the sensor. Instead of jumping directly into the code of the microcontroller, but writing the application code in Python. Many bus tools are equipped with plug-in and example code in writing scripts, and Python is usually one of the languages available in .NET. Writing applications in Python is quick and easy, and it provides a way to test the sensor in an application, which is not as complicated as in embedded environments. Having high-level code will make it impossible for non-embedded engineers to tap the sensor's scripts and tests without the need for an embedded software engineer to take care. Any sample code that can be "searched" from the sensor manufacturer, the engineer needs to walk a long way to understand how the sensor works. Unfortunately, many sensor vendors are not experts in embedded software design, so do not expect to find a beautiful architecture that can be put into production and elegant examples. Use the vendor code to learn how this part works, and then the refactoring frustration will emerge until it can be integrated into the embedded software. It may start with a "spaghetti", but it will help to reduce many of the weekend's time before the product is launched, using the manufacturer's understanding of how the sensor works.

The chance is that the sensor's transmission interface is not too new, and no one has ever done so. All of the known libraries, such as the "sensor fusion library" provided by many chipmakers, help developers to quickly master, even better, and avoid them from re-developing or dramatically revising the product architecture. Many Sensor can be integrated into general types or categories, and these types or categories will allow the driver to be developed smoothly, and if handled properly, it is almost universal or less reusable. Look for these Sensor to fuse the library and learn their strengths and weaknesses.