Devices & Components
Arduino Nano
2k ohm resistor
DS18B20 1-Wire Digital Temperature Sensor
Dust removal gas
USB cable (Micro B)
1K ohm resistor
HC-06 Bluetooth module
4,7 kOhm Resistor
Flexible hose
Portable USB battery pack
Ultrasonic Sensor - HC-SR04 (Generic)
Breadbord
Binder clip
Breadboard Jumper Wire Pack (200mm&100mm)
Steren - White PLA filament (1.75 mm) 1 kg
Hardware & Tools
Ender 3 Pro
Software & Tools
Autodesk 123D Design
Arduino IDE
MIT App Inventor 2
Autodesk Meshmixer
Cura Slicer
Project description
Code
SoundSpeed_3D_2022
cpp
Measuring the speed of sound of gases
1// SoundSpeed_3D_2022 2// IDE 1.8.19 3// Adapted and modified by Alberto Villalobos (IDE 1.8.19) 4// 5// Basic Bluetooth sketch HC-06_01 6// Connect the HC-06 module and communicate using the serial monitor 7// The HC-06 defaults to AT mode when first powered on. 8// The default baud rate is 9600 9// The HC-06 requires all AT commands to be in uppercase. NL+CR should not be added to the command string 10// 11// Ultrasonic Sensor HC-SR04 and Arduino Tutorial 12// Crated by Dejan Nedelkovski, 13// www.HowToMechatronics.com 14//https://randomnerdtutorials.com 15 16#include <SoftwareSerial.h> 17#include <OneWire.h> 18#include <DallasTemperature.h> 19 20SoftwareSerial BTserial(2, 3); // RX | TX 21// Connect the HC-06 TX to the Arduino RX on pin 2. 22// Connect the HC-06 RX to the Arduino TX on pin 3 through a voltage divider. 23 24// Data wire is conntec to the Arduino digital pin 4 25#define ONE_WIRE_BUS 4 26 27// Setup a oneWire instance to communicate with any OneWire devices 28OneWire oneWire(ONE_WIRE_BUS); 29 30// Pass our oneWire reference to Dallas Temperature sensor 31DallasTemperature sensors(&oneWire); 32 33double Temperatura; 34double CorrecTemp = -3.3; //Correction to the temperature initially measured by the sensor 35float duration; 36 37// defines pins numbers 38 39const int trigPin = 9; 40const int echoPin = 10; 41 42void setup() { 43 44pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output 45pinMode(echoPin, INPUT); // Sets the echoPin as an Input 46 47Serial.begin(9600); 48BTserial.begin(9600); // HC-06 default serial speed is 9600 49 50// Start up the library 51 sensors.begin(); 52} 53 54void loop() 55{ 56// Call sensors.requestTemperatures() to issue a global temperature and Requests to all devices on the bus 57 sensors.requestTemperatures(); 58 59 Temperatura = sensors.getTempCByIndex(0) + CorrecTemp; 60 61 // Clears the trigPin 62 63digitalWrite(trigPin, LOW); 64delayMicroseconds(2); 65 66// Sets the trigPin on HIGH state for 10 micro seconds 67 68digitalWrite(trigPin, HIGH); 69delayMicroseconds(10); 70digitalWrite(trigPin, LOW); 71 72// Reads the echoPin, returns the sound wave travel time in microseconds 73 74duration = pulseIn(echoPin, HIGH); 75 76// Print measurements to bluetooth serial monitor 77 78BTserial.print("<"); 79BTserial.print(duration);BTserial.print(" "); 80BTserial.print(Temperatura);BTserial.print(" "); 81BTserial.println(">"); 82 83delay(150); // This speed must be less than or equal to the bluetooth clock speed in App Inventor 2 84 85}
Downloadable files
Sensor and nozzles
STL file for 3D printing
Sensor and nozzles.stl
Box lid
STL file for 3D printing
Box lid.stl
SoundSpeed_3D_2022
Arduino Code
SoundSpeed_3D_2022.ino
Body of the box
STL file for 3D printing
Body of the box.stl
Reflective tube_60 mm
STL file for 3D printing
Reflective tube_60mm.stl
Reflective tube_25 mm
STL file for 3D printing
Reflective tube_25mm.stl
Documentation
SoundSpeed_3D_2023
Fritzing circuit diagram
https://www.dropbox.com/s/ls8giivo4qxe391/SoundSpeed_3D_2023.fzz?dl=0
SoundSpeed_2024
AppInventor Apk version compatible with Android 12
https://www.dropbox.com/scl/fi/5pm2te0a121knrg8bg4jx/SoundSpeed_2024.apk?rlkey=qsj82wb9knze5hqliedki2snk&st=zriuhfa4&dl=0
SoundSpeed_2023_2
MIT App Inventor 2 Apk file
https://www.dropbox.com/s/w2gwhu61u1a7w8t/SoundSpeed_2023_2.apk?dl=0
SoundSpeed_2024
MIT App Inventor 2 Aia file
https://www.dropbox.com/scl/fi/99ud12qlucl41xgm8ob8x/SoundSpeed_2024.aia?rlkey=3gsw1h7x25bgmo1aaydy5mzwf&st=mo4owhwp&dl=0
Comments
Only logged in users can leave comments