12. Input devices
On this week we worked on THE CREATION OF THE CNC (difficult week)
The group assignment
Here is the group assignment where you can find about an input device(s)'s analog levels and digital signals
Input device: Ultrasonic sensor
First I decided go for a comun sensor, so I started with the Ultrasonic Sensor. Ultrasonic sensors are electronic devices that calculate the target’s distance by emission of ultrasonic sound waves and convert those waves into electrical signals. The speed of emitted ultrasonic waves traveling speed is faster than the audible sound
On this sensor, there are mainly two essential elements which are the transmitter and receiver. Using the piezoelectric crystals, the transmitter generates sound, and from there it travels to the target and gets back to the receiver component.
To know the distance between the target and the sensor, the sensor calculates the amount of time required for sound emission to travel from transmitter to receiver. The calculation is done as follows:
This sensor has the next pins:
- Vcc – This pin has to be connected to a power supply +5V.
- TRIG – This pin is used to receive controlling signals from the Arduino board. This is the triggering input pin of the sensor
- ECHO – This pin is used for sending signals to the Arduino board where the Arduino calculates the pulse duration to know the distance. This pin is the ECHO output of the sensor.
- GND – This pin has to be connected to the ground.
The final circuit would look like this:
Now let's connect everything and we got this:
Now we charge this basic code that makes the ultrasonic work and shows on the terminal the distance. The distance is shown thanks to an ecuation: distance = duration * 0.034 / 2. Duration is the total travel time of the ultrasound pulse (in microseconds). 0.034 cm/μs is the speed of sound in centimeters per microsecond. The product of duration and 0.034 gives the total distance traveled by the pulse in centimeters. Dividing by 2 adjusts this figure to represent the one-way distance from the sensor to the object.
Finally for the ultrasonic, we got this:
For my final project...
For my final project I need touch sensor that pass a material such as 3D filament on a 3D printed design. So for this I'm going to use a Touch sensor.
The TTP223 is a touch pad detector IC replicating a single tactile button. This touch detection IC is designed for replacing traditional direct button key with diverse pad size. Between it's features it has:
- Input Voltage: 3.3V - 5.5V DC
- Module size: 15mm x 11mm
- Stable touching detection of human body for replacing traditional direct switch key.
This sensor has a simple communication method, only sends signal when detecting something and not send the signal when not detected.
Now let's test how it works, using this code:
This is the circuit:
And the final result is:
Finally I wanted to test if the touch sensor is capable of detect through a 3D printed piece, so I made a little box:
And it works, this is going to be something that I'm going to use on my final project.