Soluții

Arduino Distance Sensor with OLED Display

This project uses an HC-SR04 Ultrasonic Distance Sensor and a 0.96” I2C OLED display to measure and display the distance to an object in real-time.
It’s an excellent beginner-to-intermediate Arduino project that teaches sensor interfacing, I2C communication, and real-time data display.

In this guide, you’ll learn how to:

  • Connect and use the HC-SR04 Ultrasonic Sensor
  • Display the measured distance on an OLED screen
  • Format readings for easy readability

Components Required

Component Quantity Description
Arduino Uno / Nano / Mega 1 Main controller
HC-SR04 Ultrasonic Sensor 1 Measures distance via sound waves
0.96” OLED Display (SSD1306) 1 I2C display for output
Breadboard 1 For wiring
Jumper wires 6–8 Male-to-male connections
USB cable 1 For programming and power

The HC-SR04 measures distance by sending out an ultrasonic pulse and timing how long it takes to bounce back.
The Arduino calculates the distance based on the time delay and the known speed of sound.

Distance Formula:

Distance (cm) = (Time in microseconds × 0.034) / 2

The division by 2 accounts for the round trip of the sound wave (out and back).

Pin Connections

Component Arduino Pin Notes
HC-SR04 VCC 5V Power supply
HC-SR04 GND GND Common ground
HC-SR04 TRIG D9 Trigger pin
HC-SR04 ECHO D10 Echo pin
OLED VCC 5V Power
OLED GND GND Ground
OLED SDA A4 I2C Data
OLED SCL A5 I2C Clock

Note: On Arduino Mega, use SDA = 20 and SCL = 21 instead.

Arduino Code Example


#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define TRIG_PIN 9
#define ECHO_PIN 10
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
Serial.begin(9600);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);

// Initialize OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("OLED not found!");
while (true);
}

display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Distance Sensor");
display.display();
delay(1500);
}

void loop() {
long duration;
float distance;

// Send trigger pulse
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);

// Measure echo time
duration = pulseIn(ECHO_PIN, HIGH);
distance = (duration * 0.034) / 2;

// Print to Serial Monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");

// Display on OLED
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println("Distance Sensor");

display.setTextSize(2);
display.setCursor(0, 30);
display.print(distance, 1);
display.println(" cm");
display.display();

delay(500);
}

Explanation: The Arduino sends a pulse from the HC-SR04 and measures the time it takes to return.
It then converts this time into distance and displays it on the OLED screen.

Code Breakdown

  • pulseIn() measures the length of time the echo pin is HIGH.
  • Distance is calculated using the speed of sound (0.034 cm/μs).
  • Adafruit_SSD1306 and Adafruit_GFX libraries drive the OLED.
  • Display refreshes every 0.5 seconds for updated readings.

Install these via Arduino IDE → Sketch → Include Library → Manage Libraries:

  • Adafruit SSD1306
  • Adafruit GFX

Search for “Adafruit SSD1306” and “Adafruit GFX” and click Install.

Troubleshooting

Issue Cause Solution
OLED blank Wrong I2C address Try changing 0x3C to 0x3D
Distance always 0 Echo pin not connected Check TRIG and ECHO wiring
Unstable readings Object too close or far HC-SR04 range: 2–400 cm
Serial Monitor empty Wrong baud rate Ensure 9600 baud in Serial Monitor

Optional Upgrades

  • Add a buzzer that activates when an object is too close.
  • Display a bar graph or animation on the OLED.
  • Send readings to the cloud using ESP8266 / ESP32.
  • Log readings to an SD card.

Applications

  • Parking assist system
  • Object detection robot
  • Smart trash bin (auto open lid)
  • Liquid level detector.
[mai mult...]

Variante de a rezolva codul de eroare 80090016 al modulului Trusted Platform Module

Este posibil să întâmpinați această eroare cu aplicații precum Teams, Outlook sau aplicațiile Microsoft 365 pentru întreprinderi(OneDrive for Business, Excel, PowerPoint, Word). atunci când TPM nu reușește să se autentifice în mod securizat. Eroarea TPM 80090016 poate fi cauzată de date TPM corupte, setări de sistem configurate incorect, înlocuirea componentelor hardware sau firmware învechit.

La lansarea aplicațiilor Microsoft 365 pentru întreprinderi poate apărea următorul mesaj de eroare:

”Something went wrong. Your computer’s Trusted Platform Module has malfunctioned. If this error persists, contact your system administrator with the error code 80090016. More information: https://www.microsoft.com/wamerrors”.

TPM este o funcție de securitate bazată pe hardware utilizată pentru stocarea în siguranță a cheilor criptografice. Când TPM funcționează defectuos, aceasta afectează aplicații precum Microsoft Office, Teams sau Outlook, care nu se mai pot autentifica corect și raportează erori.

[mai mult...]

Cum verificați hash-ul fișierului cu PowerShell

Se va arăta integritatea fișierelor în Windows folosind PowerShell: calcularea sumelor de control cu Get-FileHash, compararea directoarelor după hash și detectarea fișierelor duplicate sau corupte.

Pentru a verifica dacă fișierele mari, distribuțiile sau imaginile ISO sunt descărcate complet, fără erori și nu au fost modificate în timpul transferului, puteți verifica hash-ul acestora. Spre deosebire de numele sau extensia unui fișier, hash-ul unui fișier(cunoscut și sub numele de sumă de control) este o valoare unică care depinde exclusiv de conținutul fișierului. Hash-ul rezultat poate fi comparat cu cel original pentru a verifica integritatea și autenticitatea fișierului.

În Windows, puteți calcula valoarea hash a oricărui fișier fără a utiliza instrumente terțe. Puteți utiliza fie comanda consolei CertUtil.exe, fie cmdletul Get-FileHash PowerShell.

[mai mult...]

4 common ways Windows PCs get hacked and how to prevent them

I’ve certainly seen my share of malware over the years, and while the methods evolve, our thinking must evolve too. It’s easy to believe the threats are all “advanced,” but for everyday Windows users, the majority of compromises still come down to the same few glitches that are recognizable to most. A click we shouldn’t have made, a “free” download we didn’t check well enough, or a system update we kept postponing. If you think you’re safe because you’re not part of some headline-grabbing breach, you might want to take another look.

To put it in perspective, the threat landscape isn’t slowing down anytime soon. According to recent data from Microsoft, their customers face 600 million attacks every day, showing that your PC isn’t just a target, it’s a potential doorway for hackers and bad actors. The bottom line is simple: the more you understand how attackers work, the easier it is to spot their tricks, and stop them before they get in.

Phishing scams still work because they feel real

Phishing and social engineering are old tricks painted up to look new. Instead of hackers brute forcing their way into your computer, they trick you into handing over the keys. They send messages that look real enough, emails from “Microsoft,” fake shipping updates, or urgent password reset links, that are all designed to get you to click before you think. It could be a fake tech support call claiming your PC is infected, or a pop-up that looks like Windows Defender in need of attention. It’s not about breaking through your security; it’s about getting you to open the door yourself.

My wife recently got a call from someone claiming to be from American Express. They told her my credit card had been compromised and needed data for “verification.” They even went as far as to say I was a suspect and that she shouldn’t discuss it with me. She texted me mid-call, thankfully, but by then she’d already shared enough information for them to steal money. Amex handled it quickly, but it was a painful reminder of how convincing these scams can be.

The best defense is knowing what to look for and having a good amount of healthy skepticism. Don’t click links in unexpected messages and never trust an email attachment unless you’re sure who sent it. If something feels too urgent or off, open your browser and go directly to the source instead of following the link. Turn on two-factor authentication everywhere, let Windows Defender do its job, and keep your system and browser patched. If you get a call from your bank or credit card company that seems strange, hang up and call them back on a phone line that you know is legitimate. Most phishing attempts fall apart the second you stop, think for a moment, and start verifying, because once you recognize the pattern, it’s much easier to see what’s coming.

Why pirated or ‘free’ software isn’t really free

Pirated software and “free” downloads present a real risk. Cracked apps and unofficial installers don’t just bypass license checks; they can often sneak in unwanted extras like spyware, adware, or hidden backdoors that run quietly in the background. Many of these fake installers look polished and professional, which makes them even easier to trust. The problem isn’t just that you might end up with a sluggish PC, it’s that you could unknowingly hand over your passwords, files, or even remote access to someone.

Before you install anything that didn’t come directly from the developer’s website or a verified store, pause and ask yourself if it’s worth it. File-sharing sites and “free” download hubs are often loaded with fake buttons, malicious ads, and “trojanized” files that look legitimate until it’s too late. Stick to official sources, open-source projects with active communities, or the Microsoft Store when possible. Keep Windows Defender active, scan new downloads before running them, and check the digital signature or hash of installers if you can. A few extra seconds of caution can save you from days of frustration, and potentially, a full system rebuild.

Outdated software is an open invitation

Running unpatched or unsupported software is like having a screen door in a submarine. It doesn’t matter how careful you are online, if the programs you rely on every day haven’t been updated, they can become an easy target. Attackers don’t need to find new exploits when there are millions of systems still running versions of Windows or apps potentially rife with vulnerabilities. Once software reaches end of life, it stops getting those quiet background fixes that keep you and your data safe and secure. And while that out-of-date media player or backup tool might seem harmless, it can still open the door for drive-by downloads, ransomware, or remote code execution exploits that take advantage of old code.

We’re already seeing this issue surface with Windows 10’s upcoming end of life. Millions of PCs still run it, and many of those systems don’t meet the hardware requirements for Windows 11. It’s understandable that users want to hold on to a reliable setup, but once Microsoft stops issuing security updates, every new exploit becomes a permanent hole in your armor.

I’ve written before about how browser extensions can go bad, and the same logic applies here. Every bit of software you install adds another potential point of failure. When a developer stops maintaining a tool, or you forget to patch a long-forgotten app, it becomes a blind spot in your security. The solution is less about paranoia and more about discipline: keep automatic updates enabled, uninstall what you don’t use, and periodically audit your installed software the same way you’d review browser extensions. Treat updates as part of normal system maintenance, not an inconvenience. In the long run, keeping your software current is one of the simplest and most effective ways to keep your Windows PC safe.

Malvertising: You don’t need to download anything to get infected

Sometimes all it takes is visiting the wrong website. Malvertising hides inside legitimate-looking ads on sketchy streaming or download sites, quietly redirecting your browser to a page that installs malware, adware, or harvests data in the background. Attackers buy ad space, disguise their payload as normal campaigns, and wait for clicks. Even legitimate ad networks can get fooled.

The fix is simple; use an ad blocker or your browser’s built-in tracking protection, avoid visiting sites that trade in pirated content or “free” movie streams, and keep your browser and extensions patched.

Good habits are your best defense

At the end of the day, keeping your Windows PC secure isn’t about mastering cybersecurity, it’s more about being thoughtful and deliberate. Most of us don’t think twice about the software we install, the sites we visit, or the alerts we ignore, but those quiet decisions can have serious real-world consequences. Technology will keep evolving, and so will the cyber-threats that we have to face, but a little awareness and consistency go a long way. Keep your tools up to date, question what doesn’t feel right, and don’t let convenience become the reason you let your guard down.

[mai mult...]

How to fix Printers that stop scanning without ink

1. Canon PIXMA Printer Override

Canon often provides the simplest override through a physical button press on the printer itself:

  • Locate the Stop/Reset Button: Look for the button marked with a red circle containing a triangle symbol, or sometimes labelled Resume/Cancel.
  • Perform the Override: Press and hold this Stop/Reset button for 5 to 10 seconds and then release it.
  • Result: This action should disable the ink-level detection for the empty cartridge(s) and allow the scanning function to work. If you receive a warning that ink detection is disabled, confirm it.

2. HP All-in-One Printer Workarounds

HP models are less consistent, but the solution often lies in the software or control panel settings:

  • Adjust Cartridge Settings: Access the printer’s on-screen menu or the HP utility software on your computer. Look for settings related to ‘Ink Alert,’ ‘Low on Ink,’ or ‘Cartridge Protection.’ If an option exists to ‘Continue,’ ‘Ignore,’ or ‘Disable Protection,’ select it.
  • Use the HP Smart App: Initiate the scanning process directly from the HP Smart App on your computer or mobile device. This can sometimes bypass the local printer’s control panel lockout.
  • Check for Hidden Menus: For certain older models with a touch screen, there might be a specific sequence of pressing the screen (like a Back, X, Back, Back, Back sequence) to access a service or support menu where status checks can be toggled. (Use this advanced method with caution.)

3. General Troubleshooting Steps (All Brands)

If the brand-specific methods fail, try these common steps:

A. Power Cycle / Hard Reset

  1. Turn the printer OFF using the power button.
  2. Unplug the power cord completely from both the printer and the wall outlet.
  3. Wait for a full 60 seconds.
  4. Plug the power cord back in and power the printer on. This clears the temporary error status.

B. Use Native Computer Scanning Software

Bypass the printer’s restrictive drivers by using the operating system’s built-in tools, which communicate more directly with the scanner hardware:

  • Windows: Use the Windows Fax and Scan utility or the Windows Scan app.
  • macOS: Use Image Capture (found in the Applications folder).

C. Clean Cartridge Contacts

A recognition error can sometimes be mistaken for an empty cartridge:

  1. Turn the printer off and unplug it.
  2. Remove the empty cartridge(s).
  3. Gently wipe the copper or gold contacts on the cartridge (and inside the carriage) with a lint-free cloth.
  4. Re-insert the cartridges firmly.

D. Update/Reinstall Drivers

  • Visit the manufacturer’s website and install the latest full driver software package for your model.
  • Alternatively, uninstalling all existing printer software and reinstalling only the basic native driver can remove restrictive software components.
[mai mult...]