Author Topic: Borderlands style jewelry box research thread  (Read 11889 times)

0 Members and 1 Guest are viewing this topic.

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #75 on: May 08, 2019, 12:19:31 am »
Posted another post for just the NeoPixel issue. Wow, Just wow. I'm a dummy. In my "lidPixel" initialization I used "neoPixelCount" twice instead of using "neoPixelPin" for the second parameter. That was the problem.

It works now. Moving on!
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #76 on: May 08, 2019, 02:30:53 am »
In a previous post in this thread Ian.M was talking about interrupt issues with the servo Library and the NeoPixels. I did a little googling about various color swipe libraries and saw this TiCoServo library that seems to be able to run alongside something like FastLED.

https://learn.adafruit.com/neopixels-and-servos/the-ticoservo-library

Does anybody know how well these work? Specifically the TiCoServo library.
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #77 on: May 19, 2019, 04:28:28 pm »
Ok so I'm thinking the photointerrupter switch is over-engineering based on my initial thought of having a simple photo resistor as the trigger for the drawers. It would be much simpler to have the drawers simply push a button when they are closed. I'm thinking something like this instead: https://www.jameco.com/z/SS-5GL2-Omron-Snap-Action-Switch-N-O-N-C-Single-Pole-Double-Throw-Hinge-Roller-Lever-Solder-5-Amp-250-Volt-AC-14-Volt-0-49n-Screw-Mount_187733.html

The thing is that is rated for AC. Can I just assume it will work with my DC circuit? My little 5v won't be pushing anywhere near even a full amp though it.

EDIT: I'm also SUPER confused about this barrel plug receiver schematic. I assume I only need to use two of the three pins but I can't make heads or tails of which is which.
https://www.jameco.com/z/WTJ-020-37A-2-1mm-Male-DC-Power-Jack-Breadboard-PCB-Mount-_2210677.html?CID=MERCH
https://www.jameco.com/Jameco/Products/ProdDS/2210677.pdf
Ok after a little more review I think it's saying pin 1 (the one at the back) is connected to the "pin". Then pins 2 and 3 are tied together to the barrel? Is that correct?

What's the standard for the pin being positive or negative? If i'm reading the wall-wart spec correctly I think it's saying the "center" is positive so that would make the "pin" of the jack the positive lead correct? https://www.jameco.com/Jameco/Products/ProdDS/1952847.pdf
« Last Edit: May 19, 2019, 05:26:11 pm by Youkai »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Borderlands style jewelry box research thread
« Reply #78 on: May 19, 2019, 06:02:00 pm »
I haven't used the Ticoservo library, but as it's written by an Adafruit staff member, it's extremely likely that it will 'do what it says on the tin'.

Yes, you could use a microswitch,  but that's a mighty big and chunky one for a small project.  You can get them half that size and you only need a roller if you are actuating it with a sliding movement in line with the top of it.  If the motion simply presses the lever down directly you just need a long lever you can bend to shape to suit.

If you read its datasheet carefully, you'll see it does have a DC rating (table "General-purpose 5 A max. (Standard rivet contacts)" on page 2 of the Omron datasheet), but for logic level switching the manufacturer recommends the Microvoltage/microcurrent load 0.1 A max. (Bifurcated crossbar contacts) variant.   You should get away with it as long as you put a reasonable wetting current through the contacts (I wouldn't go below 5mA), and youv'e *never* used that individual switch for AC or a high current inductive DC load.

The DC jack has three contacts because its designed to disconnect a battery pack when the plug is inserted.  If you look at its datasheet, you'll see contact 3 is the one that goes open circuit when the plug is in.  1 is the center pin and 2 the barrel contact.  If in doubt, check with your DMM when it arrives.  Either ignore contact 3 or connect it to the same track as contact 2.  *MOST* kit with DC jacks is center positive nowadays, but that isn't a hard and fast rule.  Some Japanese stuff + musical effects boxes/pedals are typically center negative.  If not marked and you aren't sure the PSU is the correct one, *ALWAYS* check polarity, opening the device up to find its ground rail if you have to.
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #79 on: May 19, 2019, 07:44:13 pm »
Thanks Ian.M

I was thinking the roller because for the lid switch I want it to trigger after a little bit of travel on opening / before it's fully closed on closing. So I was thinking the roller would allow that.

Do you have a recommendation on what switch would be good; or could you provide me some keywords which would help me narrow my search? Searching for "lever switch" provides a lot of results :/

As far as the barrel connector goes; based on your explanation I connect pin 1 to the 9v rail, and pin 2 to the ground rail, and ignore pin 3. Correct?
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #80 on: May 19, 2019, 11:48:19 pm »
Hey guys awesome news. It looks like a total rats nest but I wired up most of the circuit and it seems to work. I was able to verify by hooking up the button/led combo to turn the LED on and then off when the button is pressed. I can also run it off of the power supply (i.e. the pro micro specifically off of the 9v source instead of the USB).

So this verifies that the wall plug is working and that all of my power rails/capacitors are all working correctly. The LED/Button runs off of the 5V Reservoir Rail which is at the end of the chain. Next I need to hook up some servo's and test that. Then time to solder the LED and photo-interrupters into the circuit.

I found that I had already soldered together the three photo-interrupters I needed so I might as well use them instead of the lever switches.

EDIT: Oh I meant to ask. How bad would it be if I had the 9v plugged into RAW while I had the USB attached? Would it overload due to two power sources or does the circuitry account for that?
« Last Edit: May 19, 2019, 11:55:35 pm by Youkai »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6173
  • Country: fi
    • My home page and email address
Re: Borderlands style jewelry box research thread
« Reply #81 on: May 20, 2019, 03:42:15 am »
How bad would it be if I had the 9v plugged into RAW while I had the USB attached? Would it overload due to two power sources or does the circuitry account for that?
While Arduino Micro

does have both 5V and 3.3V voltage regulator, Pro Micros have only one, bypassable via a pair of solder pads (JS1 in the corner, left open for USB +5V):


Because Arduino Micro has no RAW pin, we are talking about SparkFun Pro Micros or its clones. (The design is known to be pretty good, and the hardware license (CC-SA-4.0) allows clones.)

You can open the SparkFun Pro Micro schematics and board layout in EasyEda here (does not require registration or anything), or download the Eagle files from the SparkFun Github repo for the Pro Micro. The Arduino Micro schematics are here in PDF form.  That is, no need to believe me, check for yourself.

On the Pro Micros, when the JS1 pads are connected, the USB +5V line goes through a polyfuse (limiting current to 500mA max or so), and from there directly to the board VCC.  That is, there is nothing but a 500mA polyfuse between the board VCC and the USB +5V line.  The RAW line goes to the voltage regulator input.  There is a diode stopping the regulator input from backfeeding to the USB +5V line, but the output is directly connected to the board VCC.  (The regulator used must accept a bypass situation, where the regulator output voltage is one diode drop lower than its input, or it will be damaged when the board is connected to USB.)

So, there are several possible cases you need to consider:
  • You have a Arduino Micro.
    There is a supply selection circuit that disconnects USB +5V line when VIN is present.
    It is safe to provide power to the board using the VIN pin, whether or not the board is connected to USB.
     
  • You have a Pro Micro (clone), with a 5V low-drop regulator, JS1 pads not connected.
    The polyfuse and the diode are between USB +5V line and the regulator input.  RAW is connected directly to regulator input.
    This does mean that when USB is connected, RAW voltage is at least (5V - one diode drop), but as long as your RAW supply is at least +6V, this does no harm.
    Your board always runs on 5V regulated voltage, and it is safe to connect both USB and RAW at the same time.
     
  • You have a Pro Micro (clone), with a 5V regulator, JS1 pads connected.
    There is a diode blocking RAW from feeding back to the USB connector; but, the board VCC is connected to the USB +5V.
    So, if your computer provides a lower USB +5V line than the 5V regulator on board, you may be backfeeding power back to your machine via USB, which is bad.
     
  • You have a Pro Micro (clone), with a 3.3V regulator, JS1 pads not connected.
    When you provide the board power via the RAW pin, the board will operate at 3.3V.  If you connect it to USB, it will suddenly switch to 5V power.
    I do not know if this is okay, but I would advise against it.
     
  • You have a Pro Micro (clone), with a 3.3V regulator, JS1 pads connected.
    The board always operates at 3.3V.  The diode will protect from the board backfeeding power to your USB +5V line.
    However, when you connect the board to USB, the RAW pin will be at least one diode drop lower than +5V.
    So, as long as your RAW pin is either disconnected, or connected to a voltage supply higher than +5V, you are safe to connect the board to USB.
In summary, cases 1, 2, and 5 are safe.  For Pro Micro or clones, check which voltage regulator it has.

Personally, when working with Pro Micro (clones) or other USB-programmable microcontrollers (I have a dozen or so!), I use an USB isolator (usually this one from fleabay, basically an implementation of the ADuM3160 appnote) and/or an USB cable where the +5V line is disconnected.

I prefer the isolator, because that keeps my USB ports safe.  (The switch chooses between 1.2 Mbit/s and 12 Mbit/s operation; the latter is suitable for Arduino Micros and Pro Micro clones, as that's the fastest ATmega32u4 can do.  The isolator does not support 480 Mbit/s high speed USB devices.) Just note that these isolators cannot provide full 500mA, but somewhat less, something like 300mA maximum (due to losses in the isolated DC-DC converter).  The Olimex USB isolator is a variant which has an extra power jack (8V to 15V supply, regulated to 5V) that can supply up to 750mA to the device (but note that this supply is isolated only from the computer, not the device; there is only a voltage regulator in between).
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #82 on: December 18, 2019, 01:34:20 am »
This project has been stagnant for a while because a friend was going to help me with the modeling/3D printing. But that's has been taking forever so I just ordered myself a 3D printer (arrives tomorrow). Going to get this project out of the muck.

To that end I was thinking. Would it make any sense to use stepper motors (instead of servos) and some micro switches to detect the range of motion needed? The "open" position stop doesn't have to be super exact and stepper motors are supposed to be super exact things right? so I could probably get away with switches to confirm the "closed" position is where I expect it to be when it's powered on or closed. Then run the motor to the open position by programming. If the final rest is off by a couple degrees one way or the other it wouldn't matter too much.

In either case should I connect the drawer's directly to the motor/servo or do I need some kind of circular hinge to bear the weight? I'm a little worried about the leverage on the drawer if someone puts a heavy watch or something in it causing it to sag or bend the shaft of the motor but I don't know if that's a reasonable concern.
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #83 on: January 31, 2020, 02:25:43 am »
Well. I failed for the most part. It kind of works, sort of. I ended up with WAY too much wire and couldn't stuff it all into the cavity. I cut a bunch out of the middle of wires and soldered the wires back together to save some space. Kind of worked. Somewhere in all of that I ended up either blowing out one of the NeoPixels or when I was stuffing the wires in there it just got disconnected. Either way one of the LED doesn't work in the final item. Also one of the servos doesn't work end the end either.

Going to start over from scratch with what I've learned and try again. This time I'm going to use micro servos and a lot less wire. Thanks a lot for your help everyone!


https://photos.app.goo.gl/6BrS4r74JXfwwvsX9
 
The following users thanked this post: I wanted a rude username

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: Borderlands style jewelry box research thread
« Reply #84 on: May 04, 2020, 06:04:23 pm »
Version 2 of the project was successful! Here is the demo video if you are interested:

Also my build journal for those of you that want more details or don't want to watch the video: https://docs.google.com/document/d/1UCf8qaZgw3GsMXFvT55gbCp3WXba2CDr0ZiEJwghIu4
 
The following users thanked this post: zitt


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf