Author Topic: Mechanical jewelry box schematic  (Read 787 times)

0 Members and 1 Guest are viewing this topic.

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Mechanical jewelry box schematic
« on: February 03, 2020, 05:07:35 am »
I'm working on a mechanical jewelry box and I'm very new to electronics. This will be version 2 of my project. The first one was only semi successful so I'm giving it another go. I had a thread for the version 1 project that I'll link at the bottom if you are interested. For now though I have made some minor modifications to the schematic from that (adding BAT54S instead of wiring that part myself) and I'd like to run the schematic by you guys to make sure I haven't messed anything up horribly.

Here is some info on the parts I'll be using. I'll leave out the common things like capacitors and resistors that are standard their source shouldn't affect the circuit.

My schematic is attached. Please review and let me know if you have any comments. While I was working on the schematic I was thinking about the two 0.1uf capacitors near the NeoPixels. Those two are functionally "in the same place" in that they both connect the 5v source to ground. Do I need both of them? The way the schematic is drawn ether of those capacitors is protecting against power dips for both NeoPxel and the LED Button (i.e. everything running off the 5v rail); correct? Any reason to have 2 of them? If I needed that much capacitance couldn't I just use a single bigger one?

Original thread: https://www.eevblog.com/forum/projects/borderlands-style-jewelry-box-research-thread/
 

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #1 on: February 05, 2020, 03:45:13 am »
Anybody? If you could just verify that the circuit won't blow up and answer the question about the capacitors I would greatly appreciate it. Thank you!
 

Offline InductorbackEMF

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
  • Repair/Rebuilding.
Re: Mechanical jewelry box schematic
« Reply #2 on: February 06, 2020, 12:13:57 am »
Hi,the 100nf capacitor would be for noise/emi suppression and would be best being a smaller capacitance due to less ESR/ESL.
As such placing the capacitors as close to the Pixels/power supply rail would be best.

Alex.



Want a cup of TEA? (just one more meter please..)
Alex.
 

Offline InductorbackEMF

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
  • Repair/Rebuilding.
Re: Mechanical jewelry box schematic
« Reply #3 on: February 06, 2020, 12:16:13 am »
Also i would say yes having both would help, keep in mind placing them fairly close to the supply for the pixels if you can.

Alex.
Want a cup of TEA? (just one more meter please..)
Alex.
 

Offline Prehistoricman

  • Regular Contributor
  • *
  • Posts: 210
  • Country: gb
Re: Mechanical jewelry box schematic
« Reply #4 on: February 06, 2020, 12:32:49 am »
Are you sure the 'LED Button' is right? What's the purpose of this pin 16 connection?
 
The following users thanked this post: Ian.M, InductorbackEMF

Offline InductorbackEMF

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
  • Repair/Rebuilding.
Re: Mechanical jewelry box schematic
« Reply #5 on: February 06, 2020, 12:33:07 am »
Oh i checked the circuit again and saw that the data out pins? of the microcontroller  would be pulled down to (about) 500mv due to the Schottkey diodes not sure if the neopixels data inputs work down that low?

Alex.
Want a cup of TEA? (just one more meter please..)
Alex.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 9485
Re: Mechanical jewelry box schematic
« Reply #6 on: February 06, 2020, 02:06:09 am »
Swap the pin 1 and pin 3 connections on both BAT54S double (series) diodes so the center (3) goes to Data and the anode (1) goes to ground.

Their purpose is to clamp Neopixel Data in to prevent it going outside the supply rails (e.g. due to transients or when the Arduino is powered via USB but main 9V power in is disconnected) to protect the Neopixels . 

As noted in the previous thread, if the cables to the Neopixel strips are long, the BAT54S diodes and the 0.1uF decoupling caps should be soldered directly to the Neopixel strips.
« Last Edit: February 06, 2020, 02:07:55 am by Ian.M »
 

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #7 on: February 06, 2020, 02:40:55 am »
Are you sure the 'LED Button' is right? What's the purpose of this pin 16 connection?
This allows me to blink the LED by manipulating pin 16.


As noted in the previous thread, if the cables to the Neopixel strips are long, the BAT54S diodes and the 0.1uF decoupling caps should be soldered directly to the Neopixel strips.
Define long. The wires to the farther away neopixel will be about 6 inches long. I was hoping to mount those to the stripboard so they could hide in the base of the box. There isn't any space where they are mounted to have them. The capacitors are pretty small; I can probably make space where they are being mounted for the capacitor. Could I move them to the other side of the BAT54S and mount it directly to the +/- of the neopixel? Then I could put the BAT54S on the main board.

Ill fix the BAT54S wiring as you noted.
 

Online DaJMasta

  • Super Contributor
  • ***
  • Posts: 2016
  • Country: us
    • medpants.com
Re: Mechanical jewelry box schematic
« Reply #8 on: February 06, 2020, 02:49:10 am »
There are a lot of extraneous components that won't have positive effects if there are any, I think.

The BAT54S diode pairs in the current configuration cap the maximum data high value at a single diode drop... which is probably not as intended.  I don't really know why they'd be prone to transients or that the data pin is especially sensitive to them - I'd just remove them entirely.  The Pro Micro has a regulator onboard that drives the micro, and the micro drives the data pins, so they will never be driven with 9V unless you've got some dramatic fault condition on the pro micro that cooks it as well.  I also don't know why there's separated 5V rails.... and if there's only a diode between the main one and the "reservoir rail"... that one will never be at 5V, it will be at 5V minus the diode drop in between.

The 470 ohm series resistors to the neopixels seems... excessive?  If anything, I'd expect a pullup for serial data lines, but in this configuration, I guess you can protect the micro from dead shorts in the neopixels?  Or if you have excessively inductive lines between, you can reduce the edgerate of the pulses to be absolutely sure it doesn't overload (which is not likely to be useful outside of really extreme situations).  Same case with the 470 ohm series resistors to the PWM drives of the servos, maybe you want something for bonus protection, but 470 probably isn't necessary and it's usually fine to drive them directly from the micro's pins.

You can also probably sense the LED switch with a single pin on your pro micro - not exactly sure why there's two.  The resistor divider to pin one serves no purpose unless you're looking for a coarse software check of the power source - if you actually want to monitor the 9V rail, you should just put that divider into an analog input pin and sample it.

That much capacitance on the 5V rail probably isn't necessary, but isn't harmful.  Having the second 1000uF cap near the servos (with the first near the converter) is probably the best configuration using two.  Decoupling the neopixels is fine, but likely isn't required - could be worth a test.
 

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #9 on: February 06, 2020, 03:01:06 am »
DaJMasta I'm very new to electronics so most of this circuit was designed through the gracious help of people on this forum in the other thread; primarily Ian.M. This circuit is for a hobby project so I don't need it to be 100% bulletproof. If it's over-engineered then I'd certainly be willing to remove redundant/unnecessary components for the sake of saving space.

I'll answer the couple items in your post that I know the answer to. Hopefully Ian.M can comment on the rest.

The reason for the reservoir rail is so that when the servos start their rotation and draw a lot of power they don't cause bad things to happen to the neopixels. I'm told that when the servos are actively rotating, especially under load they draw a fair amount of power so that could be mean to the neopixels.

One of the button pins is to detect the state of the button. The other pin is to let me control the LED embedded in the button. I'm going to make it blink or something when pressed. Or maybe flash when it's not pressed. Something like that.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 9485
Re: Mechanical jewelry box schematic
« Reply #10 on: February 06, 2020, 03:30:30 am »
The 470R resistors between the MCU and the Neopixel strings are recommended by Adafruit to prevent damage to the data input of the first LED by limiting the current during transients that may take the input outside the rails. 

The 470R resistors between the MCU and the Servos may be needed to limit the input current in the case when the Arduino is being powered via USB during programming, but the servo 5V supply is down because no external power is connected.  Many models of servo are likely to have inputs protected against signals being applied without power, and if you are *CERTAIN* your specific servos are protected, the 470R resistors could be omitted.

Does the button's internal LED have a built-in series resistor? if not, you need one!
« Last Edit: February 06, 2020, 03:53:46 am by Ian.M »
 

Online DaJMasta

  • Super Contributor
  • ***
  • Posts: 2016
  • Country: us
    • medpants.com
Re: Mechanical jewelry box schematic
« Reply #11 on: February 06, 2020, 03:49:03 am »
The switch makes sense, then, you'd need some fancy programming to use only one in that case.

The servos definitely are the current hogs here, that's why if you're going to have extra decoupling caps, it's good to have them near there.  The neopixels are designed to be placed individually in long strings, so while I don't know if they have internal decoupling, they are probably designed to be able to operate in noisy environments.

There will definitely be noise on the power rail because of the servos, but I doubt it will be problematic with 2000uF of decoupling and the on-board decoupling for the micro so long as the switchmode converter can actually deliver it.  I wouldn't be surprised if removing the 0.1uF caps, the 470 ohm resistors, the BAT54S diodes, and the zener (?) diode from the schematic entirely would work the same as as proposed in the vast majority of situations.

As a matter of flexibility, I'd move the 10k resistor divider from pin 1 to pin 21, so you can use it as an analog input to monitor the 9V in addition to just a digital reading... and if you don't need to monitor it or check it, just removing them too is an option - not exactly sure what requirement it fills.

Regardless of what schematic you settle on, it could be worth trying some elements of the other to see how they actually effect things - the parts required are pretty cheap, so it's basically only the time investment in the rework (which is almost nothing if you use a solderless breadboard to test it first!)


For the post that's appeared before I could post this reply:
Fair enough with the 470s, then, I hadn't heard of such requirements for neopixels and have never implemented series resistors on the PWM control pins for interfacing with a micro, myself, but if there are instances where it's useful, they're certainly not a big ask, and I doubt either will have any negative effects.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 9485
Re: Mechanical jewelry box schematic
« Reply #12 on: February 06, 2020, 03:57:06 am »
The 9V monitoring circuit was to allow the Arduino code to wait for external power to be good, rather than driving the outputs controlling the servos and Neopixel strips if they aren't powered.  The 470R resistors were for extra insurance if there was a bug in that part of the code during development, but I wan't too happy about possibly driving ~10mA into an unpowered servo or neopixel input long-term, hence the 9V monitoring circuit.

There'd be more space to be saved by using a bare ATmega328P (@8MHz Int. Osc.) instead of the Arduino Pro Micro, so IMHO Muntzing the passives isn't worthwhile.
« Last Edit: February 06, 2020, 04:05:02 am by Ian.M »
 

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #13 on: February 06, 2020, 04:29:02 am »
OK so here is the updated schematic. I fixed the BAT54S, and added a resistor to the button LED. I also took out a bunch of the empty space. Is that OK or does it make it "too busy" and hard to read?

I understand the comment about Muntzing it. I'll just have to find a way to make it fit.
 

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #14 on: March 07, 2020, 09:35:54 am »
Ian.M how important is that 9v detection? It seems that it's either not possible or I'm massively misunderstanding how it works.

I used a solder-less breadboard to work on my test circuit. I set up a circuit that has my 9v source going to a positive and negative rail in the board. Then I put the positive to my "raw" input on the ProMicro and the negative to the GND next to RAW. Then I used two 10k resistors. One each for positive and negative rails on the board. Both I had bridging their rail to the same row in the board. Using a third slot on that row I put a wire to pin 1 on the ProMicro.

I believe that setup wires the top right of my schematic. I.e. the 9v rail, the pro micro, and the pin 1 connection. But when I leave the wall wart unplugged and power the ProMicro from USB it still registers a positive digitalRead at pin 1. Using a meter across the positive and negative rails shows 5v in this scenario. I believe this means that the "RAW" pin is supplying 5v to the rail. This means that any time the ProMicro is plugged in (either through the wall wart or USB) I'm going to show a positive digitalRead at pin 1. I think this means that the whole pin 1 part is superfluous since it won't tell me what it was designed to tell me. I believe in the scenario I just wired you want it to show a digitalRead of "0" since the wall wart isn't plugged in.

Do I just take out the pin 1 stuff then? Am I totally misunderstanding how to use it?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 9485
Re: Mechanical jewelry box schematic
« Reply #15 on: March 07, 2020, 11:27:40 am »
Its important - your PC's USB port cant supply enough current to run strings of Neopixels and servos, so your sketch needs to know not to try to do that when external power is missing.   You could try detecting it with an analog pin, which should offer a clear distinction between about 921 analogRead() counts with power on,  and 512 counts with power off, (assuming RAW continues to back-feed the 9V rail with 5V), but if it *IS* back-feeding via RAW, I'd recommend killing the back-feeding at source by adding a diode in series with the RAW pin, cathode to RAW. which should fix the pin 1 digitalRead() problem.   Any 100mA or greater diode should do while breadboarding, and when you build up trhe final circuit, one half of a BAT54S should do nicely.

However it may well be back-feeding via the 5V buck converter, from a servo with its signal pin held high by the I/O pin driving it.  Make sure those I/O pins are low or hi-Z all the time from powerup till when you test the voltage (or digital level) at the 2x 10K divider.
N.B. it could take quite a few seconds for pin 1 to go low after disconnecting 9V, if the servos and Neopixels aren't running, as you've got a lot of bulk capacitance associated with the buck converter.
« Last Edit: March 07, 2020, 11:43:05 am by Ian.M »
 
The following users thanked this post: Youkai

Offline Youkai

  • Regular Contributor
  • *
  • Posts: 149
  • Country: us
Re: Mechanical jewelry box schematic
« Reply #16 on: March 07, 2020, 04:30:17 pm »
It was definitely the RAW pin feeding the voltage. When I was debugging why it wasn't working I de-connected everything else. My whole circuit was just the ProMicro and the voltage divider. Adding a Diode fixed it. So I'll go with that.

Thank you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf