September 2019 Update

New! We're moving to the new forum!

ALL new Blog posts will be on the forum.

Please join us there.

This Blog will no longer be updated...

Sunday, August 25, 2019

For every problem, there's a solution!

Posted: 12:35am

I recently purchased two small .96" 128x64 OLED screens and the first place I used it was on my prototype Mega Shield where I discovered that the I2C pin-out has the clock and data lines reversed, so my "universal i2c" connectors won't work with it.  No problem, I'll put a "reverse wired" i2c 4-pin female header on the Mega Shield so I can just plug it in there.

That's not the problem though.  The issue is, if I am placing a non-standard (at least for me) connector on the Mega Shield, what orientation should it be?   It is a display screen after all, and I'll likely want to be able to read it.

Since the Sensor Module has power and USB connectors at one end, and analog sensor connectors at the other end, the orientation of the Sensor Module itself may change. Right now, I have it on a shelf, so the sensor wires can't go to the back, there's no room with the wall right there, so I have it with the sensor wires hanging off the front of the shelf.  In an ideal setting, it will sit with the sensor wires hanging off the back of a shelf or cabinet etc.  Sensor Module 1 actually sits sideways on a shelf with the sensor wires hanging off the side of the shelf.  Since the order of the pins dictate the orientation of the screen when I plug it in, I may end up with a screen I can't easily read.

That's the problem I'm referring to.  I did manage to come up with a solution, a universal screen module mount :)


On the bottom of the board are the 4 pins, in standard i2c order, Ground, VCC, Data, Clock. On the top of the board, which you can see, 4 female headers, each connected to the pins underneath, but all of them have clock and data reversed, so they all work with the screen. Once I plug this into the Mega Shield in whatever orientation it requires, I can plug the screen into any of those 4 headers to ensure the screen is oriented so I can easily read it... I'm still working on it, that's why there are wires coming out the back :)   I can see the need for one that will hold the screen vertical eventually, or maybe even just a cable and the ability to mount the screen somewhere else. Possibly even a larger version of this, but with some buttons, so you could scroll through a menu, or make selections for configuration. The possibilities are endless :)

Speaking of "standard" or "universal connectors, most actually do have standards, but a lot of what I'm doing involves coming up with my own "standards". For example, if there is no real standard to dictate the order, I always place ground on the right, then VCC, then whatever else there is. This way, I'm less likely to mess up the wiring.  

I'll update this post once I've installed this and know it works (or not)

Update: 12:37am

Just as I posted this, and did a final proof read, I noticed something in the picture...

On the prefboard, look at the top left corner... see that black wire?   These connectors are supposed to be Black, Red, Blue, Green, and the screen will plug in and cover the whole board, so the top connector in the picture is correct, black on the left, but you see the wire diagonal to the connector on the left, and it's connected to the top pin.  If you turn the board 90 degrees to the right, so that left connector is on top, the black wire will be on the right, not the left where it should be...  I messed up because I was working on the back of the board, and soldered the black wire to the left pin, but turn the board over and that pin is now on the right <sigh>

Easy fix, glad I caught it before I destroy something....

Ok, I'll be back...

Update: 8:00am

Ugly ugly ugly...   There wasn't much room for the wiring, considering all 4 wires needed 5 connections each...   I managed to get them hooked up, now I just have to add a connector to the Mega Shield and test it...

Left is top, right is bottom...



Update: 9:20am

It works!  Did you doubt it?  I did, after the last couple days...

I ended up soldering those pins directly to the shield, since adding another header raised the screen up too high off the board and made it wobbly... I expect the solder joints would end up failing before long.

Here it is in action!




As long as I don't mount the module upside down, I'll be able to read the screen :)

Another successful mini-project :)  Now back to trying to figure out why the new code for the sensor module isn't working properly. Once I find and fix it, I can install these shields on the live modules. I have this one, plus the original prototype.

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed