Disclaimer and Social

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

Showing posts with label sparkfun. Show all posts
Showing posts with label sparkfun. Show all posts

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:

Wednesday, May 30, 2018

Got the LRA Vibration Motor Partially Working

SUCCESS !!! - well sort of. I can now make an LRA vibrator click and pop and hum - very weakly, but it's definitely progress.

Recently, I posted about finding (I thought) a mythical LRA vibration motor. After spending the last few hours combing through the 62 page spec-sheet for the DRV2605L Haptic Motor Driver Chip from Texas Instruments, I'm almost certain it really is an LRA vibrator.

I'm using the Adafruit Haptic Motor controller board for the chip, so I'm also using Adafruit's library. Sparkfun also sells the same type of board along with a library. Both manufacturers have an excellent, easy-to-use implementation for driving standard ERM vibrators (lots of fun). And both have a function for sending audio signals, like music or voice, to an LRA. However, neither has a good example for the command set for LRAs.

LRA vibrator with Adafruit DRV2605l Haptic motor controller on arduino uno
Hooking up the LRA (or an ERM) vibration motor is easy thanks to Adafruit's DRV2605L Haptic motor controller board. Even a classic Arduino is capable of handling it because all the calculations are handled by the chip. Just send a code over the I2C line and the waveform is executed. Tuning an LRA, now that's a lot more complicated.


Now I understand why, and it's not the fault of Adafruit or Sparkfun - the LRAs themselves are picky and tricky and each one is unique. The driver chip needs a lot of info about the physical operation of the LRA. There are lots of register bits to set and obscure mathematical formulas to deal with before the LRA resonates properly.

Although both libraries give you easy access to these register values, it doesn't do me much good because I don't have enough info about this specific LRA so I don't know what values that motor needs in those slots. Properly tuning the resonance for these motors seems more like a job for a skilled luthier, not an electronics hobbyist.





Nevertheless, I bravely went into the core CPP and H files (a scary thing for me) and set the hex values for some registry slots (according to page 15 of the manual). And what do you know - it works. The LRA moves and every one of the waveforms is distinct. Short or sharp or ramped or rumbling, they are all very distinct. But I have to have my finger touching the vibrator to feel them. When the vibe was still in a phone it would rattle my knee caps. So I'm still doing something wrong.

Compare this to using an ERM. The simple ERM just slings an off-balance weight around a shaft. It's easy to configure and the pulse is powerful. But the waveforms feel almost the same. Out of about 100 different waveforms, I can sense maybe five different feelings. The rotating mass just doesn't stop or start quickly enough, so the difference between a short pulse and a long one is negligible. A double or triple pulse feels like single pulse because the mass is still moving when the next pulse hits.

There may be ways to brake the ERM quicker, I'll explore more and report back. I know when I was making a haptic gaming chair I would hit the rumble-motors with a quick reverse or braking command to create a much sharper and stronger sensation. There could be commands for ERMs in these libraries that I just don't know about yet.

If I can find a well documented LRA cheaply enough I might get one or two. Until then I'll play with this scavenged one and randomly change values. I'm not the only one struggling with this issue of LRAs, so there are some good forum posts about it. But this whole process reminds me of the bad old days when electronics were obscure and difficult and confusing.

On a positive note, if the corporate "they" see enough of us playing with this (spending money) one of them will make us a nicely documented, simple to use LRA so we'll all buy them. Just sayin...

Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE

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:

Tuesday, January 2, 2018

Jewelry that Flickers and Flits with Pictures

Here's another way to add beautiful lighting effects to your jewelry. Tiny, inexpensive graphic screens are easy to embed in your projects. They aren't as bright and showy as LEDs like Neopixels, but they give you the ability to craft very customized light and color effects. You can animate them and even display images. And of course you can control them with an Arduino.


A really simple pattern adds a lot of visual interest to this millefiori piece. The pattern changes slowly over time to give the pendant a constantly transforming appearance. The light really helps draw the eye in dim lighting. If you don't want that, simply turn off the screen. You can create any pattern, animation or even image that you want and change them as slowy or quickly as you desire.

I'm going to use fused glass as an example again. I like to work with fused glass because it poses so many challenges and can have so many different forms. Each piece is unique and calls for a careful pairing of light.

And because fused glass is pretty all by itself, it's also challenging not to overpower the innate beauty of the material. Last week I posted about using a simple LCD light valve to add interest. That works well with semi-transparent glass.You can also use these tiny graphics screens to add patterns and lights to the same piece of glass.

However, I have struggled to find something that woks well with clear glass pieces. Nothing ever worked well in pieces that had areas of transparent glass. So I hauled out my LCD screen collection and tried some of them. I think this technique has some definite possibilities.






Both Adafruit and Sparkfun have a wide range of sizes and form factors for these types of screens. For jewelry, the "deck of cards" size is probably the biggest you would need for your largest statement pendant. I prefer the matchbook sized ones. I have played with the tiny thumbnail sized versions, but after getting diffused there isn't that much difference between them and a much cheaper LED.

Here are just a few of the screen sizes available. (That's a US quarter for scale)



There are a few things to remember when choosing a screen:

If you want to display actual images then you need to make sure the screen comes with an SD card slot so you can store the image or images.

Don't forget about the monochrome black-and-white versions if all you need is a gentle flicker. There are also versions where the entire screen can be any single color and you can draw in black.

The faster your microprocessor is the faster you can change the screen display. This might not be important to you. I can code and design animations well enough to get small chips to do what I need. But if you want to do fancy animations consider using a more powerful chip like the M0. With the Pi Zero, you could even play videos using the same screens.

You can use traditional tools like Photoshop or Illustrator to create your patterns and images. For people who don't code, this makes this technique much more accessible. You an also use code to draw over and manipulate images, so it offers the best of both worlds.








I will keep using the LEDs and NeoPixels for jewel based. big bling style projects. And the 3d printed jewelry actually needs all the brightness NeoPixels provide just to show through the plastic during daytime.

But the more I play with LCD graphic screens and glass the more possibilities I see. I've got several ideas, and the really neat thing about his technique is that you can leave the screen off to emphasize the beauty of the glass itself - or you can show any solid color, pattern, animation or image on the exact same piece.

In fact, the same piece of glass can be given a completely new "look" by changing what's on the display.

I'll post more images of my experiments soon, and I think I might need to start doing video just to better demonstrate the effects possible with this combo.


Also find me on: FACEBOOK 


Wednesday, December 6, 2017

Flexible OLED Display for Hobby Electronics

Finally, some affordable, flexible graphics displays are available for the hobby electronics market. There are now OLED and eINK style displays, and they are available from popular vendors that provide good libraries and tutorials. Let's take a look at a few of them.

Adafruit has two flexible eINK displays. They have a 2.13 (212x104) version and a 2.9" (296x128) version. Both are monochrome displays and both screens require a driver board. The screen can be bent to around 10mm. It should not be flexed repeatedly, and should not be flexed during refresh. Like most eInk displays, it takes a few seconds to redraw an image and the screen should only be refreshed once or twice a minute. Amazon also lists several flexible eInk & driver board combo kits (affiliate link).

Sparkfun has aa flexible and bendable OLED graphic display. It's a 1.81" grayscale display that can be bent to a 40mm radius. It is a 160x32 4-bit grayscale display and comes with an attached SPI driver board. It can flex during refresh, but it's probably not meant for constant bending and flexing. But the ability to wrap a changing picture around a curved surface opens up all kinds of possibilities. (Also sometimes available on Amazon (Affliate Link))


flexible OLED display
Image courtesy of Sparkfun.com under the Creative Commons CC BY 2.0


Imagine the possibilities:
  • Hats with a changing logo, or showing "First Down" or displying the final score as you walk out of the stadium.
  • Bracelets with a scrolling images or the names of your children or declarations of love.
  • Shoes that show your current step count 
  • Just being shaped and non-flat makes the display eye-catching. Put one up at your next crafts fair or over your POS impulse purchase area.
  • Combine two or more for larger shapes.



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

Also find me on:

Wednesday, April 19, 2017

Party Light with EL-Wire

One of the easiest ways to add some "wow" to any lighting project - EL-wire is cheap and super simple to work with. This project adds some reflective panels courtesy of the fins from a gigantic aluminum heat-sink that I scavenged from a discarded stereo.

The spacing between the fins was perfect for the width of the EL-wire. And the polished metal surface gave a cool 3D effect to the project.



You can see the "wire" wrapped around the base in this photo, and notice how the light reflects all the way to the top because of the shininess of the metal.



The light carries all the way to the outside edge of the aluminum heat-sink. Usually, EL-wire projects are either flat or a 3D wireframe. But the heat-sink looks like a 4x4 cube and the way the light falls off and reflects adds to the three dimensional effect.

Also, the aluminum fins hide the EL-wire itself except for certain angles. So the look of the light changes as you move around it.





El-wire is very simple to install and run; just plug it and turn it on. You can find controllers of various power levels, everything from a coin cell, 1xAAA to 4xAA on up to 12v. The more power the controller is the more wire you can run and the brighter the glow is.

Most of the controllers have at least a few display modes (always on, slow blink, fast blink etc.) There are versions that react to sound. And Sparkfun has two versions that use Arduinos to create programmable displays with up to 8x different wires.






If you want to create your own party-light I would strongly suggest buying your supplies from either Sparkfun or from Adafruit. Both of these companies feature high quality, durable and very bright versions of EL-wire components. I have bought the cheap versions from other vendors. They do work, but they are always much dimmer and more fragile. If you want a dependable, brightly glowing version stick to the versions from Sparkfun or Adafruit - they are worth the extra cost in the long run.

Also check out my glowing pillow project on Instructables for more ideas about how to use EL-wire.

Or how about my 3d printed EL-wire bracelet for raves and festivals.