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
CarForumPoster
Jun 26, 2013

⚡POWER⚡

Forseti posted:

Also counterfeit chips in lots of USB adapters. Although I'm in Linux and it doesn't seem to be as big an issue since I don't have to run the manufacturer's driver anyway so counterfeit chips aren't as likely to give me an issue I think. I have a USB one that I've used before to pull waveform data from my scope (4MB at 57600bps :negative:)

Wish I could find a GPIB adapter for not a zillion dollars.

Have you considered download accelerator plus? Idk how but it really helped my 56k modem on MP3.com

Adbot
ADBOT LOVES YOU

Forseti
May 26, 2001
To the lovenasium!
Data compression would actually help massively since it's a CSV file. I really like this scope and I've considered hacking something in there to read from the RAM and output it over a modern interface. Or better yet, hack together a custom firmware since it uses a 68k for its CPU (IIRC a 68030).

My real crazy DIWhy idea is to get a Mac ROM on there and turn it into a green screen SE/30 :D

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

Forseti posted:

You need a transceiver (eg ST3232B) on the MCU side to safely plug into an actual RS-232 port though don't you? Or is RS-232 a misnomer for most PC serial ports? I figured you'd have to be able to tolerate the +/- 15V to be safe.

Oh absolutely. But what amounts to essentially a dumb level shifter (eg MAX232, my flavor of choice) still counts as largely passive when compared to a USB converter. They make dongles for that, too, if you don't want to commit on board.

Edit: not trying to sell anyone on the idea that this is some kind of earth shaking revelatory feature. But you asked if it had any use, so I'm reaching a bit.

Forseti
May 26, 2001
To the lovenasium!
Oh yeah, I agree, just making sure I understood it properly is all. I actually have a bunch of those transceivers on hand too. At one point I was intending to make a little dongle with a dsub + transceiver + esp8266/32 specifically to pull waveforms slowly off the scope.

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Dominoes posted:

bobua - I'm working through code for your proj now since it seems super useful, but am not attempting the projection. Should be able to test it out on a dev board Mon; waiting on the display.

Basic ideas:
- Magnetic base with hole in middle for bolt
- Project box that screws into base. Small PCB in project box, with 1" OLED display mounted on it. (how?)
- Batteries in sep box, or in main proj box.
- Gooseneck or swivel that screws into project box, also with a bolt. Has sensor on end.
- Maybe additional optics to restrict sensor FOV

- STM32F1 or Lx series MCU, powered by 3AAA batteries.
- Device is in a low power mode by default. It occasionally wakes up to check temp using a timer or RTC. If temp is above a thresh, it shows on display
- Displayed temp is color-mapped to the reading. (eg really hot might be red or white)

- Two buttons: One for skillet surface type (3 broad categories that map to emissivity: teflon, cast iron, steel/aluminum), and C/F temp unit
- The buttons are mapped directly to interrupts which change the setting, and wake the display for a second to show you it's set.
- The main loop wakes from low power, checks temp, displays if above the thresh, then sleeps and disables the display if temp falls below thresh

I figure the OLED might be suitable for batteries, since it's small, will be off when not cooking, and most of the display will be black. Could be wrong though!

I've written most of the code and it compiles, but can't ops test until I get the display. I'll show you the code if you're still pursuing this; you can probably translate the ideas, even if you're using a different platform.

If you pursue the projector, this will get more complicated, especially in the physical assembly and additional considerations.

I'm attempting to learn how to use Mutexes and ref-counted smart pointers to deal with sharing state and sensor info across interrupts, as opposed to unsafe mem reads and writes... Although the latter should probably be fine too. The mutex approach is more verbose, but should prevent race conditions.


Oh man that's awesome. I tend to check this thread like once a year. I think I actually brought this idea up a few years ago here too. Glad I happened to see this post. I'd love to see someone take the idea and run somewhere with it! I literally had a baby last week and I already run a small business so my free time is erratic so I don't see myself helping much, but I'd like to. Maybe there are some parts you'd like to experiment with and I could buy them for you? I'll check the thread more often but do pm me if interested.

Dominoes
Sep 20, 2007

Sweet. I'll keep you posted here and/or in PM. I broke one of the pins on the sensor and can't get it on without shorting it to the case (Which is internally shorted to ground), but have another one on the way. (This time with 10° FOV optics.) I appreciate the offer on parts, but unfortunately, I'll be unable to work with hardware starting mid Jan until an unknown time, but can still post here, chat, and test code.

Currently have code that compiles, a good idea of what the BOM looks like, schematic and basic PCB layout done. That stuff is generally STM32 boilerplate, plus the sensor, screen, and screen's boilerplate.

I asked a few people if they'd use something like this - Everyone told me it's probably not useful since you're not measuring the inside of food, most people check by leidenfrost or seeing if something's boiling etc. I disagree - I use an IR gun when cooking all the time. It's great for eggs, steak, tortillas, checking if it's good to rinse the pan yet etc. You also IDed the use of checking if the empty pan is getting too hot. Anecdote: I started a (skillet-confined) grease fire when switching to Cast Iron, since the leidenfrost test didn't work as I expected!)

I'm using this an an excuse to learn coding in a more interrupt-first style. Sharing state across interrupts and the main loop safely etc. Seems like a powerful tool, instead of focusing on a single events loop, but you have to be careful about how you share state. Related: Has anyone used an interrupt-first framework like RTIC? I'm not using it, and don't plan to until I'm comfortable doing things more directly, but it seems like a cool abstraction. Its intent is to simplify flows like I'm describing, cut down on verbosity etc.

This is one of the lines in the prog:
C++ code:
static SENSOR: Mutex<RefCell<Option<Mlx9061x<I2c<I2C1, (PB6<AF4>, PB7<AF4>)>, ic::Mlx90614>>>> =
    Mutex::new(RefCell::new(None));
:psyduck:

Dominoes fucked around with this message at 21:32 on Jan 2, 2021

Forseti
May 26, 2001
To the lovenasium!
Jesus. TFW the idea of templates has just clicked. I can use this for EVERYTHING! :aaaaa:

The only way you should produce code that looks like that is from a generator compiling a DSL :colbert:

:eng101:
The Linux kernel used to have C code files for every different dev board, essentially all that board's config in the code files. That become a massive pain in the rear end and drain of developer resources very quickly, hence the Device Tree (which I believe they stole from the PowerPC port). DTC files are compiled from the device tree language but just for a more efficient binary format for the OS to actually use. They're not binary in the sense of executable code.

That is all pretty much to avoid code that looks like that. Much nicer to have the device tree source open in one window and the code specifying the logic in another for understanding.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I still wouldn't call the Device Tree a "good" design

movax
Aug 30, 2008

Forseti posted:

Jesus. TFW the idea of templates has just clicked. I can use this for EVERYTHING! :aaaaa:

The only way you should produce code that looks like that is from a generator compiling a DSL :colbert:

:eng101:
The Linux kernel used to have C code files for every different dev board, essentially all that board's config in the code files. That become a massive pain in the rear end and drain of developer resources very quickly, hence the Device Tree (which I believe they stole from the PowerPC port). DTC files are compiled from the device tree language but just for a more efficient binary format for the OS to actually use. They're not binary in the sense of executable code.

That is all pretty much to avoid code that looks like that. Much nicer to have the device tree source open in one window and the code specifying the logic in another for understanding.

Yeah, DT traces its lineage to Open Firmware which comes from PPC land. I think the documentation is still horrendous though — at least on the Xilinx side of things. If you’re working with device tree and especially “sample” DTS, even those in tree, open up LXR in another tab and make goddamn sure (as you said) you read the lines of code in the probe or init functions... the Xilinx stuff in particular is guilty of generating DTS entries that are orphaned and never actually read by the driver.

Honestly it’s about as good as you can expect for something that got duct taped on as embedded Linux exploded. The dtc tool itself stands out to me as one of the weirdest syntactic things I have ever seen.

Forseti
May 26, 2001
To the lovenasium!
Spot on about the documentation, I don't think I've ever seen the grammar spec anywhere. I think it's just evolving too quickly and actually used in the maintenance of other code by too few devs. I assume the source code is the documentation at the moment.

It definitely has its flaws.

I learned a lot about it by chance hacking around with various Allwinner chips. Icenowy Zheng contributes a lot of the allwinner support to the kernel and her device trees are well written and taught me a lot, particular features that I didn't know about because I'd generally decompiled the dtcs provided by the manufacturer. So if you have the linux kernel source, check out the device tree files for any of the allwinner socs, IMO they're well done.

Edit: Also, not trying to shame whomever wrote that C++ code. I just remember when concepts like templates clicked for me and wish I could go back in time and stop myself from overusing it :awesomelon:.

My argument is that code that looks like that essentially already is a DSL (Domain Specific Language). It's just one that's difficult to read and error prone to write. If you've been working in that spot of the code all month, it probably makes perfect sense when you write it. Just giving my perspective as someone who's written and read a lot of code that my reaction to that is "What the gently caress is this, a page from a coloring book?".

Your DSL doesn't have to be bespoke either. JSON (I'm not advocating for JSON everywhere!) and XML are both examples of languages that lend themselves to use as config files. Recursive descent parsers are fun as hell to write though and I'd encourage everyone who enjoys coding to have a go at doing it in a general purpose language from scratch at least once :).

Forseti fucked around with this message at 22:03 on Jan 2, 2021

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Dominoes posted:


I asked a few people if they'd use something like this - Everyone told me it's probably not useful since you're not measuring the inside of food, most people check by leidenfrost or seeing if something's boiling etc. I disagree - I use an IR gun when cooking all the time. It's great for eggs, steak, tortillas, checking if it's good to rinse the pan yet etc. You also IDed the use of checking if the empty pan is getting too hot. Anecdote: I started a (skillet-confined) grease fire when switching to Cast Iron, since the leidenfrost test didn't work as I expected!)


As a stand-alone product, I don't think it would ever be worth shelf space unfortunately. If you could patent it, get a viable product for show, and get in front of appliance manufacturers it would kill. They aren't adding wifi to refrigerators because the market demands it... they are desperate for things to add or differentiate their product. Stainless steel staying in style for 20+ years is killing them. That's where I think the 'projector' feature would shine(see what i did there?). Showroom floor that bad boy would sell some range hoods.

as a $100-$200 device that automatically beeps at my wife when she's about to ruin another calphalon pan? Would pay for itself the first week.

Dominoes
Sep 20, 2007

The projector would be cool. Challenges as standalone might be sourcing the right one, requiring wall power, and skewing compensation at an angle. I agree that for something built into a hood or range, it would be more workable. Eg a custom projector directly over each burner.

Dominoes fucked around with this message at 22:29 on Jan 2, 2021

Zero VGS
Aug 16, 2002
ASK ME ABOUT HOW HUMAN LIVES THAT MADE VIDEO GAME CONTROLLERS ARE WORTH MORE
Lipstick Apathy
I'm looking at some PCIE risers for a PC I'm building. I noticed that

Riser A has capacitors with leads: https://www.amazon.com/gp/product/B07VV18PQD

Riser B has SMD capacitors: https://www.amazon.com/gp/product/B003S71DUI

Riser C seems to have no capacitors at all: https://www.amazon.com/gp/product/B08LSSP3W5/

My two questions are

1) What are these capacitors doing that they need to be added to riser where they aren't needed when plugging a GPU in directly? Will the riser without caps work safely or is that risky?

2) Is there any reason that these risers would fail to work with PCIE 4.0? I know that the long ribbon cable risers often fail at 4.0 speeds because of the extra crosstalk, but PCBs are resistant to that, correct?

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Zero VGS posted:

1) What are these capacitors doing that they need to be added to riser where they aren't needed when plugging a GPU in directly? Will the riser without caps work safely or is that risky?

The extra wire length adds inductance. The capacitors are on the power rails to mitigate the voltage drop from this. It's probably fine without them since the power primarily comes in through the 12V connectors on the card anyway, and there are plenty of capacitors before and after the buck converters on these.

Zero VGS posted:

2) Is there any reason that these risers would fail to work with PCIE 4.0? I know that the long ribbon cable risers often fail at 4.0 speeds because of the extra crosstalk, but PCBs are resistant to that, correct?

This I'm less sure about, but it's going to be similar to just throwing an extra length of motherboard on, so a mini-ITX plus a riser is going to look an awful lot like a full ATX with no riser.

movax
Aug 30, 2008

Supermicro is the only one I would trust out of those. Caps are just there to help provide some local charge for the power rails near there.

As for why PCIe 4.0 may not work... each connector / interface is a discontinuity and will eat into the overall link budget so to speak of the PCIe link. If you have a mobo that uses some PCIe analog switches (common in boards that bifurcate), they use a few extra vias, didn't leave any intra-pair skew/mismatch budget for downstream devices, that could all contribute to the LTSSM ending up negotiating a slower or narrower link than you'd expect.

Cory Parsnipson
Nov 15, 2015
I need some help interfacing an active low signal to my charlieplex circuit...



So in the above, I have one branch of my charlieplexed circuit here connected to 2 GPIO pins. Normally, I could drop in a switch that physically bridges two contacts together in the space that has a "?" and be done with it. But I'm trying to hook up a switch thumbstick and it has one wire that is normally high and then gets connected to GND when the stick is pushed in. Just wondering what the best way to do this is?

I was looking at using a p channel MOSFET as an active low switch. So the thumbstick wire feeds into the gate and then the transistor is on when the thumbstick is pressed down. I just don't know all the things I'm supposed to worry about with biasing and proper current draw and stuff (do i need to care about continuous drain voltage? if I'm just using it to switch really small values, can I still use one of those huge ones with the metal fin on it?). I have no clue what I'm doing here...

Also, I tried to buy some singular transistors and digikey only has one through hole p channel mosfet and it's obsolete. I get the impression that people don't really use these very often? Is there something else that people like to use instead?

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Cory Parsnipson posted:

I need some help interfacing an active low signal to my charlieplex circuit...



So in the above, I have one branch of my charlieplexed circuit here connected to 2 GPIO pins. Normally, I could drop in a switch that physically bridges two contacts together in the space that has a "?" and be done with it. But I'm trying to hook up a switch thumbstick and it has one wire that is normally high and then gets connected to GND when the stick is pushed in. Just wondering what the best way to do this is?

I don't quite understand what you're trying to do here, can you elaborate?

Slanderer
May 6, 2007
I assume one side of the switch is wired in with other elements in the joystick (namely the potentiometers) that you have connected up elsewhere in your project, so that's why you're doing all this, right?

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Cory Parsnipson posted:

I need some help interfacing an active low signal to my charlieplex circuit...



If you don't have control of both sides of the switch, don't try to charlieplex it. If you're absolutely running out of IO pins and NEEEED to charlieplex the additional buttons, then solution is going to be annoying because most digital switches are directional.

Cory Parsnipson
Nov 15, 2015

Slanderer posted:

I assume one side of the switch is wired in with other elements in the joystick (namely the potentiometers) that you have connected up elsewhere in your project, so that's why you're doing all this, right?

Yep that's correct, although the potentiometers are taken care of. I'm going to wire them directly to pins configured as analog inputs. You can push the joystick inwards so it clicks down and that's what I'm asking about. There is a separate wire for this digital button and it is normally at 5V, but then is shorted to ground when the thumbstick is pressed. All of this stuff is inside the joystick module and I only have access to the wire coming out of it.

ante posted:

I don't quite understand what you're trying to do here, can you elaborate?

Sure, I'll try. Let me know if it's still unclear.

I have an arduino that I'm using to charlieplex a bunch of switches together. So the GPIO pins are coming from that. Basically I have this circuit built:



And if you see in the illustration, the switches have both sides that I need to connect to the circuit.

But for one particular switch I'm trying to wire up, I want to connect it to a Nintendo Switch Thumbstick. I don't have control over the insides of the thumbstick, but what I am provided is a wire that is normally at 5V but goes to 0V when the thumbstick is pressed inwards and I'm trying to figure out how to incorporate that into the charlieplexing circuit like the other buttons. I thought I could use a p channel mosfet to use the active low logic of the thumbstick button to bridge the connection when the thumbstick is pressed down.



So imagine this is just a zoomed in portion of the previous picture, but instead of one of those switch symbols, I need to wire up this thumbstick wire to it that has the characteristics I explained to Slanderer.

babyeatingpsychopath posted:

If you don't have control of both sides of the switch, don't try to charlieplex it. If you're absolutely running out of IO pins and NEEEED to charlieplex the additional buttons, then solution is going to be annoying because most digital switches are directional.

Oh I see... I have 2 leftover pins but I was hoping not to have to use them for this. I have no idea what you mean by directional digital switches. Could you tell me more about that? (Could I solve this by putting a diode in front of the thumbstick? :sweatdrop:)

It sounds like you're implying that the using-a-transistor-as-a-switch approach probably isn't desired, but is this... uh... crazy?



E. I put the source and drain in the wrong spot. I'm reading up on transistor basics again and man I really have no idea what I'm doing. Avoiding this for the time being would be good, I think...

Cory Parsnipson fucked around with this message at 02:11 on Jan 4, 2021

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Cory Parsnipson posted:


Oh I see... I have 2 leftover pins but I was hoping not to have to use them for this. I have no idea what you mean by directional digital switches. Could you tell me more about that? (Could I solve this by putting a diode in front of the thumbstick? :sweatdrop:)

E. I put the source and drain in the wrong spot. I'm reading up on transistor basics again and man I really have no idea what I'm doing. Avoiding this for the time being would be good, I think...

I was implying that a FET as a switch behaves differently forward-biased as opposed to reverse-biased. I thing that's a good thing, though. It may be possible to connect the two thumb sticks on the same antiparallel circuit leg and use their body diodes to your advantage.

Does the thumb stick have a pullup on it? Is it just closed-to-ground when pressed? It may make a difference on how to get the FETs to work.

Cory Parsnipson
Nov 15, 2015

babyeatingpsychopath posted:

I was implying that a FET as a switch behaves differently forward-biased as opposed to reverse-biased. I thing that's a good thing, though. It may be possible to connect the two thumb sticks on the same antiparallel circuit leg and use their body diodes to your advantage.

Does the thumb stick have a pullup on it? Is it just closed-to-ground when pressed? It may make a difference on how to get the FETs to work.

Oh ok, that's pretty cool.

I don't know for sure if there's a pullup, so I'm only assuming at this point that it does. I'm going off of this forum post: https://sudomod.com/forum/viewtopic.php?p=63104&sid=6f9c44c0381b0d7af24604690fffa5f3#p63104 where it says the button "shorts to GND when clicked".

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Assuming there's no weird electronics in that thing, you could try reading resistance between the button pin and the VCC and GND pins to see if they are just shorts or if there's a resistor in there.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
The fact that I can't really find a good answer to this makes me wonder if I'm asking the wrong question, but generally speaking, how do people get power inside a case to power multiple things? As I've mentioned before I have a psychological aversion to permanence so I'm always on the lookout for something that I can take in and out. But even if I ignore that, I'm not sure how to provide power to a board.

A 5.5/2.1mm plug seems like a pretty common plug for powering things, but panel mount jacks like this all seem to be assembled such that they get inserted from the outside of a case, so once it's installed and wires attached, it's stuck. Putting aside my permanence aversion, it seems like it's a lot easier to solder your board outside the case rather than solder it inside the board. Are people generally using JST-XH connectors to solder to the jacks, then to plug into the board? Something else?

Shame Boy
Mar 2, 2010

FISHMANPET posted:

The fact that I can't really find a good answer to this makes me wonder if I'm asking the wrong question, but generally speaking, how do people get power inside a case to power multiple things? As I've mentioned before I have a psychological aversion to permanence so I'm always on the lookout for something that I can take in and out. But even if I ignore that, I'm not sure how to provide power to a board.

A 5.5/2.1mm plug seems like a pretty common plug for powering things, but panel mount jacks like this all seem to be assembled such that they get inserted from the outside of a case, so once it's installed and wires attached, it's stuck. Putting aside my permanence aversion, it seems like it's a lot easier to solder your board outside the case rather than solder it inside the board. Are people generally using JST-XH connectors to solder to the jacks, then to plug into the board? Something else?

Yeah generally you solder a short length of wire to the barrel jack and then put a connector on that. For stuff like power you want as few connectors in series as possible, since they're all gonna introduce resistance and a bad connection on the power input can heat up real fast. If you really want something you can unplug from the barrel jack connector, maybe find one with spade terminals on the back?

e: Actually you could probably just use some 1/8" / 2.8mm spade terminals with that connector you posted, even though it prolly wasn't designed for it.

Shame Boy fucked around with this message at 17:28 on Jan 4, 2021

Shame Boy
Mar 2, 2010

Man this Amazon listing sure does make me wanna buy some spade terminals

Slanderer
May 6, 2007

FISHMANPET posted:

The fact that I can't really find a good answer to this makes me wonder if I'm asking the wrong question, but generally speaking, how do people get power inside a case to power multiple things? As I've mentioned before I have a psychological aversion to permanence so I'm always on the lookout for something that I can take in and out. But even if I ignore that, I'm not sure how to provide power to a board.

A 5.5/2.1mm plug seems like a pretty common plug for powering things, but panel mount jacks like this all seem to be assembled such that they get inserted from the outside of a case, so once it's installed and wires attached, it's stuck. Putting aside my permanence aversion, it seems like it's a lot easier to solder your board outside the case rather than solder it inside the board. Are people generally using JST-XH connectors to solder to the jacks, then to plug into the board? Something else?

If you really don't want to solder leads to the DC jack (or a pigtail from the DC jack to your board) in the case, then you can use terminal strips for power distribution--but they're kinda big, so it's not great! The better answer is that it's pretty easy just to add a DC jack (or usb connector) to your board directly and not mess around with any wired components like this

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
I'm fine soldering leads to the jack, the problem is that once I solder those leads onto the breadboard I'm basically stuck. Most jacks come out by pulling out of the mounting hole not going back into it, so if you solder the leads to the jack and to the board, both are now permanently stuck in your enclosure, since you can't pull the whole jack-board assembly out in either direction through your panel mount hole. Power jacks are cheap and so it seems fine to solder a plug onto one that means the jack-plug assembly can no longer come out of the enclosure, but trapping the part where you put all your work into (the board) seems a bit strange.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

FISHMANPET posted:

I'm fine soldering leads to the jack, the problem is that once I solder those leads onto the breadboard I'm basically stuck. Most jacks come out by pulling out of the mounting hole not going back into it, so if you solder the leads to the jack and to the board, both are now permanently stuck in your enclosure, since you can't pull the whole jack-board assembly out in either direction through your panel mount hole. Power jacks are cheap and so it seems fine to solder a plug onto one that means the jack-plug assembly can no longer come out of the enclosure, but trapping the part where you put all your work into (the board) seems a bit strange.

It seems like you might have some cognitive dissonance around permanence. If you're building into an enclosure, usually that would be at a late enough phase of the design that you're not expecting to swap out a bunch of components.

That said, yes, all of the options presented (pigtail with connector, terminal block, spade terminals on barrel) would address your concerns. I'll throw "inline connector" -- something like a power pole that could be fed through the barrel hole in parts -- onto the pile.

But again, if you're looking for this much flexibility, maybe you're not at a point where you're ready to put it in an enclosure.

Foxfire_
Nov 8, 2010

The most common thing is to have a connector on a PCBA directly poke out the case (e.g. all the ports on a typical laptop aren't directly attached to the outside plastic). For panel mounted stuff like that jack, you would typically be making a cable assembly out of the panel mount connector, wire, and another internal connector that will mate with a connector on the PCBA. Having wires soldered directly to pads on boards isn't normal outside of rework or prototyping because there's no cost-efficient way to make it and its fragile.

Cory Parsnipson
Nov 15, 2015

babyeatingpsychopath posted:

I was implying that a FET as a switch behaves differently forward-biased as opposed to reverse-biased. I thing that's a good thing, though. It may be possible to connect the two thumb sticks on the same antiparallel circuit leg and use their body diodes to your advantage.

Does the thumb stick have a pullup on it? Is it just closed-to-ground when pressed? It may make a difference on how to get the FETs to work.

I like this idea and I'm going to do some reading and try and remember all the stuff about transistors that I'm supposed to know. I found some college leaflet on selecting transistors that seems useful and now I'm finding a lot of individual mosfet results on digikey. Not sure what I was doing differently before.

Cojawfee posted:

Assuming there's no weird electronics in that thing, you could try reading resistance between the button pin and the VCC and GND pins to see if they are just shorts or if there's a resistor in there.

Great idea, thanks! Took a look this morning and when the thumbstick is pressed down, the output pin and GND has about 200 ohm resistance across it (0.04V). Also notable that I have to use the breakout board contacts, so there could be some resistance introduced because of that. I'm reading infinite resistance between VCC and the output pin, so I guess there's no direct contact between those things? The voltages are approximately the same.

I have a broken thumbstick I took out of a used joycon I bought so maybe I'll take it apart and see what it looks like.

EDIT: Took a look inside, was pretty cool, still confused about some things.

The teardown:



The thumbstick button is a metal dome switch near the bottom (it's the white sticker).


On the flip side, I tried to label the VCC, GND, and button wires and it looks like it's literally shorted to ground when pressed down. I don't know how the voltage on the button pin becomes VCC when it doesn't appear to be connected to anything the button pin goes into a pullup resistor and GPIO pin in my arduino and probably does something similar in the joycon circuit (im loving dumb). Maybe something important goes on in the purple areas I labeled something trippy happens in the purple areas; maybe it's some sort of printed resistor for the potentiometers. Looks like black magic to me.

Cory Parsnipson fucked around with this message at 21:28 on Jan 4, 2021

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
OK, trying to put my neurosis aside, it would be normal to want to dry-fit everything to make sure it works correctly, right? In that case if I was going to just solder the board to the jack, I'd probably solder on the power leads to the board, use some alligator clips to provide power while I plug everything else in to make sure it works, and then the final step is soldering the leads to the jack, once I've tested that the soldering on my board is all functional?

Part of the reason I'm thinking like this (and maybe I should stop thinking about it) is I'm planning on doing this project iteratively. The first phase is some mosfets and a level shifter on my board, another phase is potentially adding in a power switch (like I've talked about recently), another phase would be the dual turn-key pulse circuit I talked about. So from that perspective I'd want to be able to unplug my board and pull it out to add on new components, but maybe that's just dumb.

And again thank you (genuinely) for answering my stupid questions, this is all new to me, so even advice like this on "how to think about electronics projects" is useful.

Foxfire_
Nov 8, 2010

Taking it in and out is reasonable. The part where you're escaping into prototyping land is where you're soldering power leads to the board. A project that's doing that instead of having that be a connector is typically prototype enough that you aren't trying to also get nice case fit at that point.

If you need to have everything seal up nicely while still having a temporary wire-wire connection inside (and don't have crimps for an inline connector), you could use some wire nuts and electrical tape.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

FISHMANPET posted:

OK, trying to put my neurosis aside, it would be normal to want to dry-fit everything to make sure it works correctly, right?
Yes*

*In my opinion, the "dry" in dry fit would be the part where the wires aren't soldered in place. You could check the lengths with loose wires and make sure everything fits, then commit to a layout that you feel comfortable with once establishing that everything works. Then, when you're happy with tested functionality (outside the box) and fit (no hard soldered connections), then you can put it all together and make permanent commitments.

The exception would be something electro-mechanical or robotic in nature, since you need at least some of the mechanicals to test functionality. This is one of the big traditional challenges in robotic prototyping.

Shame Boy
Mar 2, 2010

FISHMANPET posted:

OK, trying to put my neurosis aside, it would be normal to want to dry-fit everything to make sure it works correctly, right? In that case if I was going to just solder the board to the jack, I'd probably solder on the power leads to the board, use some alligator clips to provide power while I plug everything else in to make sure it works, and then the final step is soldering the leads to the jack, once I've tested that the soldering on my board is all functional?

Part of the reason I'm thinking like this (and maybe I should stop thinking about it) is I'm planning on doing this project iteratively. The first phase is some mosfets and a level shifter on my board, another phase is potentially adding in a power switch (like I've talked about recently), another phase would be the dual turn-key pulse circuit I talked about. So from that perspective I'd want to be able to unplug my board and pull it out to add on new components, but maybe that's just dumb.

And again thank you (genuinely) for answering my stupid questions, this is all new to me, so even advice like this on "how to think about electronics projects" is useful.

Yeah ok I think there's just some confusion happening and/or you were just approaching this backwards. In my opinion you pretty much always want connectors on the board, not on the panel-mount things. If you're soldering wires directly to the board, you're probably doing something wrong.

So I think what you want is:
- Put a connector socket on the board
- Solder wires directly to the barrel jack
- Terminate those wires with the connector plug

If you need to take the board out, you just unplug the wire from the board. If you need to take the barrel jack out, you just... pull it out, it's not like the wire's gonna get in the way. The wires with the connector will be permanently soldered to the barrel jack, but like I said that's really not a problem, since the connector lets you unplug it.

Slanderer
May 6, 2007
There are sometimes good reasons to have the connector off board (if you can't mount the board the way you want due to various constraints in a premade enclosure, or maybe if you want to have a huge ferrite on the power input, or stuff like that). The most professional way to do this is to make your DC jack with a pigtail and terminate it with a crimped molex connector that plugs into your board. I've had a laptop with this configuration and I've worked on a few consumer devices like this.The second best way (in my opinion, taking into account space constraints and stuff) is to solder a pigtail to your board after its in the enclosure, leaving lots of room around the connectors, or alternatively putting a couple screw terminals on your board (easy!). If you have multiple boards and want power distribution, then crimbed cables are always gonna be the way to go--just distribute power from your main board to the others.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Terminal blocks

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
I do actually have a gaggle of TE 2P and 3P 2.54mm side entry terminal blocks.

Right now I'm stuck trying to visualize/draw out how this whole thing is going to work, what wires come out of where, how they connect, etc, and that seems to be giving me trouble as I end up trying to hold the whole thing in my head at the same time, and that's too much for my head.

sharkytm
Oct 9, 2003

Ba

By

Sharkytm doot doo do doot do doo


Fallen Rib
This is why wiring diagrams exist. Draw a box as your PCB, mark the connections, and figure it out on paper. If you want to get fancy, you could use something like Fritzing.

Adbot
ADBOT LOVES YOU

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Yeah, grab a piece of paper, draw each component with the wires that come out of it, and then connect them together.

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