Stații de lucru
OS - Windows 8940 Solutii
Reguli si plangeri 9 Solutii
OS - OS X 410 Solutii
Reguli de configurare 12 Solutii
Licentiere 18 Solutii
Securitate 182 Solutii
Copie de rezerva (Backup) 68 Solutii
Antivirus 72 Solutii
Aplicatii specifice 5123 Solutii
Hardware 291 Solutii
Copilot in the Terminal: How to use GitHub Copilot straight from the command line
[mai mult...]Arduino Ultrasonic Sensor
The sensor sends out an ultrasonic sound wave from the TRIG pin. When the sound wave hits an object, it reflects back and is detected by the ECHO pin.
The Arduino measures the time it takes for the signal to return and uses that to calculate the distance.
Distance (cm) = (Time in microseconds × 0.034) / 2
The speed of sound is 0.034 cm/µs. We divide by 2 because the sound travels to the object and back.
Required Components
| Component | Quantity | Purpose |
|---|---|---|
| Arduino Uno / Nano / Mega | 1 | Main microcontroller |
| HC-SR04 Ultrasonic Sensor | 1 | Measures distance |
| Jumper Wires | 4 | Connections |
| Breadboard (optional) | 1 | Easy wiring |
| USB Cable | 1 | Power & programming |
Pin Connections
Connect the HC-SR04 sensor to the Arduino as shown below:
| HC-SR04 Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| TRIG | Digital Pin 9 |
| ECHO | Digital Pin 10 |
Note: The ECHO pin outputs 5V, which is safe for Arduino Uno/Nano/Mega.
Arduino Code
Upload the following code to your Arduino:
#define TRIG_PIN 9
#define ECHO_PIN 10
void setup() {
Serial.begin(9600);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
}
void loop() {
long duration;
float distance;
// Clear trigger
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
// Trigger ultrasonic burst
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
// Measure echo time
duration = pulseIn(ECHO_PIN, HIGH);
// Convert time to distance
distance = (duration * 0.034) / 2;
// Output result
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(500);
}
Code Explanation
- pulseIn() measures the duration of the ECHO signal.
- The sensor sends a 40 kHz ultrasonic burst using the TRIG pin.
- Arduino calculates the distance based on the speed of sound.
- Distance is printed in centimeters to the Serial Monitor.
Testing the Sensor
- Upload the code to your Arduino
- Open the Serial Monitor
- Set the baud rate to 9600
- Move your hand in front of the sensor
- Watch the distance update live
You should see something like:
Distance: 15.4 cm
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Always reads 0 cm | Incorrect pin wiring | Check TRIG and ECHO |
| Values jump around | Object surface curved or too small | Use a flat object |
| No Serial output | Wrong baud rate | Set Serial Monitor to 9600 |
| Sensor not working | No power | Ensure 5V and GND connected properly |
[mai mult...]
Transferul datelor de orice tip catre dispozitive cu iOS/iPadOS folosind wi-fi + VLC
Daca dorim sa transferam date catre un smartphone sau tableta Apple fara a utiliza iTunes ori a fi limitati la fotografii si inregistrari video, echipa VideoLan au pus la dispozitie aplicatia VLC inclusiv pe Apple AppStore cu functionalitatea de wi-fi sharing inclusa.
[mai mult...]Imposibilitate alimentare electrica terminal Apple cu conector Lightning / disfunctionalitati conector
Desi conectorul lightning (acum tip legacy, dar inca prezent pe multe dispozitive) este unul bine proiectat din punct de vedere al andurantei, datorita dimensiunilor fizice ale acestuia se pot infiltra particule sau materiale ce pot provoca disfunctionalitati.
[mai mult...]Cum ajutam la stabilitatea si buna functionare a sistemului nostru Windows
Free Window Registry Repair promite sa mentina sistemul mai stabil si sa il ajute sa functioneze mai rapid. Registrul este inima si sufletul oricarui sistem Windows. Acesta contine informatii care controleaza aspectul si comportamentul sistemului. Aproape toti utilizatorii de Windows experimenteaza treptat scaderea performantei PC-ului lor, o mare parte din aceasta poate fi atribuita erorilor Registrului Windows.
[mai mult...]