Electronics > Projects, Designs, and Technical Stuff
Mechanical jewelry box schematic
<< < (4/4)
Ian.M:
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.
Youkai:
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.
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod