If you learned electronics through beginner kits and tutorials, at least one of these sensors is probably sitting in your prototype right now.

If you learned electronics through beginner kits and tutorials, at least one of these sensors is probably sitting in your prototype right now.

One of them has been discontinued for years.

Another one can't legally ship in products sold in Europe.

And if any of them make it into your final design, you're looking at bad data, angry customers, expensive redesigns, or even a failed safety certification.

Now, there's nothing wrong with these sensors for learning, and I'd never tell a beginner to avoid them.

But there's a big jump between a prototype that works on your bench and a product you can manufacture, certify, and sell.

Once you make that jump, every sensor gets judged on five things: accuracy, lifecycle, compliance, power, and safety.

So in this video, I'm counting down seven popular sensors that fail those filters, starting with one that's simply inaccurate and ending with one that's actually dangerous.

For every single sensor, I'll also give you a production-grade replacement, usually for close to the same cost in volume.

Components that pass every test on your bench can still fail once they're inside a product.

Click here to watch or read

Sensor #7 - The DHT11 and DHT22

The DHT11 is the little blue temperature and humidity sensor that comes in basically every starter kit ever sold.

It costs about a dollar, there are ten thousand tutorials for it, and it works within minutes of opening the box.

The problem is that it was never designed to go inside a real product.

Its accuracy is only rated to plus or minus 2°C, the humidity readings are even worse, and the unit-to-unit variance is wide enough that two sensors from the same batch will noticeably disagree.

It also talks over a nonstandard one-wire protocol with strict timing requirements, so readings randomly get corrupted.

And since these are cranked out by countless factories of unknown origin, you never really know what you're getting.

In a product, all of that adds up to bad data, support tickets, and returns.

The DHT22 is a little better on paper, but the 22 shares the same flaky protocol, the same variance problem, and the same questionable supply chain.

The replacement is the Sensirion SHT40 or SHT41.

These are tiny, factory-calibrated sensors that communicate over standard I2C, and their accuracy is actually specified across the full operating range.

TI's HDC3020 is another solid option, and if you want pressure sensing in the same package, take a look at the Bosch BME280.

In production volumes you're talking a couple of dollars, which is a small price to pay for temperature and humidity data you can trust.

Sensor #6 - The HC-SR04 Ultrasonic Distance Sensor

The HC-SR04 is that classic ultrasonic module with two silver cans that look like a pair of eyes, and it's probably the cheapest, easiest way anyone's ever measured distance with a microcontroller.

For learning how ultrasonic ranging works, it's great.

But this is a 5V module living in a world where most modern microcontrollers run at 3.3V, so you need level shifting just to connect it safely.

It's also a big through-hole module rather than a component you can place in your own PCB layout, and it eats a ridiculous amount of space inside an enclosure.

There's no temperature compensation either, and since the speed of sound changes with temperature, your distance readings will drift with the weather.

Add in condensation problems outdoors and those fragile exposed transducers, and you've got a sensor that only behaves in a climate-controlled room.

And once you put it behind an enclosure or a grille, the acoustics change and your readings shift all over again.

To be clear, ultrasonic sensing is a perfectly valid approach for products.

The problem is this specific two-dollar module.

For short-range distance sensing, the VL53 family of time-of-flight sensors from ST is excellent, and these measure how long it takes light to bounce back from a target.

If you truly need ultrasonic, MaxBotix makes product-grade sensors that aren't necessarily cheap, but their spec sheet and reliability are exactly what you're paying for.

And if all you need is basic presence detection, a simple reflective IR sensor does the job for pennies.

Sensor #5 - The HC-SR501 PIR Motion Module

The HC-SR501 is the white-domed module that gives you working motion detection in an afternoon for about two dollars.

That dome is a special type of lens that chops the sensor's view into zones, and motion gets detected when something warm crosses from one zone to the next.

Sounds like a dream for any product that needs motion sensing, right?

That convenience is exactly what makes it a trap.

The sensitivity and timing are set with two trimpots, which are tiny screw-adjusted dials, and there's no way to replicate those settings consistently across thousands of units in production.

The retrigger behavior is inconsistent, the onboard regulator has its own quirks, and false triggers are a constant complaint, especially with a Wi-Fi antenna nearby.

In a security or lighting product, every false trigger chips away at your customer's trust until they stop using the product completely.

Once again, this is a module with a form factor that has no place on a production board.

The production answer here is Panasonic's EKMC and EKMB series.

These give you a clean digital output, specified sensitivity, a whole range of lens options, and a package designed to be soldered directly into products.

The EKMB versions are made specifically for battery products, with current draw of just a few uA.

And if you want true presence detection, where the sensor still knows a person is there after they stop moving, check out the STHS34 from ST.

Sensor #4 - MQ-Series Gas Sensors

The MQ-series gas sensors, like the MQ-2 and MQ-135, are what everyone reaches for the moment a product needs to sniff out smoke, gas, or air quality.

The first dealbreaker is power, because the heater inside these sensors burns roughly 750 to 900mW continuously.

That means a battery-powered product is dead on arrival, since this one sensor drains more power than the entire rest of your design combined.

They also need a burn-in period of a day or more before readings settle, they drift constantly over their lifetime, and they respond to practically every gas at once.

So without calibration against reference gases, which you can't realistically do, the numbers coming out of these sensors mean almost nothing.

This means you can never use these for any kind of safety function, period.

Gas and carbon monoxide detection in products is a certified category with strict safety standards, and if your product claims to protect people, that liability lands directly on you.

A certified detection module costs more, but it comes with the testing and documentation that regulators, retailers, and insurance companies demand.

For general air quality sensing, use the Sensirion SGP40 or SGP41, which measure volatile organic compounds, or VOCs, the airborne chemicals given off by things like paints and cleaners.

If you want real CO2 measurement, the Sensirion SCD40 or SCD41 gives you that in a tiny package.

And for detecting one specific gas, look at electrochemical cells from companies like SPEC and Figaro.

Sensor #3 - The MPU-6050 IMU

The MPU-6050 is different from everything else on this list, because honestly, it works pretty well.

It's the motion-tracking chip on those cheap little breakout boards sold everywhere, combining an accelerometer and a gyroscope in a single part, with a decade of tutorials and mature software libraries behind it.

The problem is that TDK InvenSense officially flagged the 6050 as not recommended for new designs years ago.

The part is discontinued, and a lot of what's sold on hobby modules today is remarked or flat-out counterfeit silicon.

Counterfeit silicon also means every new reel you buy can behave a little differently, which turns your firmware tuning into a guessing game.

You can't build a production product around a discontinued part, because you're one supply hiccup away from a stopped production line.

I've seen lots of members come into my Hardware Academy who designed their product around a part that was already nearing the end of its life.

One of them had built his design around the 6050's big brother, the 9-axis MPU-9250, and had to switch parts mid-development when it went end of life.

And the swap wasn't trivial, because the replacement ran its data lines at 1.8V, so he had to add level shifting to his design just to talk to the new part.

When a manufacturer marks a part as not recommended for new designs, that part is living on borrowed time, and no amount of tutorial popularity will bring it back.

The good news is the replacements are better in every way.

TDK's ICM-42688, Bosch's BMI270, and ST's LSM6 family all give you better specs and lower power, and they're actually in production.

Pick any of those three, and you'll never think about the 6050 again.

Sensor #2 - Cadmium Sulfide Photoresistors

Photoresistors, also called LDRs, short for light-dependent resistors, are about as simple as a sensor gets, just a two-lead part whose resistance changes with the light hitting it.

The only reason they're still everywhere is inertia, nobody's ever had a strong reason to look for something better.

This is also the sensor I mentioned at the start, the one with a legal problem.

The classic photoresistor is made from a compound called cadmium sulfide, and cadmium is restricted under RoHS, the European regulation that limits hazardous substances in electronics.

In practice, that means these photoresistors can't go into a product sold in the EU.

So the cheapest, most familiar light sensor on Earth is effectively banned from one of the biggest markets in the world.

Even if compliance weren't a problem, these are terrible sensors anyway.

They respond slowly, nobody fully specifies which wavelengths they react to, and the part-to-part variance is so wide they barely qualify as sensors.

The replacement is a real ambient light sensor IC, like the Vishay VEML7700, the TI OPT3001, or the Lite-On LTR-303.

These give you calibrated brightness readings in lux over I2C, they're fully RoHS compliant, and in volume they cost around a dollar or less.

Sensor #1 - ACS712 Current Sensor Modules on Mains Voltage

The ACS712 current sensor module is the dangerous one, and I saved it for last on purpose.

It's the cheap "measure AC current" board at the heart of every DIY energy monitor tutorial.

Now, the Allegro chip itself is a legitimate part.

The hobby breakout board it sits on is not.

These modules route mains voltage through PCB traces with nowhere near the creepage and clearance that safety standards require, and that's just the minimum spacing between high voltage and everything else on the board.

There's no reinforced isolation, and the screw terminals are often completely exposed.

Inside a product, that's a shock hazard, a fire hazard, and an automatic certification failure all rolled into one.

So if you need to monitor AC current in a product, the standard approach is a shunt resistor paired with an isolated amplifier like TI's AMC1302, laid out on your own board with the proper spacing.

A current transformer is the better choice when you'd rather keep mains off your board entirely, since it just clamps around a wire and gives you an isolated measurement by design.

Allegro also makes newer parts like the ACS37800 that are made to be integrated correctly into your own layout, and certified energy metering modules are another safe option.

Whatever you choose, treat anything that touches mains voltage with the respect it deserves, because this is the one category where a bad sensor choice can actually hurt somebody.

Talk soon,

John

P.S. If you need help selecting the right sensors and avoiding these common mistakes in your hardware product, you can get guidance from me and other experts inside the Hardware Academy.