You Can Use LEDs As Sensors, Too

LEDs are a wonderful technology. You put in a little bit of power, and you get out a wonderful amount of light. They’re efficient, cheap, and plentiful. We use them for so much!

What you might not have known is that these humble components have a secret feature, one largely undocumented in the datasheets. You can use an LED as a light source, sure, but did you know you can use one as a sensor?

Continue reading “You Can Use LEDs As Sensors, Too”

RepTrap Keeps Watch Over Our Cold-Blooded Friends

Wait a second, read that title again. This isn’t a throwback 3D printing project at all. That’s “RepTrap” as in reptile trap, and it’s a pretty clever way to study our cold-blooded friends in their natural habitat.

Now, game cameras — or trail cameras, if you’re less interested in eating what you see — are pretty much reduced to practice. For not that much money you can pick up one of these battery-powered devices, strap it to a tree, and have it automatically snap high-quality pictures of whatever wildlife happens to wander past. But nearly all of the commercially available game cameras have pyroelectric infrared sensors, which trigger on the temperature difference between a warm-blooded animal and the ambient temperature of the background. But what to do when you’re more interested in cold-blooded critters?

Enter [Mirko], who stumbled upon this problem while working with a conservation group in Peru. The group wanted to study snakes, insects, and other ectothermic animals, which are traditionally studied by trapping with pitfalls and other invasive techniques. Unable to rely on PIR, [Mirko] rigged up what amounts to a battery-powered light curtain using a VL53L4CD laser time-of-flight sensor. Mounted above the likely path of an animal, the sensor monitors the height of everything in its field of view. When an animal comes along, cold-blooded or otherwise, RepTrap triggers a remote camera and snaps a picture. Based on the brief video below, it’s pretty sensitive, too.

[Mirko] started out this project using an RP2040 but switched to an ESP32 to take advantage of Bluetooth camera triggering. The need for weatherproofing was also a big driver for the build; [Mirko] is shooting for an IP68 rating, which led to his interesting use of a Hall sensor and external magnet as a power switch.

Continue reading “RepTrap Keeps Watch Over Our Cold-Blooded Friends”

This Air Particulate Sensor Can Also Check Your Pulse Rate

The MAX30105 is an optical sensor capable of a great many things. It can sense particulate matter in the air, or pick up the blinking of an eye. Or, you can use it as a rudimentary way to measure your heart rate and blood oxygen levels. It’s by no means a medical grade tool, but this build from [Taste The Code] is still quite impressive.

The MAX30105 contains red, green, and infrared LEDs, and a very sensitive light detector. The way it works is by turning on its different LEDs, and then carefully measuring what gets reflected back. In this way it can measure particles in the air,  such as smoke, which is actually what it was designed for originally. Or, if you press your finger up against it, it can measure the light coming back from your blood and determine its oxygenation level. By detecting the variation in the light over time, it’s possible to pick up your pulse, too.

Getting this data out of the sensor is remarkably easy. One need only hook it up to a suitable microcontroller like the ESP8266 and use the MAX3010X library to talk to it. [Taste The Code] did exactly that, and also hooked up a screen for displaying the captured data. Alternatively, if you want the raw data from the sensor, you can get that too.

It should be noted that this build was done for educational purposes only. You shouldn’t rely on a simple DIY device for gathering useful medical data; there are reasons the real gear is so expensive, after all. We’ve looked at this sensor before, too, not long after it first hit the market. Continue reading “This Air Particulate Sensor Can Also Check Your Pulse Rate”

Bed Sensors Do More Than You’d Think

Bed sensors do sort of sound like a gimmick — after all, who cares whether someone is occupying the bed? But if you think about it, that information is quite useful from a home automation standpoint. A person could do all sorts of things in this state, from ensuring the overhead lights in the room can’t come on, to turning off other smart devices that are likely not being used while both occupants are sleeping.

[The Home Automation Guy] presents a couple of ways of doing this, but both center around a fairly inexpensive pressure-sensing mat.

In the first method, he connects the pressure mat up to a Zigbee Aqara Leak Sensor, which conveniently has two terminals on the back to accept the wires from the pressure sensor. Then he simply connects it up to a Zigbee-compatible home assistant like the Aqara Hub.

In slightly harder mode, he forgoes the Aqara Leak Sensor and connects the pressure mat up to an ESP32 using a nifty screw terminal dev board. Then he sets up the sensor and all the desired actions in ESPHome. Of course, with an ESP32, it’s easy to add a second pressure mat for [Mrs. The Home Automation Guy]’s side of the bed.

Now, once they’ve both gone off to bed, the house goes into night mode — all the smart plugs, Sonos devices, and other things are powered down, and the alarm system is put into night mode. Be sure to check out the build video after the break.

Continue reading “Bed Sensors Do More Than You’d Think”

Converting Bluetooth Sensors To Zigbee

With the increase in popularity of Internet of Things (IoT) devices and their need to communicate wirelessly,  there’s been a corresponding explosion of wireless protocols to chose from. Of course there’s Wi-Fi and Bluetooth, but for more specialized applications there are some other options like Z-Wave, LoRa, Sigfox, and Thread. There’s a decent amount of overlap in their capabilities too, so when [SHS] was investigating some low-cost Xiaomi sensors it was discovered that it is possible to convert them from their general purpose Bluetooth protocol over to the more IoT-specialized Zigbee protocol instead.

These combination temperature and humidity sensors have already been explored by [Aaron Christophel] who found that it’s possible to flash these devices with custom firmware. With that background, converting them from Bluetooth to Zigbee is not a huge leap. All that’s needed is the Zigbee firmware from [Ivan Belokobylskiy] aka [devbis] and to follow the steps put together by [SHS] which include a process for flashing the firmware using an over-the-air update and another using UART if the wireless updates go awry. Then it’s just a short process to pair the new Zigbee device to the network and the sensor is back up and running.

Converting from one wireless protocol to another might not seem that necessary, but using Bluetooth as an IoT network often requires proxy nodes as support devices, whereas Zigbee can communicate directly from the sensor to a hub like Home Assistant. Other Zigbee devices themselves can also act as a mesh network of sorts without needing proxy nodes. The only downside of this upgrade is that once the Bluetooth firmware has been replaced, the devices no longer has any Bluetooth functionality.

Thanks to [RoganDawes] for the tip!

Capacitive Rainmeter Measures The Sky Water Just Fine

If you’ve got a smart home, or you just want to know how soaked your garden is getting in the winter, you might want to measure rainfall. There are a bunch of ways to go about it, and this capacitive rainmeter solution from [Magnus Thome] might just be the perfect solution you’re looking for.

Like many who came before, [Magnus] had experimented with traditional resistive-based sensors using copper traces to measure water levels. As the soil moisture measuring set learned as well, corrosion tends to promise a pretty short life for these designs. Capacitive sensors, on the other hand, can be isolated from the water itself, and thus sense the levels without being subject to such degradation.

[Magnus] pairs the off-the-shelf capacitive sensor with an ESP32 charged with reading it and reporting back to Home Assistant. It’s also outfitted with a heater to keep it at a constant temperature to avoid it freezing over during those cold and snowy Swedish winters.

It’s a tidy way to integrate a quality commercial sensor with a DIY smart home setup. If you’ve been whipping up your own neat sensor networks for your smart home, don’t hesitate to let us know. Video after the break.

Continue reading “Capacitive Rainmeter Measures The Sky Water Just Fine”

Simple CMOS Circuit Allows Power And Data Over Twisted-Pair Wiring

If you need to send data from sensors, there are plenty of options, including a bewildering selection of wireless methods. Trouble is, most of those protocols require a substantial stack of technology to make them work, and things aren’t much easier with wired sensors either. It doesn’t have to be that complicated, though, as this simple two-wire power-and-data interface demonstrates.

As with all things electronic, there are tradeoffs, which [0033mer] addresses in some detail in the video below. The basic setup for his use case is a PIC-based sensor — temperature, for this demo — that would be mounted in some remote location. The microcontroller needs to be powered, of course, and also needs to send a signal back to a central point to indicate whether the monitored location is within temperature specs. Both needs are accommodated by a single pair of wires and a tiny bit of additional circuitry. On one end of the twisted pair is a power supply and decoder circuit, which sends 9 volts up the line to power the PIC sensor. The decoder is based on a CD4538 dual monostable multivibrator, set up for an “on” time of one second. A trigger input is connected to the power side of the twisted pair going to the sensor, where a transistor connected to one of the PIC’s GPIO pins is set up to short the twisted pair together every half-second. Power to the PIC is maintained by a big electrolytic and a diode, to prevent back-feeding the controller. The steady 0.5-Hz stream of pulses from the sensor keeps resetting the timer on the control side. Once that stream stops, either through code or by an open or short condition on the twisted pair, the controller triggers an output to go high.

It’s a pretty clever system with very simple and flexible circuitry. [0033mer] says he’s used this over twisted-pair wires a couple of hundred feet long, which is pretty impressive. It’s limited to one bit of bandwidth, of course, but that might just be enough for the job. If it’s not, you might want to check out our primer on current-loop sensors, which are better suited for analog sensors but still share some of the fault-detection features.

Continue reading “Simple CMOS Circuit Allows Power And Data Over Twisted-Pair Wiring”