Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:hardware2:other_sensors [2023/08/25 12:30] – external edit (Unknown date) 127.0.0.1en:iot-open:hardware2:other_sensors [2023/11/23 12:39] (current) pczekalski
Line 1: Line 1:
 +====== Other Sensors ======
 +{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\
 +== Hall sensor ==
 +A **Hall effect sensor** detects strong magnetic fields, their polarities and the relative strength of the field. In the Hall effect sensors, a magnetic force influences current flow through the semiconductor material and creates a measurable voltage on the sides of the semiconductor. Sensors with analogue output can measure the strength of the magnetic field, while digital sensors give //HIGH// or //LOW// output value, depending on the presence of the magnetic field.
  
 +Hall effect sensors are used in magnetic encoders for speed and rotation measurements. They can replace mechanical switches in keyboards and proximity switches because they do not require contact, which ensures high reliability. An example application can be sensing the position of rotary valves. Sample sensor is present in figure {{ref>hallsensor1}} and its connection to the Arduino board in figure {{ref>hallsensor2}}.
 +
 +<figure hallsensor1>
 +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:hall_sensor_c.jpg?150 | Hall-effect sensor module}}
 +<caption>Hall-effect sensor module</caption>
 +</figure>
 +
 +<figure hallsensor2>
 +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:sch_apz_shemas_hall2.png?200 | Arduino Uno and Hall sensor schematics}}
 +<caption>Arduino Uno and Hall sensor schematics</caption>
 +</figure>
 +
 +The example code:
 +<code c>
 +int hallPin = A0; //Hall sensor output is connected to the analogue A0 pin
 +int hallReading;  //Stores Hall sensor reading
 + 
 +void setup(void) {
 +  Serial.begin(9600);      //Begin serial communication
 +  pinMode(hallPin, INPUT); //Initialize the Hall sensor pin as an input
 +}
 + 
 +void loop(void) {
 +  hallReading = analogRead(hallPin);   //Read the analogue value of the Hall sensor
 +  Serial.print("Hall sensor value: "); //Print out
 +  Serial.println(hallReading);
 +  delay(10); //Short delay
 +}
 +</code>
 +
 +== Global Positioning System ==
 +A GPS receiver is a device that can receive information from a global navigation satellite system and calculate its position on the Earth. A GPS receiver uses a constellation of satellites and ground stations to compute position and time almost anywhere on Earth. GPS receivers (figure {{ref>gps1}}) are used for navigation only in the outdoor area because they need to receive signals from the satellites, which is complicated inside the buildings. The GPS location's precision can vary depending on the number of visible satellites, weather conditions, and current satellites' placement. The GPS receiver is often connected to a microcontroller with a serial communication port and sends information according to the NMEA scheme (figure {{ref>gps2}}).
 +
 +A GPS receiver is used for device location tracking. Real applications might be, e.g., pet, kid or personal belonging location tracking.
 +
 +<figure gps1>
 +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:gps_c.jpg?200 | Grove GPS receiver module}}
 +<caption>Grove GPS receiver module</caption>
 +</figure>
 +
 +
 +<figure gps2>
 +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:arduino_and_arduino_101_intel_curie:gps_sch.png?direct&300 | Arduino Uno and Grove GPS receiver schematics}}
 +<caption>Arduino Uno and Grove GPS receiver schematics</caption>
 +</figure>
 +
 +The example code ((http://wiki.seeedstudio.com/Grove-GPS/)):
 +<code c>
 +#include <SoftwareSerial.h>
 +SoftwareSerial SoftSerial(2, 3);
 +unsigned char buffer[64];    //Buffer array for data receive over serial port
 +int count=0;                 //Counter for buffer array
 +void setup()
 +{
 +    SoftSerial.begin(9600);  //The SoftSerial baud rate
 +    Serial.begin(9600);      //The Serial port of Arduino baud rate.
 +}
 +
 +void loop()
 +{
 +    if (SoftSerial.available())  //If data is coming from software serial port 
 +                                 // ==> Data is coming from SoftSerial shield
 +    {
 +        while(SoftSerial.available())  //Reading data into char array
 +        {
 +            buffer[count++]=SoftSerial.read(); //Writing data into array
 +            if(count == 64)break;
 +        }
 +        Serial.write(buffer,count);    //If no data transmission ends, 
 +                                       //Write buffer to hardware serial port
 +        clearBufferArray();            //Call clearBufferArray function to clear 
 +                                       //The stored data from the array
 +        count = 0;                     //Set the counter of the while loop to zero 
 +    }
 +    if (Serial.available())       //If data is available on hardware serial port 
 +                                       // ==> Data is coming from a PC or notebook
 +    SoftSerial.write(Serial.read());   //Write it to the SoftSerial shield
 +}
 +
 +
 +void clearBufferArray()                //Function to clear buffer array
 +{
 +    for (int i=0; i<count;i++)
 +    {
 +        buffer[i]=NULL;
 +    }                         //Clear all content of an array with NULL
 +}
 +</code>
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0