Friday, September 10, 2021

Arduino Pro Mini Vin/RAW vs. Vcc vs. FTDI

Goal

Connect an Arduino Pro Mini such that external devices get their power from an external power supply, while the Pro Mini remains connected via FTDI to a USB port on a computer, for programming, and serial-monitor uses.

Challenges

  • Powering the Pro Mini board + external devices totaling more than 200mA exceeds the rating for the on-board voltage regulator (VReg) on Vin/RAW.
  • Powering the Pro Mini board using Vin/RAW (i.e. VReg input > the board's operating voltage / 5v or 3.3v) sends voltage/current back, from the VReg output, through various routes, into the FTDI output pins, and in turn through the USB connector, risking damage to the USB port on a computer used for programming or a serial monitor.
    • Note: Disconnecting the FTDI +5v pin prevents the FTDI from communicating with the Pro Mini, and doesn't block all the backflow paths anyway.
  • Powering the Pro Mini board using its Vcc pin with an externally regulated voltage matching the board's operating voltage, basically attaches to the same "bus" as the output pin of the on-board VReg.  This conflicts with input voltage from the USB/FTDI and may backflow current into the USB port.
    • This might be tolerated, but still isn't an ideal, safe way to hook things up.
  • Logic voltage to control high-power external devices (e.g. motor, LED-array, or loud buzzer) must use the same reference +/- voltage as the board, or HIGH and LOW might make no sense.

Solution

While programming and developing, ONLY connect the GND of the external power supply to the GND of the Arduino Pro Mini, creating a common reference point for the Negative / NEG / "-" / Ground / 0v point, but _NO_ connection or conflict for the Positive / POS / "+" / Vcc.

Later, in order to run the external devices directly from the external power supply, and separately also run the Arduino Pro Mini from the same external power supply, completely remove the FTDI/USB device, and connect the external power supply to the Pro Mini via the appropriate pin, Vcc or Vin/RAW.

Explanation

The reason this works is that the difference in potential (voltage) observed relative to GND is polarized / directional based on which way current flows in the circuit.  If the GND reference point for both the board+USB and the external power supply are tied together, then the relative reference point for current flow, is also common.

Transistors (typically used to allow low-current logic to control a higher current device) trigger (amplify) based on current flow, so it only matters that the signal (base) current flows the same direction as the load (collector/emitter) current.  With the GND for both power sources (USB/FTDI and external) tied together, the current flow direction will match.

Connection Scenarios

  1. Programming / Development / Debugging
    • USB/FTDI Connected - supplies power to Arduino Pro Mini
    • Only Arduino Pro Mini GND pin connected to external power supply GND
      • i.e. Pos NOT connected
    • Pos and Neg from external power supply connected to supply power on external devices
  2. Standalone
    • USB/FTDI NOT connected to Arduino Pro Mini
    • Both Pos and Neg from external power supply connected to Pro Mini Vcc and GND
    • Pos and Neg from external power supply connected to supply power on external devices

Disclaimer:

The terminology used here, and maybe even some of the technical statements might not be expressed in the same terms as are used to explain electronics circuits and concepts elsewhere.  This was just my attempt at explaining things the way it makes sense to me, so that when I forget how this works, I can use this as a reminder.  Hope it helps someone else who is struggling with the same thing while developing with an Arduino Pro Mini.

Some of the discussions about this seem to go nowhere, or end in unresolved debate:
  • https://forum.arduino.cc/t/power-the-pro-mini-through-vin-and-serial-ftdi-chip/317067 
  • https://forum.arduino.cc/t/connecting-5v-vcc-to-an-arduino-pro-mini-or-to-any-arduino/340382
  • https://electronics.stackexchange.com/questions/97184/how-to-power-arduino-pro-mini-via-vcc-pin-12v-input
  • https://forum.arduino.cc/t/powering-pro-mini-and-ftdi-serial-question/252020

Tuesday, February 23, 2021

2010 Subaru Outback - LED Headlight Conversion


 Overview

The Subaru Outback is a really popular car, right?  There are millions of them on the road, right?  Things that are annoying about popular cars get solved with aftermarket products after a while, don't they?  Well, I'm puzzled, because the halogen lowbeam (H7) headlights on a 2010 Subaru Outback burn out WAY too often (every ~10 months in my recent experience), and they are an ENORMOUS pain to swap out.  Yet, there seems to be no reasonable options to install LED headlight bulbs.  I finally had enough, and spent some time designing my own solution.  This post is meant to share what I did, so that maybe someone else will have a bit of a head start on the whole endeavor.

Existing Solutions

SubieLED.com

The LED kits from this company seem to be relatively easy to install, and work with the existing dust cover by including an LED with a wide, low-profile heat sink.  Another option looks like it would require the dust-cover to be left off.  Here's a link to their stuff, in case they get them back in stock, or offer them at a more reasonable price:  http://www.subieled.com/#!/Low-Beam-H7/c/48078355

CarRover Silicone Dust Cover

Using these seemed like it might work with many of the standard H7 bulbs you can get for $30 or $40 from Amazon and various other sources.  I even ordered some but when I got them, and thought about it a little more, I realized they wouldn't really close up the headlight housing since the spring clip would be in the way, and if the wire from the LED module/bulb comes out the back, it somehow has to go back into the headlight housing to connect.  That further disrupts the dust seal allowing moisture or dust to get in, so they're still not ideal.

Others

I'm sure there are other LED "bulbs" or dust-cover options that might sorta work for a 2010 Subaru Outback, and there are quite a few that say they'll work, but I really didn't find any that were meant for my specific application.  If you're reading this and you know of something, please add a comment.

My Solution

I have a 3D printer, and reasonably good 3D design skills, so I decided to tackle this with my own "resources." The process was a little annoying since I also decided I was done paying yet-another-$30 for more halogen bulbs, and one of them had already burned out, so I was a bit reluctant to drive after dark.  Then the other halogen burned out, so I was stuck not using the Subie until I worked out how to get the LEDs installed.

Inverted Dust-Cover

I started with the basic idea of an inverted dust cover that leaves the LED heat sink out where air circulates to cool it, and still seals up the headlight housing.  However, unlike the "one size fits all" silicone dust cover, mine would need to either account for the spring clip, or replace its function by holding the LED H7 in place.  There was also the challenge of routing the wire from the rear of the LED back into the headlight housing to connect with the car's wiring harness.


Rigid Plastic

3D printers can produce flexible objects like silicone, but most of the time they work with rigid materials like PLA or ABS.  With strategic use of a few o-rings, I decided the best way to replace the function of the spring-clip was to make the dust-cover fit precisely into the opening and hold the bulb in place.  Here's a sketch of what that means for those who understand things better visually than verbally.

Pass-Thru for the Wire

The final challenge (or so I thought) was passing the wire through from outside back into the headlight housing.  You can make any shape you want with a 3D printer, so that was just a matter of printing a slot for the wire, and a plug to cover up the slot after the wire was in.  Easy!!  Well, ok, it was one of the more tedious parts of creating the 3D model, but still not a complete roadblock.

Tight Spaces


The actual final challenge was that the inverted dust-cover could not be maneuvered into the headlight housing with the LED already installed.  The "blade" part of the LED just sticks out too far, and the dust cover has to slide around in front of metal cross-member in the body of the car.  The only option is to get the dust-cover in place with the flange part of the LED and then install the LED body.  The risk of dropping the LED flange and/or the o-ring into the bottom of the headlight housing was promising to be a show-stopper.  I REALLY didn't want to add the chore of fishing those things back out of the housing to the already-frustrating ordeal,  But, back to the 3D printer for a solution... all it took was a substitute for the LED body, without anything sticking out, to use during installation.  The downside is that this is where the whole solution really locks into a specific LED product (for now).

More about the Lock-In

As I mentioned in the previous section, this solution is not only specific to a 2010 Outback, but also to a specific LED product.  It's not that this product is necessarily any better than others, but just happens to be the one I settled on.  The main drivers for my choice were, A) fanless design, B) good reviews, C) BeamTech brand generally has good reviews on all products, and D) 30,000 hours lifespan.  So, here are the details.

  • BeamTech H7 - BEAMTECH-CCD17-05-S2-H7
    • At Amazon: https://smile.amazon.com/dp/B071J4SCXY/ref=cm_sw_r_tw_dp_NCWMMWCDBZEWQ9ER9YHP
    • At BeamTechs.com: https://www.beamtechs.com/collections/j1-led-headlight-bulb/products/beamtech-h7-led-headlight-bulb-fanless-csp-y19-chips-8000-lumens-6500k-xenon-white-extremely-bright-conversion-kit
By the way, the headlight housing is the same on some other Subaru models, like the Legacy sedan, and possibly other year models (maybe through 2014).  I'm not 100% sure which ones this might also work on.

Summary


There are a few sub-optimal ways of installing LED headlights in a 2010 Subaru Outback and as a result of the time I spent obsessing over the design and development, there is (now) a more workable, and/or affordable option.  Hope this inspires someone else to tackle this project and eliminates some of the guesswork that I had to stumble through.

I know not everyone has a 3D printer, but if you do, and you want to do this project without working all that out for yourself, you can find the model files to print these exact dust-covers and the installation tool for a small fee here:  https://cults3d.com/en/3d-model/various/2010-subaru-outback-led-headlight-dust-cover

I also occasionally have some idle time on my 3D printer, so if it's not an option to print it for yourself, I can print the parts and put together a kit with the o-rings and screws you'll need (but you buy the LED bulbs yourself).  Based on previous, similar projects, I'll ask $50 to reimburse materials, printer setup time, trip to UPS, packaging materials, etc. + actual shipping cost (probably around +$10 to most places in the U.S. and +$25 international).  Just email me at subaru.ledmod @ liveintellect . org (remove the spaces) to request.  I'll let you know how quick I can get it done, arrange for Paypal or something similar, and go from there.

Saturday, January 23, 2021

Userscript to Automatically Click "Not Now" on the PayPal "Get the App" Nag

I finally had enough of the prompt EVERY TIME I LOG IN to PayPal nagging me to get their stupid mobile app.  Here's the UserScript (tested in TamperMonkey) to detect when that annoying "Get the App" page pops up right after login, and automatically find the "Not Now" link, and automatically click it.  This is what I would do anyway from now on, so the browser might as well do it for me.


// ==UserScript==
// @name         SkipPaypalLoginNag
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically click the "Not now" link on PayPal's aggravating "every time you log in" Nag to get their stupid mobile app
// @author       Super-Annoyed PayPal User
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require      https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match        https://www.paypal.com/cgp/app-download*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
    waitForKeyElements ("[data-name='continue_to_the_website']", clickTheNotNowLink);

    function clickTheNotNowLink() {
        var skipLink = document.querySelector("[data-name='continue_to_the_website']");
        if (skipLink) {
            console.log("Found the link to skip this annoying thing");
            skipLink.click();
        } else {
            console.log("Didn't find the link to skip the annoying thing");
        }
    }
})();

Saturday, December 19, 2020

Mr. Heater Missing Manual Links

Not sure why Mr. Heater chose to more or less hide this content from their customers, but it took me way too much time to find links to the PDF manuals for these Mr. Heater consumer products.  There's no obvious place on the Mr. Heater web site with links to these documents, but they're still online and accessible. Eventually I stumbled over the right combination of search words in Google to get a hint at the URL for these documents on the Mr. Heater web site.  

This post is just to help others who simply want to grab an electronic copy of the manual for a product they have, and keep that info on a phone or tablet (or even desktop/laptop computer I guess) instead of carting around the paper copy that comes with the products.  I didn't make this content, and am taking no responsibility for it... just linking to it on the Mr. Heater web site.  So, I'm sure they'll eventually re-organize things and break these links.  The clock starts now 12/19/2020, until that happens.  When/if I notice the links are broken, I'll try to find time to update this.  Enjoy.

Buddy Flex

  • Buddy Flex Heater - MH11BFLEX - 2020 USA
    • https://www.mrheater.com/mwdownloads/download/link/id/31/
  • Buddy Flex Cooker - MH8CFLEX - 2020 USA and Canada
    • https://www.mrheater.com/mwdownloads/download/link/id/32/

Portable Buddy

  • Portable ("Little") Buddy Heater - MH8BX - 2020 USA
    • https://www.mrheater.com/mwdownloads/download/link/id/36/
  • Portable ("Little") Buddy Heater - MH9BX - 2020 Canada
    •  https://www.mrheater.com/mwdownloads/download/link/id/37/

  • Portable Buddy Radiant Heater - MH4B - 2020 USA
    • https://www.mrheater.com/mwdownloads/download/link/id/33/
  • Portable Buddy Radiant Heater - MH4B - 2020 Canada
    • https://www.mrheater.com/mwdownloads/download/link/id/34/
  • Portable Buddy Radiant Heater - MH12HB - 2020 USA (Camo)
    • https://www.mrheater.com/mwdownloads/download/link/id/38/
  • Portable Hunting Buddy Radiant Heater - MH12HB - 2020 Canada (Camo)
    • https://www.mrheater.com/mwdownloads/download/link/id/39/

Portable Big Buddy

  • Portable Big Buddy Radiant Heater - MH18B - 2020 USA
    • https://www.mrheater.com/mwdownloads/download/link/id/40/
  • Portable Big Buddy Radiant Heater - MH18B - 2020 Canada (Outdoor Only)
    • https://www.mrheater.com/mwdownloads/download/link/id/41/
  • Portable Big Buddy Radiant Heater - MH18B - 2020 USA (No Fan)
    • https://www.mrheater.com/mwdownloads/download/link/id/42/
  • Portable Big Buddy Radiant Heater - MH18B - 2020 USA (No Fan / Outdoor Only)
    • https://www.mrheater.com/mwdownloads/download/link/id/43/

Tank Top Heaters

  • Gas-Fired Infra-Red Portable Heater - MH15 (1-lb canister version)
    • https://www.mrheater.com/mwdownloads/download/link/id/57/
  • Gas-Fired Infra-Red Cooker/Portable Heater - MH15C (1-lb canister version)
    • https://www.mrheater.com/mwdownloads/download/link/id/58/
  • Gas-Fired Infra-Red Tank Top Heater - MH15T, MH30T - 2019 (single and double dish)
    • https://www.mrheater.com/mwdownloads/download/link/id/59/
  • Gas-Fired Infra-Red Tank Top Heater - MH15T, MH30T - 2020 (single and double dish)
    • https://www.mrheater.com/mwdownloads/download/link/id/60/
  • Gas-Fired Infra-Red Tank Top Heater - MH45T - 2019 (triple dish)
    • https://www.mrheater.com/mwdownloads/download/link/id/61/
  • Gas-Fired Infra-Red Tank Top Heater - MH540T - 2020 (mushroom shaped)
    • https://www.mrheater.com/mwdownloads/download/link/id/62/

Other Stuff 

(besides the typical portable heater products)
  • Battery Operated Shower System / BOSS - F235897 - 2017
    • https://www.mrheater.com/mwdownloads/download/link/id/27/
  • Battery Operated Shower System / BOSS - XB13, XW18 - 2019
    • https://www.mrheater.com/mwdownloads/download/link/id/28/
  • Battery Operated Shower System / BOSS - XCW20 - 2019
    • https://www.mrheater.com/mwdownloads/download/link/id/29/
  • Portable Radiant Golf Cart Heater - MH4GC - 2020
    • https://www.mrheater.com/mwdownloads/download/link/id/35/
  • Base Camp Angle Iron Stoves - F235825, F235830, F235835 - 2019
    • https://www.mrheater.com/mwdownloads/download/link/id/26/
  • Mr. Heater Propane Accessories (catalog) - Hoses Fittings Regulators Accessories -2021
    • https://www.mrheater.com/mwdownloads/download/link/id/1/
  • Mr. Heater 2020 Product Catalog - 2020
    • https://www.mrheater.com/mwdownloads/download/link/id/4/

Wednesday, August 5, 2020

Webex Teams Auto-Correct Settings

Summary

This is about disabling the annoying auto-correct features in Webex Teams (on a Mac).

Searched for this answer but it does not appear to be in any obvious place in the docs.

The settings are also not accessible in the main "preferences" dialog for the Webex Teams application.

TL/DR

Right (or control) click in the text area where you type a message, select the "substitutions" pop-up menu item and toggle things on/off.

More detail...

You can toggle on/off
  • Smart Copy/Paste
  • Smart Quotes
  • Smart Dashes
  • Smart Links
  • Data Detectors
  • Text Replacement

Search/Index Keywords

auto-correct autocorrect auto correct substitution substitute dash dashes link links replace replacement fix fixing ignore quote quotes hyphen hyphenate hyphens webex teams chat instant message type typing enter entering send sending

Wednesday, July 8, 2020

When a Maven Release Build says it "Could not resolve dependencies," but...

In This Corner - Apache Maven

I've had this fight with Maven before.  I was always in such a hurry when I finally made the change that ended the fight, that I never stopped to analyze exactly why the issue was resolved.

The whole thing starts when Maven sucker punches me right at the end of the round, when I've got everything working, and it's time to do a release build using the maven-release-plugin.  The build works perfectly, UNLESS it is running within the release plugin.   WHYYYYYYYYYYYY!?!?!?!

The error message starts with: "Could not resolve dependencies" but it goes on to say that the actual dependency that it failed to retrieve is a peer module in the same multi-module project.  That's when I scream obscenities and threaten to change all my builds back to Ant (which at this point, I'm not sure too many people even remember).

Wait.  Why is it trying to "retrieve" it?  It's a peer module, which should be resolved from the reactor.  Why is it trying to find it in a remote repository???

Then the hammering begins...

  • Check that all the groupId tags match each other
    • Yup.  Even removed them from child modules so they're inherited. That's not it.
  • Check that all the version tags match up so the release plugin replaces all of them at once.
    • Yup.  All good,  Even pulled them up into the parent pom's dependencyManagement and used {$project.version} instead of a string that could get messed up.  That's not the issue.
  • Clean up all the dependencies that aren't used (copied/pasted from another project)
    • Didn't work.  No difference.
  • Change the order of the modules in the parent pom
    • Didn't work.  Didn't expect it to.  The reactor reorders them for the build anyway.
  • Add the enforcer plugin in the parent project.
    • Didn't find anything wrong.  At least this keeps my co-workers from dorking it up though.  Will leave that enabled and probably go put it in other projects too.
  • Change the version of plugins to different ones that might have a bug fixed
    • Nope. Same behavior.
  • Compare poms section by section with another project that is building ok.
    • Nothing is jumping out.  The look the same.  WHAT IS DIFFERENT?!?!?
  • Maybe it's character encoding or whitespace.
    • Well, that was a longshot anyway.  Copy/paste in the same IDE/Editor.  Check binary character codes.  That's all the same.

Then the futile Googling begins...


  • Search "maven reactor multi-module dependencies failure"
    • Find some idiot saying to run mvn install, but I already know to NEVER DO THAT!!
  • Search "maven-release-plugin bug"
    • Nothing matches
  • Search "maven-dependency-plugin bug"
    • It actually might be this, but nothing is reported.  Read on and speculate for yourself.
  • Search "maven is stupid and I hate it"
    • Found lots of pointless ranting.

Clues, Circumstances, Sketchy Evidence, and a Good Guess

Then I remember that the state of the Maven reactor changes during the different parts of the build lifecycle.  That has to be related to why the peer module's artifact is missing in action.  But still, why is it ONLY happening during a release build?

Then I see something in the pom for the module that is failing that might explain it.
  <plugin>
      <groupid>org.apache.maven.plugins</groupid>
      <artifactid>maven-dependency-plugin</artifactid>
      <version>3.1.1</version>
      <executions>
          <execution>
              <goals>
                  <goal>properties</goal>
              </goals>
          </execution>
      </executions>
  </plugin>


So, ok... that is related to a hack for a code generation plugin so that it forces Maven to resolve a properties value like this:
<properties>
    <swaggerRef>${com.example.services.myservice:common-abbreviations-service:json:webapp}</swaggerRef>
</properties>

...early enough in the build for the code generation plugin to use it.

So, that explains why the dependency plugin is busy doing stuff BEFORE the reactor has everything ready to resolve locally.

But, it still DOESN'T explain why it only happens in a release build.

Stay tuned.  One day I'll figure out that part too.

(TL/DR) Solved

For now...
If you're having this kind of issue in a build, look around for something that is forcing the normal Maven lifecycle to execute in an unusual order.  The way I resolved this one was to refactor things a bit and make the hacky code-gen module a "leaf" in the module tree.  If there are no peer-module dependencies, it doesn't matter, even in a release-build, if the dependency plugin runs too early.

Saturday, September 21, 2019

Amazon Save For Later Changed My Shoe Size

I recently added a pair of boots to my Amazon cart, size 11, but I wasn't quite ready to buy.  Then my daughter asked me to order a clothes drying rack, so I had to click "Save for later" on the boots to move them temporarily out of the cart.  A few days later, I had read enough reviews on the boots, and decided it was time to place the order.  I found the boots in the "Saved for later" section of my Amazon cart, and clicked "Move to Cart" (no idea why "Cart" is capitalized but "later" is not, but semantic inconsistencies were not related to the issue anyway).

I placed the order, assuming that if I selected size 11 when I added the boots to the cart, the item I was ordering would still be size 11 after "Saving for later" and "Moving to Cart."  A few days later, I received a pair of size 10 boots.  My first thought was, "bummer, how could I have messed that up?"  The more I thought about it, the more I convinced I became that it wasn't my mistake at all.  I haven't been able to cram my size 10.5-11 foot into a size 10 shoe since it was still actually a size 10, which was maybe my sophomore year of high-school (i.e. a REALLY long time ago).  I would never, ever select a size 10 shoe, under any circumstances.

So, out of curiosity, I started looking for the reason I ended up with size 10 boots, and another chore on my list to return/exchange the boots with Amazon.  I opened a new browser window, where I wasn't even logged into Amazon, and navigated to the product page for the boots.  The screen starts with a drop down box pre-set to "Select" which forces a choice from the other options (7, 8, 9, 10, 11, etc.).  If I chose anything from that list, it would have been 11, not 10.  So, maybe I mistakenly clicked the wrong option.  Maybe I'm also blind and couldn't see what I had clicked.  Maybe I also didn't notice the incorrect size after clicking "Add to Cart" (which becomes part of the item title).  By the way, now I'm starting to think Amazon's interpretation of the word "Cart" characterizes it as a formal noun.  Perhaps the website designer has a friend who is also named "Cart."

I really wish there were a way to tell Amazon they have a bug in their website, but the reality is, they could not care any less, unless it is a security vulnerability.   So, how do I know it's a bug?  I have this (maybe bad) habit of leaving dozens, perhaps sometimes hundreds, of browser tabs open.  I get interrupted by family members, random thoughts, reminders on my phone, barking dogs, overheard nearby conversations, and probably all sorts of other things. So I open a new tab, leaving the current one open, whenever I decide the interruption requires some info I might find on the web.  I happen to have left the tab open on my Amazon.com cart, from when I first added those boots (before "Saving for later" or "Moving to Cart").  The size, 11, was clearly shown at the end of the cart-item's title.  Now I'm reasonably sure I did what I thought I would have done... picked my own correct shoe size.

If you spent the time to read this, I hope you get the time back someday soon when/if something you added to your Amazon cart... sorry "Cart"..., then moved to "Saved for later" and then moved back to your cart, gets resized, color-changed, or some other selection shifts without notice.  If you're paying just a bit closer attention, and get things corrected before placing the order, maybe it'll save you the hassle of shipping something back.  At the very least, maybe this confirms that you might not have made a mistake, or you might not actually be losing your memory (yet).

I haven't been able to get Amazon's "Cart" + "Save for later" feature to fail in the same way again, and I don't intend to spend any more time on it.  If you notice this happening, and have a set of steps to make it happen, leave a comment.  I'd like to know if anyone else has tripped over this annoying little quirk.