Disclaimer and Social

This page may contain affiliate links. As an Amazon Associate I earn from qualifying purchases.

Showing posts with label sensor. Show all posts
Showing posts with label sensor. Show all posts

Sunday, April 28, 2019

Lightning Detection with Arduino

Summer heat and those amazing afternoon thunderstorms are already starting, so I'm thinking of adding a lightning detector to my DIY weather station. I've wanted a lightning sensor for a while, but they have always been expensive, tricky to calibrate, and had a bad reputation for hobby level users.

However, two things have changed this year and both make it possible for even an amateur like myself to connect a reliable lightning sensor to my Arduino - all for around $30 USD.

Lightning sensor detectors for Arduino DIY Weather Station
My DIY weather-station needed a lightning detector sensor for my Arduino base unit. Luckily there are several good options that are easy and cheap to buy and install.


First, vendors have recently begun selling reliable, easy-to-use boards based on the AS3935 detector chip. Even better, the supporting code libraries and tutorials are finally understandable to mere mortals. With that combination, I expect to see more options like this coming onto the market.

Second, I now know enough to hack into those cheap commercial lightning sensors, take the alert/alarm signals and feed them into my microcontroller - all without destroying the sensor. That might be simple for you, but it's a big deal for me.

(If you just want to watch the lightning strikes visit Lightningmaps.org or Blitzortung.org or make your own node at en.blitzortung.org/cover_your_area.php.)

Monday, June 4, 2018

Run an I2C Bus up to 100' on Ethernet

Here's something I didn't know I needed. It's new breakout boards from Sparkfun and another, slightly different version from Adafruit that lets you extend your Arduino's I2C bus up to 100' using Ethernet cable. 

The Sparkfun version uses a PCA9615 chip and their Qwiic connect system. The Adafruit version uses the LTC4311 chip and their STEMMA QT connector system. Both breakout boards also have breadboarding holes for connecting to power, ground and the I2C lines either by soldering wires directly or with pin headers.

The sensors and/or the microprocessor get connected via the Qwiic/STEMMA connectors. The two systems are interchangeable. The long-run signal is sent through the Ethernet line.

The Sparkfun version requires a board at both ends. It also has an Ethernet port built in. The board actually translates the signal and passes it to the other board where it is translated back into an I2C signal. This version also has the ability to send mixed voltages for power and signal, with the configuration selectable by jumpers.

The Adafruit board is more like a booster/active-terminator. Placed (usually) at the beginning of the cable (next to the microprocessor) it boosts and cleans the signal so that it can be sent farther. You can extend the range with a longer run using just the STEMMA port, but will need to connect the STEMMA port to an Ethernet cable for really long runs. A short video explains why.

Both boards work well, so choosing the best option depends on your needs and hardware requirements.

I just spent the last year learning how to create reasonably reliable data packets for Bluetooth and LORA. Now, I can place sensors and displays 100' feet apart and still use the reliable native I2c protocol instead. 

These hardwired boards provide several advantages over Bluetooth, LORA or even WiFi.
  • Power is transmitted over the Ethernet cable, so you don't need to have batteries or power at the remote location. (Unless you're driving devices like motors or solenoids)
  • You won't need to reset and pair your RF devices anymore. No more dropped BT/LORA/WiFi connections.
  • Only one processor is needed. With RF communication, you need a brain for the transmitter and another for the receiver. With these extenders, you only need the one main brain to send and receive signals.
  • Less likely to be hacked than RF communication
Two situations immediately come to mind:
  • Place the sensors, controllers, and MCU in the uncomfortable or hazardous environment, but have the data-display and control panel in a safe, comfortable location. Great for monitoring and controlling machinery from inside the office. Say a greenhouse where the fans, pumps and lights are in a hot. humid environment but you want to see the sensor data and machine-status inside your nicely airconditioned office. In this scenario, the main power supply would be near the MCU so you can pull power for relays and motor drivers easily. It powers the MCU and sensors also. Only the graphical display, inside that perfectly cooled office, is running off the Ethernet extender
  • Place just the sensors someplace like an attic or crawlspace. You can monitor the temperature, humidity or water levels from the display mounted on an Arduino inside your house. Since the power comes from the ethernet cable, you won't have to crawl under the house to replace batteries ever again. 

I2C range extender over ethernet
Let's say I want to monitor and control some lights and motor from a distance. Here's a simple topology that might work. I can read the sensor data off an I2c capable display, and give commands to the MCU with control buttons on the display. This could be great for controlling lights and fans in the greenhouse from the comfort of the air-conditioned office.




I2C range extender over ethernet
Or maybe I just want to put some sensors in a remote location (attic or crawlspace) while keeping my central MCU and command panel inside. I might never have to access that crawlspace again - unless the sensors tell me there's a problem.


Remember, the boards do send power over the ethernet cable, but not a lot. So you might need to provide a local power source if you want to drive relays, motor controller boards, or even a big display. But the docs make it look easy, just change a few jumpers to connect to local power.

I will still use RF in some of my projects. And since this uses the I2C bus, you can still use RF on the serial lines for a hybrid system. If you need to transmit data for a half mile, or a couple of kilometers, then LORA or XBee is still a good bet. Or if  you can't run cables or the remote location changes frequently, then Bluetooth and WiFi are still good options. 

But both of these boards look really interesting for anything I want to install permanently in a nasty or difficult to access environment.

As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

Thursday, March 8, 2018

DIY Thermal Vision Camera for < $100

Now, you too can see heat maps of human bodies or car engines like Predator - or identify cold spots and drafts in your house like a home-energy expert. And with a little DIY electronics knowledge, you can do it really inexpensively.

Although the sensor is only an 8x8 array, you can interpolate the readings to emulate a finer grain, and with a little coding, adjust how the temperatures are shown.


A big price-drop on Panasonic's AMG8833 8x8 Grid-EYE thermal sensor array has finally allowed hobby electronics suppliers to create a fun and useful thermal camera at a price everyone can afford - less than $50. Compare that to the more than $250 for a FLiR dev board with an 80x60 grid.

As you might expect at this price point, there are limitations. The sensor is only 8x8 pixels and has a range of less than 25 feet (7 meters). You will not be able to identify enemy paintballers from across the battlefield, and you can't get a full-house image of your heat loss. It requires a brain (Arduino or RasPi) with I2C, libraries and a graphics screen. Most people reading this probably already have a microcontroller and screen, so that's no big deal. But faster processors will give you smoother video feeds.


Here's a great teaser video from Adafruit on how to make this into a cute camera version.




Looks cool right, then see the full tutorial and make one of your own.


Adafruit has two versions of the sensor module: a tiny breakout board (item# 3538) and a Featherwing daughter board (item# 3622) made to snap right into any of their Feather boards. And of course the best thing about getting the Adafruit version is their high quality libraries and well written tutorial. They even have a tutorial on hooking it up to a Raspberry Pi

Sparkfun has also released a breakout board (SPX-14568) from their experimental SparkX labs. It uses their QWIIC connection system and also has a library for Arduino.

All the tutorials I've seen so far use a graphic display. But you could display the output on NeoPixels, on a servo-array or translate it into sounds. You could draw images with sparklers. Since you also have access to the raw data you could store time lapses. Combine this with traditional movement and distance sensors for more accurate navigation for your robots, or add another layer to your home security system. If you can code, you can create anything you want.

For less than $50 you get a useful sensor that's far more than a toy - definitely worth checking out for a wide variety of uses.


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

Saturday, February 10, 2018

What's Inside an Old Humidifier

What's inside an old ultrasonic humidifier, and is there anything worth salvaging? The short answer is YES, lot's of fun stuff in there.

Someone donated this old ultrasonic humidifier for us to tear down. I hoped we could get the speed control and maybe a fan out if it. But I didn't know if everything would be on a single PCB and therefore difficult to salvage. Luckily, all the main components were separate and the PCB only supplied the power.

So we wound up getting a bunch of good components that we can re-use. We also got some nifty tidbits that will be good for prop building. Check out the short video to see what we found...





It looks like the humidifier had gotten hit with a power surge. But this thing was sturdy and it still sort of worked, if very weakly. There was almost no mist or air coming out of it. Once we cracked the case we could see why. The surge had run in and fried the AC components. It's surprising that it still worked at all, but it made it easy for us to decide to salvage it instead of repairing it.

We tested the salvaged components and they all worked fine. My two favorites are:
  • An all-in-one power switch with speed control and LED indicator complete with housing
  • And a magnetic reed switch type sensor along with a floating circular trigger magnet.
Both of these still worked perfectly. We also got some nice heat-sinks, some JST connectors, a small cage fan and several oddly shaped items perfect for use in cosplay or prop building,








Knob and Controls
The speed control is perfect for an Arduino project. It has three completely separate circuits going into the same housing to control three functions. There's a high current circuit to the on/off switch, a mid current to potentiometer, and a light-duty circuit to the LED.

I also noticed that they were using the potentiometer more like what I think as a rheostat. Even though the potentiometer has three tabs, they were only using two. But the tabs are accessible, so we can always add the traditional third line of the circuit.

With this configuration, you can turn the project on, then control an analog input with a single knob. The LED can be pulsed or blinked to give visual feedback.

And it's in a great housing that's really easy to mount into any project. It's circular and flat, so no weird shapes and curves to match. Just cut a hole, a big hole, into any enclosure and you have a very nice control panel - sweet!

Water Level Sensor
My other favorite find was the magnetic reed switch and magnet combo. This sensor is already on a slim PCB with a handy JST connector. And the floating ring-magnet is already sized to trigger the switch.

That's going to make using this as a water level sensor so much easier. These sensors and magnets are cheap to buy, but configuring them can be a hassle. When they come pre-matched and sold for use in fountains the price goes way up. So to get these for free was a pleasant surprise.

Overall, I'm very happy with the haul from this old humidifier. And the video was fun to make so I might start recording more teardowns. We have a room full of donated items, a huge random collection of semi-junk to tear apart and explore - loads of fun for the whole family - and much better than experimenting with items that still work.


Also find me on: FACEBOOK