So the Ultrasonic Sensor is considered to be a Digital sensor because the microcontroller reads a digital signal from it. How the Ultrasonic mainly works by emiting an ultrasound at 40 000 Hz which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance.
The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The Echo pin will output the time in microseconds the sound wave traveled.
The distance sensor produced by Sharp is a popular and relatively low cost solution for measuring distance.
In this test we will use the 2YOA21 model and the characteristics of this sensor are:
Concerning the Ultrasonic Distance Measuring sensor, you can easily read the information from it on the Serial Monitor, as the signal recieved from it is a digital signal, which is converted directly by the help of the existing libraries into the measurments and numbers we need.
However, on the other hand, with the InfraRed Sharp Distance sensor, it's a bit harder to get data from it, casue you need to calibrate it first. The IR sensor sends analog data to the Arduino Board, which is technically a variation is the voltage. Thus what you can read on the serial monitor is a variation in voltage. To convert that into readable information, we should check the values we read with respect to various set distances and calibrate accordingly.
The video represents how the signal is sent and recieved from and back to the arduino board. The signal recieved at the ECHO signal by the arduino board is a digital signal that represents the variation in distance.
On the other hand,the picture represents how the signal is received from the IR sensor.It is mainly a voltage level that variates according to the distance.
In the individual assignment, we had to measure something using a board we have designed.
So as a first step, i already built my Hello Board in the past weeks having a built in LDR sensor on it. The board has 2 LEDs of different colors, one Red and one Green, in addition to a Photoresistor (LDR) and a Button. The objective of the board is to measure the light intensity and based on that, the LEDs will turn on. The Green LED will turn ON when there is light and the Red LED will turn on when there is darkness. Note that the frequency of the LEDs flash depends on the intensity of Light or Darkness measured by the LDR. The more the light or darkness, the faster the blink of the LED.
So unfortunately, the Attiny44 chip does not have the capability to connect to the Serial Moniter in the Arduino IDE other than using the software serial, which will occupy more digital inputs and outputs.
So i chose the threshhold point based on trial and error, by observing the different LED blinking when changing the threshhold point in the software. Thus after dowloading the final code to the new Hello Board, I wanted to test it and check its full capabilities.
Due to my limitation, i chose to represent the values read was by using the on board LEDs. Thus the board reads an Analog Value from the LDR, and converts it into a frequency for th LEDs blinks.
So i gave the board an extenal power using an FTDI Basic Breakout - 5V and checked if it works all by itself. And it did work :D. The video represents the functionality of My Hello Board.
As a second step in this week's individual assignment, I wanted to start designing a new board that will be used on board of the Pipe Surveying Robot i am planning to build in my Final Project.
Thus to do that, some research was done to check the available sensors that would achieve the requirements i need in my system. The main mission of my Robot is to survey existing pipes, gather data related to its path underground, mainly anglural data, and save this data on a memory stick.
So the set of sensors (Inputs) that i could be using on my robot are mainly the following:
As mentioned above, the Ultrasonic Distance Sensor is a Digital Sensor. The HC-SR04 Ultrasonic Sensor Module has four pins:
The IR sensor is an Analog sensor. The SHARP IR Distance sensor is connected to the control board using 3 pins:
The main sesnor i will be using in my Pipe Surveying Robot is the the MPU-6050.
The InvenSense MPU-6050 sensor contains a MEMS accelerometer and a MEMS gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. Therefor it captures the x, y, and z channel at the same time. The sensor uses the I2C-bus to interface with the Arduino.
The MPU-6050 is not expensive, especially given the fact that it combines both an accelerometer and a gyro. Also note that Invensense has combined the MPU-6050 with a magnetometer (compass) in a single chip called MPU-9150.
The accelerometer measures the acceleration along one direction, while the gyroscope measures the angular acceleration on one axis. The module has 8 pins:
Next i need to design the control board of my pipe surveying robot i am building. Many points had to be taken into consideration while designing the board, mainly the Architecture of the Microcontroller i am using, the pin connection to the sensors and outputs i am using. The different parts of the Control board are described in details below.
The image represents the different part of the full control board such as:
In my first prototype of my board, i will be using the ATmega328/P, which is the same Microcontroller used on the Arduino UNO board.
Saying that, and based on the data sheet, other than the Analog and Digital pins, the following connections were made:
The main Input Pin headers that i will be using for my board are mainly the following:
A set of pin headers was prepared for the Inputs and Outputs that will be used in my system and connected tot he Microcontroller i am using.
Each pin head will have a Vcc pin and a GND pin, plus 1 or 2 dedicated Analog or Digital pins.
My board will have one battery as a power source dew to the limtied and tight space. Thus i will need power regulators that will achieve having a 12V, 5 V and 3.3 V power supplies on the board. Saying that a power regulation circuit was added to the board to achieved that.
Due to the time limitations (Easter Break), both the Inputs and Outputs week assignments were grouped in one. So the final design of the Board and its production was done in the Outputs Assignment of next week.
In the Outputs Week, i finalized the design of the board, produced it, and tested both Inputs and Outputs.
All details could be found on the following link