|
ante posted:You'll want to switch the negatives though, not the positives. It won't work properly, otherwise For reference, how can you tell those are high-side switches and not low-side switches? High side: +V -> FET -> Load -> GND Low side: +V -> Load -> FET -> GND
|
# ? Sep 28, 2023 19:24 |
|
|
# ? May 2, 2024 23:27 |
|
They're N-FETs, which can't do high side switching. Given that the gate needs to be at the source voltage+10v (for example) to be on. When the transistor is on, and the drain is connected directly to the power source, then the source will be at, say, VCC-0.1V. So unless you have a special power supply for the gate that is above your battery voltage, you'll never get a proper turn on. It is possible to do high side switching with a P channel MOSFET, but that comes with more complications and lower efficiency
|
# ? Sep 28, 2023 19:33 |
|
babyeatingpsychopath posted:The diagram is getting a bit strained, but it's basically the same concept. Each of those boards is a replacement for a relay. However, instead of a relay having a normally open and normally closed contact, this one only has a normally open contact that can ONLY switch + to LOAD. Whoa, hey, can this person's microcontroller take 12V? That relay board they're using has a neat feature where it provides an on-board buck converter with 5V out. They may be powering their microcontroller from that, it's not clear from the video they posted. But it looks like a microcontroller that will let the blue smoke out if you give it 12V. cruft fucked around with this message at 19:37 on Sep 28, 2023 |
# ? Sep 28, 2023 19:34 |
|
cruft posted:Whoa, hey, can this person's microcontroller take 12V? Yes, I selected that specific board because it's got a 5V regulator good up to 16V input. ante posted:They're N-FETs, which can't do high side switching. How can we, as casual hobbyists, determine whether those are high-side or low-side switches? For something like this the topology is already figured out, right? babyeatingpsychopath fucked around with this message at 19:49 on Sep 28, 2023 |
# ? Sep 28, 2023 19:47 |
|
They are never high side switches. There is no reason to do that. Relays can get around that because they are just an isolated wire, not a semiconductor. Edit: As a hobbyist, it is very within your power to look into basic transistor circuit analysis and prove me wrong. Learning about BJTs is a little easier, but conceptually largely the same for your purposes. Getting a better understanding will help in many other aspects as well. ante fucked around with this message at 19:53 on Sep 28, 2023 |
# ? Sep 28, 2023 19:50 |
|
babyeatingpsychopath posted:Yes, I selected that specific board because it's got a 5V regulator good up to 16V input. Sorry to beat this point, but what specific board? I only see you specifying a MOSFET breakout board. I want to make sure OP doesn't fry their microcontroller. e: Earlier you said ItsyBitsy which, yes, can handle 16V. I withdraw my concern. cruft fucked around with this message at 19:56 on Sep 28, 2023 |
# ? Sep 28, 2023 19:53 |
|
Mohamed Atalla can have an alliterative superhero name for making all of modern electronics possible.babyeatingpsychopath posted:Yes, I selected that specific board because it's got a 5V regulator good up to 16V input. For those, there is no real way to know definitively since there's basically no documentation. Basically just guess because n-channel are more common. A less sketch/more expensive part would be telling you the chip on it, and the datasheet will say what kind it is (+lots of other things like max temp, transfer functions, switching speed, ...)
|
# ? Sep 28, 2023 20:20 |
|
Foxfire_ posted:Mohamed Atalla can have an alliterative superhero name for making all of modern electronics possible. seems fair
|
# ? Sep 28, 2023 20:21 |
|
Foxfire_ posted:Mohamed Atalla can have an alliterative superhero name for making all of modern electronics possible. the linked board is available with buyers choice of four different mosfets and the descriptions say exactly which ones they are?
|
# ? Sep 29, 2023 03:00 |
|
The aliexpress one says what they are. The amazon link babyeatingpsychopath asked about is a different one that's just one unspecified design outside of a couple numbers far as I can tell.
|
# ? Sep 29, 2023 17:24 |
|
Is there a recommended board/micro for something that can do USB host, including enumerating devices through hubs (which it seems like basically everything has a disclaimer including lack of support for)? Ideally something cheaper than a full on Teensy 4 or similar. The RP2040 claims to have host support, but the only things I can see describing it is adafruit managing to fake it by bitbanging its IO pins (which would work, I guess, but I'm hoping there's something more native) which seems to contradict the statement that it has host support native. This would just be for HID or other very slow devices so USB 1.1 max speed is fine. A single USB controller that does both/OTG is also fine, I don't need it to be a client. 5V native IO preferred for the rest of the circuit but I can use shifters if that makes the USB side easier. Not specifically looking for an arudino-compatible though that'd probably be the easiest option, but this is the closest thread to "general embedded development" I know of so forgive me if I picked the wrong one.
|
# ? Oct 5, 2023 15:41 |
|
power crystals posted:Is there a recommended board/micro for something that can do USB host, including enumerating devices through hubs (which it seems like basically everything has a disclaimer including lack of support for)? Ideally something cheaper than a full on Teensy 4 or similar. The RP2040 claims to have host support, but the only things I can see describing it is adafruit managing to fake it by bitbanging its IO pins (which would work, I guess, but I'm hoping there's something more native) which seems to contradict the statement that it has host support native. This would just be for HID or other very slow devices so USB 1.1 max speed is fine. A single USB controller that does both/OTG is also fine, I don't need it to be a client. 5V native IO preferred for the rest of the circuit but I can use shifters if that makes the USB side easier. I came across this project recently that interfaces modern usb controllers with old sega saturn consoles by using an arduino + usb host shield. I don't know how robust, available, or affordable the usb host shield is, but it looks like it has a decent software library. https://docs.arduino.cc/retired/shields/arduino-usb-host-shield
|
# ? Oct 5, 2023 16:11 |
|
I made an electronics thing that people are actually asking for. It's a weird clock, a kinetic art display, and also plays 8x8 animations my sister in law and I upload to my double secret server on the Internet. We've been doing a lot of winter themed ones lately. The original intent was sending little messages to my kid while she's away at college. She likes seeing new animations pop up from her loved ones. I made 3 the first run, now I'm making 4 more to fill requests. They cost about $60 each to make, because I'm using Gen-You-Ine Adafruit parts. If anyone ITT is business minded, I bet you could sell these with very few changes for production. I've done most of the R&D and all the source code is MIT license.
|
# ? Dec 2, 2023 16:19 |
|
Oh very cool.
|
# ? Dec 2, 2023 17:19 |
|
Is there a BOM available? If you make the thing, is there a way to point it at some other double-secret server?
|
# ? Dec 3, 2023 16:28 |
|
babyeatingpsychopath posted:Is there a BOM available? BOM and 3D printer parts are here: https://learn.adafruit.com/sqaure-neopixel-display-with-black-led-acrylic You can direct wire the Feather to the grid and skip the wing. The Arduino code and server code are both 100% my creation and MIT licensed. The server URL is in a couple #defines in the .ino file. The server itself lets you upload animated gifs. If you want to password protect it or use HTTPS, you have to set that up in Caddy or nginx or something. I'd be happy to help anybody set up their own instance! I can even set you up with some animations
|
# ? Dec 3, 2023 17:59 |
|
Anybody know an algorithm for debouncing an array of 16 switches? My poll loop currently runs about 13 times per millisecond, on this 8MHz 3.3v Atmel 32u4. I don't have a whole lot of instructions to spare here, unfortunately. I know I could just move to something like an RP2040 and get interrupts on all GPIOs, a separate PIO thread for USB, and a gajillion more instructions per millisecond, but I like a challenge I'm building a Rock Band drum kit. It's working great except for the bouncing killing my streaks.
|
# ? Jan 1, 2024 16:16 |
|
Are analog RC filters on the switches an option?
|
# ? Jan 1, 2024 16:28 |
|
PDP-1 posted:Are analog RC filters on the switches an option? If so, then RC + Schmitt trigger is the classic circuit. There's also the OnSemi MC14490 or Maxim MAX6818. Like $10 per chip in small quantities, but this is a way to get automotive-grade debouncing. There's also throwing another tiny microcontroller off the side and multiplexing the inputs and only doing switch debouncing with the other micro...
|
# ? Jan 1, 2024 19:06 |
|
You can do a similar hysteresis function in hardware by having a byte for each pin that gets incremented (up to some max value) each time the button is pushed and decremented (limited to zero) when it isn't pushed. Only change the output state when the counter hits one of those limits.
|
# ? Jan 1, 2024 20:21 |
|
I cheaped out and coded up a 254-sample (40ms) blackout period per pin after an edge is detected. Seems to do the trick, for this application. I considered doing it with hardware, but I'm a lazy jerk, and don't want to solder any more junk on. E: I just realized that fits into a uint8. I used a uint16 because I wasn't sure how many samples it would be. What's weird is that my benchmarks showed no speed difference between 8-bit integer arithmetic and 16-bit, even though the 32u4 is an 8-bit CPU. I think. Anyway the family is playing rock band with it now, so electronics time is over. cruft fucked around with this message at 20:48 on Jan 1, 2024 |
# ? Jan 1, 2024 20:45 |
|
It could be that the compiler saw that your value never gets above 255 and just changed it to be uint8.
|
# ? Jan 1, 2024 21:56 |
|
On the one hand, I'm really proud of myself for squeezing enough performance out of an 8MHz CPU to get software-debounced drum pad hits that apparently only close the momentary switch for under 20ms. On the other hand, I'm appalled that this chip is running at almost twice the clock speed of my first desktop computer, and all I'm doing with it is asking over and over if 14 buttons have been pressed.
|
# ? Jan 3, 2024 18:33 |
|
cruft posted:On the one hand, I'm really proud of myself for squeezing enough performance out of an 8MHz CPU to get software-debounced drum pad hits that apparently only close the momentary switch for under 20ms. asking if buttons have been pressed is the only thing computers do if you think about it too much
|
# ? Jan 3, 2024 18:58 |
|
cruft posted:On the one hand, I'm really proud of myself for squeezing enough performance out of an 8MHz CPU to get software-debounced drum pad hits that apparently only close the momentary switch for under 20ms. yeah but it can check if the buttons are pressed almost twice as fast
|
# ? Jan 4, 2024 00:12 |
|
|
# ? Jan 5, 2024 00:14 |
|
That's the long answer, as well
|
# ? Jan 5, 2024 00:20 |
|
Long answer: "Nooooooooo."
|
# ? Jan 5, 2024 00:37 |
|
Is it possible for a USB device to know what host it's talking to? I'm working on this toy drum controller for Wii Rock Band, and it's just beyond me how to get it working right in this PC game called Clone Hero. The interface is this bonkers combination of 12 gamepad buttons for 9 switches, and I've got it working on the Wii, but I'd like to have it go "oh, you're a PC, you get one button per input switch". Without requiring the user to do anything. Is that even possible?
|
# ? Jan 7, 2024 22:13 |
|
Yeah there's almost some sort of host client negotiation going on. The controller is almost certainly sending a digital signal not raw analog values. The last fully analog controller was possibly the Atari 2600 joystick
|
# ? Jan 7, 2024 22:29 |
|
cruft posted:Is it possible for a USB device to know what host it's talking to? It's a good question. The burden of data is on the device to supply information to the host. I have the workflow for device enumeration down pretty solid, but I'm not seeing anything that requires the host to TRANSMIT to the device beyond "give me X." So the steps to get a USB device working are basically: Host reads Device Descriptor Host reads Configuration Descriptor(s) Host reads Interface Descriptor(s) Host reads Endpoint Descriptor(s) I think you could have a device with two Endpoints; one for the Wii which is standard and one for the PC. After the PC gets all the data, then it requests endpoint 1 and your code does the "1 button=1switch" mode. If the host never requests endpoint 1, you default to endpoint 0 and assume that's the Wii. Of course, it might be a different Interface and not Endpoint; I'm not real solid on that part of the USB spec.
|
# ? Jan 7, 2024 23:12 |
|
Is this a custom thing you're making? Is it possible to just put in a switch that goes between PC and Wii mode? Seems like that's what a lot of devices do these days. There's either a switch or a button combo you do to switch between host modes.
|
# ? Jan 7, 2024 23:28 |
|
Hadlock posted:Yeah there's almost some sort of host client negotiation going on. The controller is almost certainly sending a digital signal not raw analog values. The last fully analog controller was possibly the Atari 2600 joystick even just on/off digital buttons have been fully serialized since at least the NES, probably earlier
|
# ? Jan 7, 2024 23:30 |
|
shame on an IGA posted:even just on/off digital buttons have been fully serialized since at least the NES, probably earlier Game Port joysticks, which were still available until the early 2000s, have dedicated pins for each button, and connect directly to the axis potentiometers and do the ADC on the computer. No logic on the stick itself at all. Sagebrush fucked around with this message at 00:10 on Jan 8, 2024 |
# ? Jan 7, 2024 23:54 |
|
babyeatingpsychopath posted:I think you could have a device with two Endpoints; one for the Wii which is standard and one for the PC. After the PC gets all the data, then it requests endpoint 1 and your code does the "1 button=1switch" mode. If the host never requests endpoint 1, you default to endpoint 0 and assume that's the Wii. That is a hell of a clever idea. And that's exactly how the Wii works: I have to disable the serial connection on the board because it uses endpoint 0. Fortunately, I was able to once again shoot in the dark enough to figure out what the undocumented mapping values in Clone Hero were expecting, so I don't have to do this after all. Cojawfee posted:Is this a custom thing you're making? Is it possible to just put in a switch that goes between PC and Wii mode? Seems like that's what a lot of devices do these days. There's either a switch or a button combo you do to switch between host modes. I considered this, yeah. I was just wondering if there were a more clever thing I could do with USB, and it looks like, yes. BBL, gotta go play a bunch of video games to verify everything's working properly
|
# ? Jan 8, 2024 00:05 |
|
Anyone dealt with Seeed studio xiao nrf52840 sense? I'm trying to build a gesture recognizing ring which will need to: 1. Wake on double tap (found example code) 2. Recognize 3d gestures (got this working) 3. Be a BLE HID device. Preferably with pairing and all. 4. Very low power sleep most of the time. The problem is that there are two arduino boards for this thing. The "mbed" enabled one is what i used for recognizing gestures, but it doesn't support the nice adafruit bluefruit libraries which make HID reasonable. The plain non-mbed does support adafruit bluefruit, but the ml sketch doesn't work as well. Not sure if it's just a timing thing since the "sampling now" prompt doesn't appear until _after_ the sampling is done, making it difficult to perform gestures at the right time. Anyone successfully used edge impulse models on the non-mbed version? Or got BLE HID working on the mbed version?
|
# ? Mar 12, 2024 04:17 |
|
It turns out that it was merely a difficulty in timing the sampling causing my troubles. I replaced the late-printing message with turning on a led to let me know, and the non-mbed runs the edge-impulse model just fine. So I should be able to use all the nifty Adafruit bluefruit and power management stuff.
|
# ? Mar 12, 2024 19:10 |
|
Deadite posted:That's interesting, I don't know much about lighting controls and thought this whole thing would be much simpler than it is turning out to be. Do the DMX LED controls come in smaller versions? Hey I'm not sure if this is any use to you, but I'm designing a carrier board that takes Arduino Nanos and connects the 6 PWM pins to mosfets and XT30 connectors for a purpose that isn't too dissimilar to yours (and lets it do fade effects). I need to finish the silkscreen and check a few things, but once I have you're welcome to the KiCad file. Dia de Pikachutos fucked around with this message at 11:06 on Mar 27, 2024 |
# ? Mar 27, 2024 11:03 |
|
Sagebrush posted:Game Port joysticks, which were still available until the early 2000s, have dedicated pins for each button, and connect directly to the axis potentiometers and do the ADC on the computer. No logic on the stick itself at all. They use the fact that the analog axes produce a pulse when read by the host to signal a request for data and then the controller responds with a clock signal on the button 1 line and serial data on button 2 which makes it work kinda like the NES/SNES. I have a Saitek gamepad from the early 2000s that's pretty much a PSX dual analog knockoff and supports game port as well as USB presumably through a similar trick. Deadite posted:That's interesting, I don't know much about lighting controls and thought this whole thing would be much simpler than it is turning out to be. Do the DMX LED controls come in smaller versions? Addressable LEDs are not always the right answer but they're cheap and easy enough these days that they can be used to brute force a solution for less mental effort than doing it what might be the absolute most cost or power efficient way. wolrah fucked around with this message at 18:05 on Mar 27, 2024 |
# ? Mar 27, 2024 18:02 |
|
|
# ? May 2, 2024 23:27 |
|
wolrah posted:
I haven't looked too deeply into WLED, but aren't you basically stuck using premade patterns unless you stream pixel data from external sources? I'd usually use fast LED on an Arduino or use a pixelblaze if I wanted a custom pattern.
|
# ? Mar 27, 2024 18:52 |