Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
No no this is good. The code to control the LED rings includes brightness , I'll have to dig closely into the code to figure out exactly how bright it makes them and also how bright they'll be by default. I think maybe I won't worry too much about the battery stuff for now. Also one of the original requirements was a power supply that would work internationally (he lives/works in Ireland but travels the world working for Microsoft), which is not a requirement of mine so a simpler power adapter like you linked would make me a lot more comfortable so I"ll look into that.

Adbot
ADBOT LOVES YOU

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

FISHMANPET posted:

Also one of the original requirements was a power supply that would work internationally (he lives/works in Ireland but travels the world working for Microsoft), which is not a requirement of mine so a simpler power adapter like you linked would make me a lot more comfortable so I"ll look into that.
BTW, the one Sagebrush linked actually has the same intl. capability anyways, since its rated input is "AC 100V~240V". All it would need is a physical "dumb"/pass-through outlet prong adapter or whatever.

Splode
Jun 18, 2013

put some clothes on you little freak
Remember at that kind of current you'll need to use thick wires everywhere or things will get warm

TotalLossBrain
Oct 20, 2010

Hier graben!

Splode posted:

Remember at that kind of current you'll need to use thick wires everywhere or things will get warm

size it just right and have a built-in fuse.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
How thick is thick? I'm assumiming the 28 guage dupont wires for the breadboard wouldn't be thick enough for long term use, would 20AWG be good enough or do I need to get even thicker than that?

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Not particularly thick really, 20AWG would definitely be fine. 22 AWG also would suffice.

See the "Chassis Wiring" column here: https://www.powerstream.com/Wire_Size.htm

The other "power transmission" rating column are ultra conservative, for long lengths where voltage sag matters more, so not relevant.

Hexyflexy
Sep 2, 2011

asymptotically approaching one

FISHMANPET posted:

No no this is good. The code to control the LED rings includes brightness , I'll have to dig closely into the code to figure out exactly how bright it makes them and also how bright they'll be by default. I think maybe I won't worry too much about the battery stuff for now. Also one of the original requirements was a power supply that would work internationally (he lives/works in Ireland but travels the world working for Microsoft), which is not a requirement of mine so a simpler power adapter like you linked would make me a lot more comfortable so I"ll look into that.

Those things are really forgiving, I know because while I've not wired them up and programmed them, my boyfriend has and there a thing with LED ring eyes sat on my kitchen shelf. You can drive them to *REALLY* bright, as in light up my kitchen bright.

CopperHound
Feb 14, 2012

TotalLossBrain posted:

size it just right and have a built-in fuse.
I know you are joking, but fusable link wire is a thing used in the automotive world.

khy
Aug 15, 2005

Ugh, I glanced through the threads and somehow COMPLETELY OVERLOOKED this thread when I started a new thread. I'm dumb. So I'll ask this here for the people who are smarter than me about electronics wiring and poo poo.

https://forums.somethingawful.com/showthread.php?threadid=3911599

I didn't fully understand why I needed the relay in my request but when I started looking at the wiring diagrams and how the pins were it was amazing. I suddenly realized exactly what was going on and why, and understood how to make it work. I never understood it before so suddenly having that flash of insight into why the thing work the way they do is really, really satisfying and enjoyable.

khy fucked around with this message at 03:30 on Jan 20, 2020

A LOVELY LAD
Feb 8, 2006

Hey man, wanna hear a secret?



College Slice
Hey folks,

I might have posted something about this before but I've got a synthesizer thats making goofy noises (goofier than usual). If I poke around at the crsytal circuit the goofiness changes ear and sometimes gets a tiny bit better and sometimes craps out altogether. I replaced the crystal as it looks like its been dropped at some point but that hasn't fixed it.

There is however a tiny crack thats gone through the connection point on the PCB right next to the crystal as you might be able to see here in the godawful pic (on the right going through the white box), that's exposing the copper underneath. This is running between the leg of the crystal and c150.




I've actually got a working version of the synth and ive been poking at both with a multimeter and comparing - voltages vary slightly here and there but nothing super obvious. Could it be the crack is putting extra capacitance on the crystal causing it to be fucky? If so is there any realistic way I can fix this? Unfortunately reading the frequency on the crystal using the mulimeter causes it crap out (probably capacitance).

Thanks!

E: on futher inspection I think its the surface of the trace between c150 and the crystal leg thats exposed there

E: managed to get the frequencies of both crystals by checking further along the line where they go to the CPU/DSP and the both look fine, so back to looking for where the problem is :sigh:

A LOVELY LAD fucked around with this message at 21:34 on Jan 21, 2020

movax
Aug 30, 2008

Shame Boy posted:

Turns out the problems with the SPI bus weren't the lack of termination resistors (ok well they would have probably solved this problem but still) and I can kinda-sorta fix it in software. I figured out through trial and error that all the chips on the bus were powered up and ready to go a long-rear end time before the microcontroller's oscillator had even stabilized, so they were all listening to the SPI bus while it was still floating. The particular way it happened to float most of the time meant all the CS pins were low, MOSI was high, and the clock was... clocking, I assume from mains interference. In these LED display chips I'm using, if you clock in just a big ol' string of 1's, it thinks you're telling it to turn on "display test mode", where it will just turn all the LED's on at max power. Critically though, test mode overrides literally everything else, so even if you try to shut the chips down by sending the shutdown command, or any other command for that matter, it will just stay there in test mode acting like it's broken.

Now I just have to send it the "turn off test mode" command when it starts up and everything works fine :toot:

I probably missed the initial posts but there wasn’t a pull-up or pull-down present to ensure CS was de-asserted in the absence of a driver? MCU in reset / default state probably defaulted fo High-Z for its I/Os?

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I have a small project requiring some level shifting between 3.3 and 5V, and I picked some "modules"(basically just breakout boards + tiny capacitor on each voltage rail) which use this chip: http://www.ti.com/lit/ds/symlink/txs0108e.pdf

I'm a little confused about the OE pin though. The doc recommends to hook OE to Vcca with pull-down resistor to GND.
It also says that the order of ramp-up of Vcca vs Vccb power supplies doesn't matter, but at the same time its saying, seemingly contradictory, that OE should only be set high when both supplies are ready.

If I don't know for sure whether Vcca ramps up before or after Vccb, then would I need an additional logic AND gate or something between the two to ensure their both up before enabling output?
I don't really get the implications of high-Z mode, if its actually needed to protect IO pins on the devices that level shifter will attach to or what.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
You're overthinking - As long as as the output of the level shifter is going to a high-Z pin (most pins of most microcontrollers will start up that way, although not all), and vice versa, you're not going to have a problem.

The seeming contradiction is probably implying that startup behaviour is undefined when OE is high and the power supply is not yet on - Possibly glitches and the like. You won't damage anything. I also only skimmed the datasheet, so take with a grain of salt.

Shame Boy
Mar 2, 2010

movax posted:

I probably missed the initial posts but there wasn’t a pull-up or pull-down present to ensure CS was de-asserted in the absence of a driver? MCU in reset / default state probably defaulted fo High-Z for its I/Os?

I knew the MCU would start in hi-Z but I kinda thought the chips would have a weak pull-up or something built in since every MCU starts in hi-Z it seems, buut nope there's nothing.

Also to everyone who was guessing they were MAX chips, yeeep :v:

Shame Boy
Mar 2, 2010

peepsalot posted:

I have a small project requiring some level shifting between 3.3 and 5V, and I picked some "modules"(basically just breakout boards + tiny capacitor on each voltage rail) which use this chip: http://www.ti.com/lit/ds/symlink/txs0108e.pdf

I'm a little confused about the OE pin though. The doc recommends to hook OE to Vcca with pull-down resistor to GND.
It also says that the order of ramp-up of Vcca vs Vccb power supplies doesn't matter, but at the same time its saying, seemingly contradictory, that OE should only be set high when both supplies are ready.

If I don't know for sure whether Vcca ramps up before or after Vccb, then would I need an additional logic AND gate or something between the two to ensure their both up before enabling output?
I don't really get the implications of high-Z mode, if its actually needed to protect IO pins on the devices that level shifter will attach to or what.

Oh hey I'm literally using the lil' brother of that same chip in my design (not in the glitchy part, a different section that works fine). I also was a bit confused as to what to do with the OE pin, so I just have a spare pin of the micro turn it on at boot since that must happen after the power has stabilized and the clock has had time to start up due to the BOD in the micro.

Before that I was thinking of rigging up some kind of RC circuit to delay it coming on by a short time, but it kinda sounds like it's not actually a problem either way so ehh.

Foxfire_
Nov 8, 2010

Where do you see them suggesting OE should be connected to a supply? The typical application has it connected to a microcontroller pin

e: it is often worth your while to add a little circuit than generates a ms or two of delay from the power supply rise and then use it to hold digital logic in reset while power supplies come up and stabilize.

Foxfire_ fucked around with this message at 04:40 on Jan 22, 2020

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
There are lots of reasons to not want to connect it to a microcontroller

Shame Boy
Mar 2, 2010

Yeah in my case I don't ever need it to not be enabled, but the datasheet says the following:

quote:

The output-enable (OE) input circuit is designed so that it is supplied by VCCA and when the (OE) input is low, all outputs are placed in the
high-impedance state. To ensure the high-impedance state of the outputs during power up or power down, the OE input pin must be tied to GND through a pull-down resistor and must not be enabled until VCCA and VCCB are fully ramped and stable.

I took that to mean "if it's not tied to ground and started up later like we say to do, it might do some weird crazy poo poo that could cause problems" but I guess it's just saying "it won't be guaranteed to be in hi-Z" which isn't that big a deal if everything it's connected to will be in hi-Z and ignoring it.

movax
Aug 30, 2008

Shame Boy posted:

Yeah in my case I don't ever need it to not be enabled, but the datasheet says the following:


I took that to mean "if it's not tied to ground and started up later like we say to do, it might do some weird crazy poo poo that could cause problems" but I guess it's just saying "it won't be guaranteed to be in hi-Z" which isn't that big a deal if everything it's connected to will be in hi-Z and ignoring it.

The input buffer for OE is supplied by VCCA, and below 1.1 V (probably) behavior is not guaranteed as the input transistors are probably in sub-threshold region / otherwise outside of their nominal operating region. By tying OE to GND with a strong enough pull (even 100 kOhm is probably fine), you override any stray leakage that might cause that to float up, and guarantee that OE is de-asserted until you're ready to activate the buffer. If you didn't want that tied to a MCU / digital control, an RC or similar circuit would probably also do the job of holding that low until supplies stabilized. The VCCB requirement is of course so that your output signals are driven correctly.

That said, I am inherently suspicious of 'auto direction sensing parts' because there's always some weird poo poo that can go on and confuse them.

Foxfire_
Nov 8, 2010

peepsalot posted:

I'm a little confused about the OE pin though. The doc recommends to hook OE to Vcca with pull-down resistor to GND.

It's not telling you to externally attach OE to both Vcca and GND. It's saying that the buffer inside the chip that accepts the OE signal is powered by Vcca.

It wants you to hold OE down with a pulldown while the supplies rise, then have it go up to enable the chip.

The go up could be from a microcontroller pin, a RC circuit, or a dedicated POR reset chip.

(Doing it with a RC is cheapest, but annoying to tune since it'll depend on how fast your supplies rise, and too-slow rises that spend a long time in transition regions can also break things)

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
Ok I've got these two kinds of switches/buttons:
Trigger Switch
Push Button

They've both got the the little tabs where wire connects. Can I use something like a "female disconnect" to actually connect wires to that? Amazon has suggested this, would that be the right sort of thing (adjusting for size, the trigger leads are different sized than the button leads), and do I need a special kind of crimper for that? I've got this wire tool which works for stripping wire and can do some kind of crimping.

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
I have some of the push button ones and you just need the red sized female crimp connectors. The connectors I got had a little dimple on them that made it impossible to remove from the button, which maybe is the point, but it also ripped the tab out of the button when I tried to remove one, so I just hammered the dimple down. The connector itself held on just fine. If you can't figure out what size the switch is, you'll just have to buy all three sizes of female connectors and see what works. The toggle switches I got just have screw terminals.

Maimgara
May 2, 2007
Chlorine for the Gene-pool.

FISHMANPET posted:

Ok I've got these two kinds of switches/buttons:
Trigger Switch
Push Button

They've both got the the little tabs where wire connects. Can I use something like a "female disconnect" to actually connect wires to that? Amazon has suggested this, would that be the right sort of thing (adjusting for size, the trigger leads are different sized than the button leads), and do I need a special kind of crimper for that? I've got this wire tool which works for stripping wire and can do some kind of crimping.
Yes, those are the correct connectors and a matching tool. Note how the plastic around the female connectors are red, and there's a red marking near the tip of your crimper? Those match. If you get female connectors with larger wires, they will be blue/yellow plastic and be suited for the yellow/blue marking on your crimper.

CopperHound
Feb 14, 2012

Do any of you know where I can find connectors like this?


This is for a brushless motor. The three conductors in the middle are for power and the five around the perimeter are for the hall effect sensors.

I really don't want to cut off and splice in different connectors just because I want to try a motor with different windings.

JawnV6
Jul 4, 2004

So hot ...
Is this for an e-bike?

I tried a few combinations of 'bldc' 'hall effect' 'encoded motor' '9pin' 'connector' 'molex' and didn't find that exact configuration. Here's a guy hacking up a similar connector. Another e-bike forum post that has a really similar connector called 'Julet', perhaps you could get 3 bullets and 5 sensor pins in that format for quick swaps?

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
Continuing my project and I've got a question about a mosfet that's in the plan.

So the Pi outputs 3.3v signals, and the plan routes most of them through a shifter that shifts them up to 5V (and this is properly powered and working). So to control the LED for one of the buttons it goes like this: 3.3v out of Pi to shifter which turns it into 5V, which then goes into the Source of my mosfet, the gate on the mosfet goes to ground, and the drain goes to the positive terminal on the LED, and the negative goes back to ground. The voltage between the + and - on the LED is around 3V, though I'm not sure where I would measure to figure out the voltage coming out of the drain on the mosfet. I'm wondering why this can't just take the 5V out of the shifter into the positive on the LED. I've tried to read up on Mosfets and it seems like they can use a low voltage signal to trigger a higher voltage load, but it seems like I'm using a 5v signal to trigger a ??? signal. Playing around with it, I'm able to just connect the + on the LED straight to that 5V output, and the voltage between the + and - on the LED is about 3.2V. So what purpose is that mosfet serving?

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Can you draw a schematic? It's like trying to describe a coding problem without actually posting code

Sagebrush
Feb 26, 2012

FISHMANPET posted:

Continuing my project and I've got a question about a mosfet that's in the plan.

So the Pi outputs 3.3v signals, and the plan routes most of them through a shifter that shifts them up to 5V (and this is properly powered and working). So to control the LED for one of the buttons it goes like this: 3.3v out of Pi to shifter which turns it into 5V, which then goes into the Source of my mosfet, the gate on the mosfet goes to ground, and the drain goes to the positive terminal on the LED, and the negative goes back to ground. The voltage between the + and - on the LED is around 3V, though I'm not sure where I would measure to figure out the voltage coming out of the drain on the mosfet. I'm wondering why this can't just take the 5V out of the shifter into the positive on the LED. I've tried to read up on Mosfets and it seems like they can use a low voltage signal to trigger a higher voltage load, but it seems like I'm using a 5v signal to trigger a ??? signal. Playing around with it, I'm able to just connect the + on the LED straight to that 5V output, and the voltage between the + and - on the LED is about 3.2V. So what purpose is that mosfet serving?

So it sounds like the fundamental issue here is that you are trying to use a level shifter to turn your Raspberry Pi's GPIO 3.3v into a usable 5v power source. They don't work that way. You need a proper 5v power supply for what you're trying to do.

In more detail, working backwards:

You want to turn on an LED using the Raspberry Pi's GPIO header. Great.

LEDs need a specific voltage and current to turn on, which varies with the type of diode. A simple red indicator LED might require 1.8v and 5mA to light up, while a powerful white lamp like in a flashlight might take 4v and 1000mA. To do this properly, you need to know the specs for your LED.

The Raspberry Pi's GPIOs have two states, high and low. When the pin is high, it is raised to a level of 3.3 volts and can source up to 23mA of current. So you can turn on an LED with the GPIO directly if it can operate at or below those values. The red indicator will turn on, but the white flashlight won't.

In order to turn on the flashlight, you need some way of powering it with the voltage (4v) and current (1000mA) it needs. So you get yourself a 5v/2A power supply and hook the LED up to that directly*. Now it turns on, but you want to switch it with the GPIO. So you get a MOSFET and use it as an electronic switch -- it gets spliced into the ground line of the flashlight (assuming it's an N-type) and then you apply power to the gate to turn it on and off. When the MOSFET goes on, the current from the large power supply is allowed to flow and everything works.

You can skip the level converter if you ensure that you buy a MOSFET that turns on at 3.3v. Some of them need 6v, 10v, 12v to fully turn on, and if you apply a lower voltage to the gate they'll either not work or only turn on partially and burn up. That's where a level shifter is really meant to be used -- shifting digital logic up or down to the right level for the part you're trying to operate. It doesn't supply significant power.


* you can't actually hook an LED like that up directly to the power supply as they are non-ohmic parts and will burn up. You either need an appropriately-sized resistor or a constant-current controller of some kind, but one step at a time


e: this is almost too embarrassing to post but i am not currently in a position to draw anything better so you get what you get. there is a pull-down resistor on the MOSFET gate which is important for reliability.

Sagebrush fucked around with this message at 08:35 on Jan 25, 2020

Splode
Jun 18, 2013

put some clothes on you little freak
That's the best schematic I've ever seen

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
Best part of that schematic is... that's what made it finally click for me.

I had the drain of the mosfet going to the positive source on the LED, then the negative going to ground. And for that to work I actually had the gate and the source swapped in my mosfet, and then what was powering the LED was the signal directly out of the shifter.

So if I plug the LED directly into the 5V source, and the ground of the LED to the drain on the mosfet it works, the light is slightly brighter, and I can measure 5.2V over the LED.

Though a bit of a twist with this project. The 5V shifter is needed because there's an LCD panel and LED ring light that use controllers that require 5V signals. The project as designed also started out with 12V driving these LEDs I'm working on (they're rated for up to 24V) but that was apparently too bright and lighting them with 5V was bright enough.

This is the mosfet I'm using, and I can't understand the specs well enough to know what kind of input voltage is required to trigger what kind of voltage on the final device. It could be that to trigger the 12V LED the mosfet required a 5V signal. But since this is all on the breadboard I tried wiring the 3.3V GPIO directly to the gate on the mosfet, and it works just fine with the LED still being at 5.2V. So maybe to trigger the LED at 5V the 3.3V gate is enough, but to trigger the 12V LED 3.3V wasn't enough and it had to be shifted up to 5V first (is that how a mosfet works?)

Sagebrush
Feb 26, 2012

the MOSFET you've got is fine. these are the key parts


the phrase "logic-level" nearly always refers to a part that can operate on 5v, which is the (old) standard voltage used in transistor-transistor logic. most of the cool new parts run on 3.3v or even lower, to save power, but most of the cheap and sturdy hobbyist components are still designed for 5v. so this line is all you need to look for in your case.


this graph shows the part's characteristics in a little more detail, and indicates the peak current that can flow with various voltages on the gate. the specified max continuous current in the datasheet is 30A, which appears to be somewhere around 3.5v on the graph. that's about 2/3 of Vcc (5v), which is what you would expect to be the active level for a TTL part, so everything checks out. since your LED is drawing only fractions of an amp, you can probably actually turn that part on just fine with a 3.3v input. try it without the level shifter.


re. your 12v vs 5v stuff -- if the 12v LED isn't illuminating and you're sure you are giving it 12v, then it's probably just not getting enough current, which could be caused by the MOSFET not turning on enough, yes. use the level shifter on the mosfet gate and see if that fixes it.

there is no difference to the MOSFET (for your purposes) whether you're running 5v or 50v through the drain and source lines -- it will switch both equally well. the 60v limit is the maximum it will handle but under that it's all the same,.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
The project as is doesn't have any 12V, but it was originally designed with 12V in mind (by someone else, not me). So part of this adventure is figuring out why it was designed the way it was as I assemble my copy. It uses a shifter with 8 terminals, but the only 3 5V terminals are really needed (2 for the LCD display and 1 for an LED ring controller). Do the other 4 LEDs go through because the builder assumed the mosfets would need 5V to trigger, or did he just have a pile of that 8 terminal shifter laying around and used it and then wired the other 4 LEDs through it for the heck of it? For that matter why do these 4 LEDs go through mosfets but the 3 LEDs in the toggle switches not go through mosfets or the shifter and instead are powered directly from the 3.3V off the GPIO of the Pi?

Now that I've typed all that out, I'm going to see what happens if I use a mosfet and run 5V directly through the toggle switch LEDs.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Dude. Schematic.

As posted above, it doesn't have to be elaborate.

I never even wire anything up for myself without sketching something

Splode
Jun 18, 2013

put some clothes on you little freak

ante posted:

Dude. Schematic.

As posted above, it doesn't have to be elaborate.

I never even wire anything up for myself without sketching something

Yeah, this.

I would go so far as to say nobody should wire anything up without first drawing a schematic

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
I have a schematic, I linked it in my initial post. I'm not just plugging shot in randomly and seeing what happens. I'm working off of someone else's schematic and trying to understand it.

Sagebrush
Feb 26, 2012

It doesn't sound like you're following the schematic exactly/properly, though, so drawing a schematic of exactly what you have wired it will help us figure out what you're doing.

ArcticZombie
Sep 15, 2010
I'm looking for some advice/sanity-checking on my first "proper" electronics project (proper in the sense that I'm trying to make it look professional). I'm a software guy by profession with experience in mechanical engineering, but electronics-wise just some small Arduino stuff making basic circuits on breadboards.

I'm sick of using my phone as my bedroom alarm clock so I'm working on creating a small wooden alarm clock. What I'm planning so far:
  • For power, I'm planning on either using a 1000mAh rechargeable lithium battery I have lying around, or a couple AA batteries. I might need more capacity?
  • For the RTC, I'm looking at the DS1307 for the backup battery capability and the 1Hz square wave output for interrupts.
  • For the digits of the clock I'm planning on using 4 SC52-11SRWA 7-segment LED displays driven by 4 74HC595 shift registers.
  • For user interaction, I'll have 2 buttons for setting the time and a tilt switch for determining which way up the clock is (to turn the alarm on/off by flipping it).
I'm concerned about power usage, I'd like the battery (or batteries) to last a reasonably long while and I need some advice picking an MCU. I've only used Arduino-compatible 8-bit AVR MCUs in my previous "projects", but I'm aware there are many others and I find the selection bewildering. The way I see it, I need:
  • Enough pins for all the I/O (9? 3 for the shift register(s), 3 for the buttons/switch, 2 for I2C with the RTC and 1 for the square wave interrupt).
  • 3.3v operation with some kind of super low-power sleep mode to be woken up by interrupts on button/switch/square wave.

csammis
Aug 26, 2003

Mental Institution
The MSP430 by Texas Instruments is the MCU I use in power-sipping applications because of its extremely low current sleep states. Even the little ones would be able to handle your IO requirements without a problem.

That said, the MCU power cost no matter how you slice it is going to be dwarfed by the LEDs and whatever you are going to use as the alarm function (speaker? piezo buzzer? vib motor?) when it goes off. Is your plan to keep the LEDs on at all times?

edit: I haven't used seven-segment displays and I don't know how it gets divvied up by individual segments but let's say you can get away with 10mA average draw per seven-segment display...obviously the 10s digit for the hour will be off most of the time in 12hr display, so I'm guessing here. Four displays comes out to 40mA, so 1000mAh / 40mA = 25 hours for just the LEDs. You should be able to keep the other components under 2mA average draw without breaking a sweat - a microcontroller in deep sleep will be in the microamp range for most of the time - but that's still only about a day on a single charge for an (optimal) 1000mAh source.

edit2: \/\/\/\/\/\/ agreed on trusting your alarm to a battery powered device alone. It sounds like the central concept of the OPs design is flipping it over to turn it off but they should still be able to get away with a micro USB sticking out the back of it. They could even build the port into a slip ring!

csammis fucked around with this message at 19:17 on Jan 26, 2020

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin
I would never trust my alarm to something that isn't plugged into the wall, sleep mode notwithstanding. Is there a reason you're trying to make this battery operated? A simple wall wart could obviate all of your power concerns, at least for your initial prototype.

Adbot
ADBOT LOVES YOU

CopperHound
Feb 14, 2012

Check out the data sheets for the current AVRs you use in Arduino applications. Most have a power down sleep mode that can be woken by external interrupts or WDT.

There are some considerations about pin state to keep in mind if you are looking to get the absolute lowest power draw while sleeping.

Support circuits generally end up being the biggest power draw if you make effective use of sleep.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply