January 24, 2020

pH Sensor Interface With Arduino

In chemistry, pH is a scale used to specify how acidic or basic a water-based solution is. Acidic solutions have a lower pH, while basic solutions have a higher pH. At room temperature (25°C or 77°F), pure water is neither acidic nor basic and has a pH of 7.
Here is a chart of different pH of different items.
This tutorial is about the interfacing of the Analog pH sensor with Arduino Nano. Then we display the data using a serial terminal.

What is an analog pH sensor?
Analog pH meter is specifically designed to measure the pH of the solution and reflect the acidity or alkalinity. It is commonly used in various applications such as aquaponics, aquaculture, and environmental water testing.
The sensor signal from the sensor goes to a circuit board that converts the signal to a (0-5) V analog signal easily readable from the Arduino board. All we have to do is to put the analog signal to any Analog pin of the Arduino (Arduino Nano in my case) and read the voltage using ADC.


Pinout:
  • VCC supplies power for the module. You can directly connect it to the 5V pin on the Arduino.
  • Data pin voltage varies from (0-5) Volt with the pH value.
  • GND is the Ground Pin and needs to be connected to the GND pin on the Arduino.
Connecting This device with Arduino is very easy. VCC pin goes to Arduino 5v pin GND pin goes to Arduino Ground Pin and the OUT pin goes to Arduino A0 pin.


Software:



Temperature Measuring Device

OLED and Digital Temperature Sensor(DS18B20) With Arduino.
In the previous section, we interfaced OLED with Arduino and Digital Temperature Sensor (DS18B20) with Arduino separately. Now we are going to merge them together to make a temperature measuring device powered by a standard 5 Volt power supply or a power bank.


Items required:

  • Arduino Nano
  • OLED Display
  • Digital Temperature Sensor (DS18B20)
  • Vero Board
  • Female Header
  • Terminal Block
  • 4.7k Resistance
  • Jumper Wire

Circuit Diagram:

Video Example:

Software:

January 12, 2020

Digital Temperature Sensor (DS18B20) Iterface with Arduino

This project is about the interfacing of a DS18B20 module with Arduino UNO. The data for temperature is displayed on the Serial Terminal and on the next phase we will display the data on OLED Display.

What is Digital Temperature Sensor?

Digital Temperature Sensor(DS18B20) has two parts one measures the data another very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature. The digital signal is fairly easy to read using any microcontroller.
Pinout:
  • VCC supplies power for the module. You can directly connect it to the 5V pin on the Arduino.
  • Data pin transmits the temperature and humidity data in digital form.
  • GND is the Ground Pin and needs to be connected to the GND pin on the Arduino.
To connect this sensor to Arduino first we have to include two libraries specially designed for this sensor OneWire.h, DallasTemperature.h
Then its time to tell the Arduino in which pin the sensor is connected. For this, we use this code OneWire oneWire(ONE_WIRE_BUS);
Now we have to tell the Arduino what sensor it is, for this we use DallasTemperature sensors(&oneWire);
Finally, we have to start the library by sending sensors.begin();
Then we have to ask the ic to send the temperature by sensors.requestTemperatures();
We can store the temperature in a variable by int temp = sensors.getTempCByIndex(0); 0 (Zero) stands for the first sensor, we can connect more than one sensor in one pin.

After connecting please double-check the connections before powering up the Arduino.












DS18B20 Sensor Library

Functions under this library
sending sensors.begin(); --------------------- Starts the library 
sensors.requestTemperatures(); ------------ Requestes for the reading
sensors.getTempCByIndex(0); -------------- Gives the value of temperature.

Video Example:


LCD Display Interface with Arduino

LCD Stands for Liquid Crystal Display. A liquid-crystal display is a flat-panel display, electronically modulated optical device that uses the light-modulating properties of liquid crystals combined with polarizers. Liquid crystals do not emit light directly, it works using a backlight or reflector to produce images in color or monochrome.



The LCD we are going to discuss is Arduino Interfaceble display modules. They have size variety like 16x2, 20x4 and many more but the working process is the same for almost every one of them. But the price increases with the display capacity.
These Displays have different colors too. Color varies with the backlight. Blue ones are a little different actually. they are called  Inverted displays. No Matter what size or color it has all of them work just like the same even all of them have the same pin configuration.
All of them have 16 Pins. A list of them is given here. These LCDs are loaded with a table where all the characters are stored. All we have to tell it which character to display and where to display that's all.
Let's skip the theory and go to the interfacing part. As we have limited pin in Arduino we will be using the 4bit mode of this led. In 4bit mode, we use only 4 pin D4-D7 of the LCD data bus. 

What to Do?

Hardware part:
Connect the LCD pins accordingly. For this purpose, a connection diagram is given. Once the connection is done recheck the wiring and connect the Arduino to the computer.

Software part:
Arduino has a header file named LiquidCrystal.h which takes care of all the things. We just need to include this header in our program. 
The next step is to tell the Arduino in which pin the LCD is connected for that purpose we use this line LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
Now as we have said the pins, we have to tell the controller to start the LCD with the capacity of the LCD. Here we are using a 16x2 LCD so we wrote lcd.begin(16, 2);. 
This is time to tell the LCD to display what we want it to display. In my case its "hello, world!" we the command for this is, lcd.print("hello, world!");


  • Comes with Arduino IDE
Software:

  • Coming Soon