Disclaimer and Social

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

Showing posts with label controller. Show all posts
Showing posts with label controller. Show all posts

Thursday, August 27, 2020

Control a Bare LCD with Just an Arduino

Yes, you can control simple bare-bones LCD displays using just an Arduino. No driver boards or additional chips are required. If you have controlled a 7-segment LED display directly from an Arduino, you can do the same with an LCD. 

However, there are a few tricks to doing it correctly. It's easy really. But I was trying to do it with mystery, undocumented displays. As you might guess, much fun and hilarity ensued.

Power control and drive a bare LCD with an Arduino
This LCD is being controlled with just an Arduino. There are no additional chips or driver boards, just the bare LCD and an Arduino. The LCD was scavenged from an old CD player. It has a 7-segment display as well as icons and animations. Using salvaged LCD screens can lead to all sorts of surprises. This tiny display, with only nine pins, is actually quite complex to control. It has multiple layers of displays that are controlled by changing which pin you use as the common pin.


Why a Bare LCD

I have plenty of working LCD displays in all sizes and types. They are easy to hook up and simple to control with an Arduino. Why would I want to use a bare LCD instead? 

Well, because I have them and because I didn't know how to use them. It was a challenge.

Over the years I have scavenged a large collection of LCD displays out of broken electronic devices. They still worked when I salvaged them, but I had no idea how to

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:

Friday, April 13, 2018

Mythical Vibrator Found?

I might have found one of the legendary LRA vibration motors. I can't be sure yet, but all the signs are there. It looks like a standard ERM, but it acts more like a piezo and its magnet is incredibly powerful. (Check out the update - it is and it kind of works)


Is this an LRA linear resonant actuator virator motor in an old cell phone.
So is this an LRA vibration motor? It looks like a standard ERM pancake motor. But it's got a really strong magnet and operates like a piezo. I'm going to hook it up to my haptic driver controller and test it out.


What's the big deal? Well the LRA (Linear Resonant Actuator) is rumored to have a better feel for haptic feedback devices. When your phone vibrates, or the screen clicks or taps or buzzes when you touch it - that's an LRA.

An LRA acts like a speaker. When current is applied, a weight moves back and forth in a linear motion. Like a speaker, this allows you to create complex waveforms that can be felt kind of like you hear waveforms in music.

Compared to a regular ERM (Eccentric Rotating Mass) vibrator, LRAs provide a wider range of sensations. That's why they're used for tactile feedback in all your phones.





You can find standard  ERMs everywhere, from the tiny disk shaped motors in a bristlebot, to the huge versions in your back massager. They are cheap, readily available and easy to work with. But they have a very limited vocabulary. All you can really do is adjust the speed and duration. Even with modern controllers, you can't use ERMs for sophisticated feedback tasks.

By contrast, LRAs are difficult to source and many use connector sizes I'm not comfortable working with. You also need to be either a serious programmer or buy a specialty controller board to use them. I do own one of those controller boards, a haptic feedback driver, so I can test my newly found vibe as soon as I figure out how to tweak the registers. Luckily, this motor is also large enough and uses connectors that I can see without a magnifying glass.

If I get it working without blowing anything up, I will certainly post my experiences here.


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 1, 2018

Hack Your Game Controller - Part #1 the Teardown

Everybody dreams of hacking their game control pad and making it control something else. Maybe to run their RC car, a robotic arm, or maybe their home theater system.

Other folks need to mod their controller so they can use it better. Not everyone has full use of both hands, yet most game controllers require two hands. What if you want to reconfigure the buttons and place them elsewhere, or turn them into foot pedals.

Either way, the process of modding requires a medium level of electronic knowledge and some crafting skills. There are some good tutorials out there for hacking specific controller models to do specific things. That's great, but what if you don't have that specific controller. Or what if you want to do something different than the what the tutorial shows you.

I've seen too many people start modding their controllers and then stop because their model or their needs are too different from the tutorials. Also, I don't know of any good generic introductions to hacking and modding game controllers.

I was one of those people who gave up the first time I tried it, and it has taken me more than three years of tinkering with electronics to learn enough that I can take parts from multiple tutorials and mix them together to work with my controllers. Now it all seems so simple, not even worth writing a tutorial on.

But I recently saw another person starting the learning process and remembered how overwhelming it could be. So I thought I would do a series of simple videos to help get newbies started - to teach enough of the basic concepts so that they can pick out the useful parts from other how-to guides.

The first step is look inside some game controllers. Then poke around and notice the differences and similarities in various models. That's what this video does - we tear down three old game controllers and have a quick look around.



(Or go directly to the YouTube video on my channel)

Just cracking the case and looking around can be really scary for first timers. Having buttons and switches falling out, not really understanding how it all works, where the electrical signals come from or where they go - it can be overwhelming.

Remember back to when you didn't really understand the difference between digital and analog signals, and you didn't "just know" which components did what. That's who these first few videos are designed for. So be patient, the real fun stuff is coming up after we cover the basics.

In this video we salvage a few parts, just cut them right off the PCB and leave the wires dangling and unconnected. Savage!!! The next video will explore how to re-use the parts we scavenge in this video. We'll look at the buttons and the joysticks and get a better understanding of digital versus analog signals.

We'll even explore how we can hook these salvaged parts up to an Arduino microcontroller. And all these concepts will be useful if you want to simply relocate buttons using your existing controllers.

As the series grows I will make a project page. There is a lot of good information out there on modding game controllers, so as the concepts are introduced I will link to these videos and tutorials.

If a few of you crack the cases of your controllers and rip parts out to use elsewhere, then this video will be a success.


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

Also find me on: