Posts

Showing posts from August, 2022

Ultra Sonic Sensor HC-SR04

Image
HC-SR04 Ultra Sonic Sensor Ultra Sonic Sensor HC-SR04 is a sensor which is used for measuring distance, this Ultra Sonic Sensor HC-SR04 could be used in different types of projects for example it could be used for Obstacle avoiding robot measuring water level in water tank. Ultra Sonic Sensor HC-SR04 sensor has got 4 pins, those are VCC which need to be connected with 5 volts, Trig which is trigger which is needed to be defined as output, this pin is need to be defined as Input, and GND which is ground and needed to be connected with ground of Arduino. Ultra Sonic Sensor HC-SR04 working is as follows with Arduino, when trigger pin is set high ultra sonic sound wave is emitted from the sensor this wave then travels some distance hits the objects and returns back, when this signal returns back Echo pin gives high input to Arduino meanwhile Arduino keeps on measuring the duration from since the Trigger pin of Ultra Sonic Sensor HC-SR04 has turned high and then low till when Echo pin g

Temperature Reading Using LM35 Temperature Sensor

Image
Connecting LM35 Temperature Sesnor With Arduino Image below shows pinout of LM35 when viewed from back side vout is the pin which gives output in response for changing voltages.  LM35 has linear vout changes in response to changing temperature, LM35 has got sensitivity of 10mV / Celsius following are the connections of lm35 with Arduino for the code given below. 1) VCC = Arduino 5V 2) Vout = Arduino Pin A3 3) GND = Arduino Ground For display I am using I2C LCD for my I have used following connections as shown in diagram given below this diagram shows connection of I2C module with LCD and with Arduino. To see how temperature sensor lm35 works with Arduino you could see this video given below. Code For Arduino #include <LiquidCrystal_I2C.h> const int sensor=A3;                                       // Assigning analog pin A3 to variable 'sensor' float tempc;                                                          //variable to store temperature in degree Celsius float temp

Arduino LCD Scroll Function For Opposite Directions And One Row Scroll

Image
This article discusses scroll function for Arduino lcd 16*2 name of this function is scroller and it takes in certain arguments before it could function. Scroller has the capability to scroll Left scroll Right and both rows in Opposite Directions it can also scroll only one row while keeping other row static. scroller(Char Array 1, Size of Array 1, Char Array 2 , Size of Array 2 , Direction , Row , Delay)  To See The Functionality Of it You May Like To See This Video This is the function it requires following as arguments  Two Char type arrays their sizes  Direcrion which could be L = Left R= Right and B = Both Directions  Row of LCD 0 or 1 Delay for speed of scroll #include <LiquidCrystal_I2C.h> // Working with I2C LCD char arr1[] = "Tech School";  // Char Array 1  char arr2[] = "Scroll Function"; // Char Array 2 int col = 16; int row = 2; char dir=' '; // For Direction L = Left R = Right B =  Both LiquidCrystal_I2C lcd(0x27, col, row); // Defining LC