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 $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«531 »
  • Post
  • Reply
Granite Octopus
Jun 24, 2008



syntaxrigger posted:

I was just curious how others managed the expense of electronic components and if there was something I was missing about keeping the cost down.

If you're serious about keeping costs down and doing dumb little projects, I'd suggest scavenging.

Printers are a constant feature on footpaths around here, and I grab them whenever I can. A great source of motors, gears, wire, springs, sensors etc.

Need a raspberry PI? Any old computer with a parallel port will do the same thing. It can be hard to know when you're hoarding junk vs collecting specialist hobby resources but if you have a bit of space it's never been a better time to collect e-waste.

Personally I don't really like buying new stuff just to do a project, both from an economical and environmental standpoint, so scavenging makes much of my stupid bullshit possible.

Adbot
ADBOT LOVES YOU

Forseti
May 26, 2001
To the lovenasium!


Dominoes posted:

Given I'm using another SPI hardware piece on the board, Is is OK to put this on the same SPI device, or do I need to use a diff/dedicated one?

Same device but it needs its own chip select line. Also if you are asserting the CS by tying low/high instead of an IO line for whatever else is on the SPI peripheral that's not gonna work.

Dominoes
Sep 20, 2007



Foxfire_ posted:

Depends on what you want to do.

Types of storage:
- SRAM: Very fast. Won't hold values without power
- DRAM: Fast. Only holds values for small times even with power. Used with a controller that is constantly rereading and refreshing data. (This is the kind that is the main memory on a PC)
- EEPROM: Slow. Doesn't need power. Limited number of writes.
- NOR flash: Slow reads, very slow writes. Doesn't need power.
- NAND flash: Like NOR flash, but all reads/writes/erases happen on enormous blocks instead of bytes. Also needs ECC because bit errors are normal and frequent.
- Battery Backed RAM: Take a SRAM and a battery, add some circuitry to switch the power source to the battery when main power goes away. Holds values as long as battery lasts
- nvRAM: Take a SRAM, some flash, and a capacitor, add some circuitry to copy flash->SRAM on powerup and SRAM->flash on loss of main power using capacitor power.
- MRAM/FERAM/ReRAM: Various fancy technologies for fast byte-addressable memories that don't need power to hold values. Typically looks like a SRAM, but the values magically don't go away.

Things you are maybe confused about?
- DMA = Direct Memory Access = a peripheral is reading/writing to memory directly without going through the CPU. Like an ADC could be independently saving samples into a RAM buffer for the CPU to look at later instead of the CPU having to read each sample as it happens. Not directly related to nonvolatile storage.

Things you already have inside the microcontroller (probably, I am going off of what's in a STM32F7 because that's what I use at work):
- A section of RAM that can be powered from an external battery. If you supply battery and turn it in, it will appear as a region of memory that holds its values across power cycles. It is as fast as other RAM, it is not big, and goes away when the battery does. A reasonable sized coin cell can run this for a few years. Look in the power controller section of the reference manual.
- A whole bunch of NOR flash memory. This is what is holding the program code its running from. You can also read and write data to here at runtime. Look in the embedded flash controller section of the reference manual

Ways to attach an external storage chip on a STM32:
- I2C/SPI: Access it as a generic serial device. This is slow and only the CPU will be able to access it (no DMA), but that's fine for lots of stuff
- Flexible Memory Controller: This can interface to a bunch of different memory types. You configure it with timings, bus widths, what enables should go, etc... and it implements read/writes to some address range as external memory accesses.
- QuadSPI controller: Similar to the generic SPI controllers, but supports multiple data bits per clock and map address ranges into SPI acceses.
Awesome; thank you for the exceptional, detailed breakdown. Looks like I had multiple misunderstandings.

Forseti posted:

Same device but it needs its own chip select line. Also if you are asserting the CS by tying low/high instead of an IO line for whatever else is on the SPI peripheral that's not gonna work.
Awesome. I'm still a bit fuzzy on CS, but it seems like it can be any properly-configured GPIO pin. My WIP (untested) code has the CS pin as a push_pull_output.

Dominoes fucked around with this message at 00:33 on May 25, 2020

Forseti
May 26, 2001
To the lovenasium!


Dominoes posted:

Awesome; thank you for the exceptional, detailed breakdown. Looks like I had multiple misunderstandings.

Awesome. I'm still a bit fuzzy on CS, but it seems like it can be any properly-configured GPIO pin. My WIP (untested) code has the CS pin as a push_pull_output.

Yep, CS can be any line you can set high/low at will. On SPI everything is connected to the same CLK/Data lines and each has its own CS connection. You set the CS (usually low) to select which one you're actually talking to. By contrast, I2C has the unique address number that you have to send with your data so the appropriate device knows you're talking to it.

Stack Machine
Mar 6, 2016

I can see through time!


Fun Shoe


ante posted:

Where do you live, out of curiousity?


That's a distinction that I have vaguely heard from people in other countries, but doesn't exist in Canada as far as I can tell.

I'm in the US and I'm willing to accept that this distinction in terminology might not be universal but it is very common among electrical and computer engineers here at least. However it's called, I like having the distinction even if it's only to loosely guide my cost/engineering effort rule of thumb.

It may be an artifact of the past as much as anything. "Electronic" appeared alongside vacuum tubes to distinguish things which relied specifically on manipulating the kinetics of electrons. This distinction makes much more sense in tubes, where currents are flowing as electrons on a ballistic trajectory. As for whether all engineers make this distinction around the world or whether, say, a piezo transducer makes the cut, I have no idea. It's a useful distinction for me and a lot of other people but I'm certainly not going to go out of my way to gatekeep jargon.

Gromit
Aug 15, 2000

I am an oppressed White Male, Asian women wont serve me! Save me Campbell Newman!!!!!!!


poeticoddity posted:

The electrolytic capacitor on that board labeled C9 is tilted at an angle.
Normally, I'd ignore that, since it's often done intentionally to reduce the standoff height of components so you can use a tighter enclosure.
In this case, all of the other electrolytic capacitors are 90 degrees to the board and several of them are bigger (specifically taller) caps.

So I'll ask the dumb question: Is there any visible damage to that cap on the underside or to its connections?
Once in a blue moon I've run into caps that got handled too roughly and a lead came out or dislodged a cold-soldered joint.

Also, there's one IC in a socket. Is that firmly seated?

Thanks for taking a look. I'll check that capacitor specifically, and anything else that looks like it might have been handled poorly. I didn't see any obvious damage to any of the board, and none of the soldering looks dodgy. But I'm inexperienced so wouldn't know it unless it was very obvious.
And yes, I took out that IC and pushed it back in.

Stack Machine posted:

One piece of advice that has proven true time again for me is the 0th commandment: thou shalt check thine power supply. Your ICs will all have datasheets that will tell you which pins are supplies. You can check their DC values and AC values with a multimeter. Probing on that board while it's running is it's own though. Find a way to probe it without touching it while it's plugged in if you can or use an isolation transformer if by some chance you have one. If the DC value is reasonable and the AC value is 0 your power supply is OK and you're in for suffering. If the AC value is high start checking caps. If the DC value is 0 something in the supply is dead.

"But it powers up" you say. There is likely more than one supply voltage on this board. It's possible only one has failed.

Yeah, the leds power up and the PCB makes some whiny noises from somewhere near that coil, but nothing I would say was a stand-out problem (unless those things should be silent?) I'll try and check the voltages coming out of the supply and see if they are okay.

Thank you both for the replies.

Dominoes
Sep 20, 2007



Ordered W25 flash breakout board, and added to design. Unlike most ICs I've found, the datasheet doesn't mention anything wiring considerations. The breakout looks like it has a cap between VCC and ground(?). Should I throw a 100nF cap there and call it good?

Dominoes fucked around with this message at 03:08 on May 25, 2020

ante
Apr 9, 2005

No... Not without incident.

Yep, always do that

Dominoes
Sep 20, 2007



Appreciate it.

Stack Machine
Mar 6, 2016

I can see through time!


Fun Shoe

Gromit posted:

Yeah, the leds power up and the PCB makes some whiny noises from somewhere near that coil, but nothing I would say was a stand-out problem (unless those things should be silent?) I'll try and check the voltages coming out of the supply and see if they are okay.

Re the whining sound, sound isn't really good for diagnosis in switching power supplies without some familiarity with the "normal" sound. They chirp audibly under a range of light load conditions (and the pitch changes with the load) and they also chirp audibly when they're completely shorted as they repeatedly try and fail to start.

syntaxrigger
Jul 6, 2011

Actually you owe me 6! But who's countin?



Granite Octopus posted:

If you're serious about keeping costs down and doing dumb little projects, I'd suggest scavenging.

Printers are a constant feature on footpaths around here, and I grab them whenever I can. A great source of motors, gears, wire, springs, sensors etc.

Need a raspberry PI? Any old computer with a parallel port will do the same thing. It can be hard to know when you're hoarding junk vs collecting specialist hobby resources but if you have a bit of space it's never been a better time to collect e-waste.

Personally I don't really like buying new stuff just to do a project, both from an economical and environmental standpoint, so scavenging makes much of my stupid bullshit possible.

I love the idea of upcycling old electronics into stupid robots/electronic projects but I have a feeling the required knowledge to do effectively is leagues away. That being said I LOVE this guys videos! He also will reverse engineer stuff every so often and that skill feels immensely useful.

https://www.youtube.com/watch?v=pi3EVvdaPuw

mobby_6kl
Aug 9, 2009

"You are the best poster... do not let anyone say otherwise."


Forseti posted:

I don't know that it is working in the video though? I mean he shows a square wave that isn't square half the time and it's "working" because it changes when he blows on it which is pretty much random noise to begin with.

I haven't really played a ton with i2s myself but it looks like it doesn't have any error detection and different impedance between various lines can cause issues:


What was the original goal? Just to read the ESP32's internal ADC and output that value on the i2s bus? I think it might be best to start simple, so like maybe hook a potentiometer up to the ADC input and see if you get the i2s interface sending the same value over and over first, then go from there.
I don't think that was supposed to be a square wave, which... doesn't really make it better because it is suspiciously square sometimes. In the next videos it looks like he got it actually recorded, but yeah maybe it wasn't really working properly there.

The original goal was to read the internal ADC (or later the actual I2s microphone that I found, as an alternative). It obviously can be done easily by polling but this way I2S takes care of everything with minimal overheard which is pretty sweet. I then feed the data in batches into FFT.

The problem was that it seemed to work perfectly fine at constant inputs or lower frequencies, but fall apart around 1khz. It was a bit difficult to see with sine waves (as I don't have a reliable way to generate them, though line out from the PC could work) but my multimeter testing method definitely created a new problem that didn't actually exist. I realized that when it went low, the pin was left floating which explained the falling edge. So eventually I got it working reasonably well like:

* add a pulldown resistor at input
* Buffer 44k samples before dumping to avoid serial issues
* Crank up the I2S sample rate to 80khz
* randomly adjust a few other I2S settings


ta-da. (the last one is supposed to be a sine captured by an analog microphone)

babyeatingpsychopath
Oct 28, 2000
Forum Veteran

syntaxrigger posted:

I love the idea of upcycling old electronics into stupid robots/electronic projects but I have a feeling the required knowledge to do effectively is leagues away. That being said I LOVE this guys videos! He also will reverse engineer stuff every so often and that skill feels immensely useful.

https://www.youtube.com/watch?v=pi3EVvdaPuw



If you like him, you'll love https://www.youtube.com/user/bigclivedotcom . Big Clive has an amazing Manx accent and wonderful reverse-engineering skills.


I came here to post https://www.youtube.com/watch?v=vq968AFgPhg, which I got from Hackaday today. This is absolutely ram-packed full of good info. The middle third goes through so many good things so fast it's worth watching over and over until they stick.

CarForumPoster
Jun 26, 2013


babyeatingpsychopath posted:

I came here to post https://www.youtube.com/watch?v=vq968AFgPhg, which I got from Hackaday today.

This is fantastic. Never thought of the sections of copper method. He makes it look so easy.

Hypnolobster
Apr 12, 2007

What this sausage party needs is a big dollop of ketchup! Too bad I didn't make any.


Holy hell that video is 14 minutes of solid wall to wall information. I've been dicking together worthless prototype boards since I was like 10 (I still don't know anything about electronics, I've always just bullshitted my way through) and I think every single thing he said was new information.

Unperson_47
Oct 14, 2007





Ambrose Burnside posted:

ohhh thatís smart, i like this, and i have access to a cricut so i could roll my own from CAD files p painlessly. prolly not suited to anything other than low-power circuits and i bet typical soldering temps ruin the adhesive, but still, dang

Did you ever try this?

Unperson_47 fucked around with this message at 21:20 on May 25, 2020

syntaxrigger
Jul 6, 2011

Actually you owe me 6! But who's countin?



babyeatingpsychopath posted:

If you like him, you'll love https://www.youtube.com/user/bigclivedotcom . Big Clive has an amazing Manx accent and wonderful reverse-engineering skills.


I came here to post https://www.youtube.com/watch?v=vq968AFgPhg, which I got from Hackaday today. This is absolutely ram-packed full of good info. The middle third goes through so many good things so fast it's worth watching over and over until they stick.

I have bigclive as well. Thanks for the recommendation.

Subjunctive
Sep 12, 2006

careful now


Cybernetic Crumb

(That prototyping video looks like straight magic to me. Looking forward to being properly amazed by it when I get some SMT experience!)

Yesterday I soldered something for the first time in about 30 years, and it turned out OK, but I'm looking forward to getting better at it. Just keeping the header positioned on the board while I was soldering was a bit of a trick and required me to prop it on the corner of a box. And the solder really wants to come away with the iron!

I'm soldering 4+2 headers on for the serial connection and flash-mode jumper on this LED controller, and I'm wondering if there's a better way to temporarily attach them, since they're coming right off once things are flashed. Some sort of putty or something that I can jam in there to hold the connection while I flash? I don't want bumping the table or a stiff breeze to screw up the flashing, but the connection doesn't need to be very strong or long-lasting.

Also, I harvested the end of a cheap power strip to attach to the 12V DC supply I bought for the light strip, only to discover that it's in fact a 5V supply. I thought various voltage-in-series thoughts about the two pairs of 5V +/- connections and turning the voltage regulator up all the way, but a quick continuity test showed me that they were the same source, so no easy win. Going to just sacrifice a 12V wall wart from somewhere to get going with this while I wait to get and/or build a real supply.

Apropos which, I'm pulling together the parts for this DIY supply but I'm having trouble describing what I want to the Mouser web site:

- I want a step up/down boost buck converter module, like this one, but all I can find is the component ICs, and not a put-together module. What should I be searching for? (If I were a little more confident I'd think about assembling the module from subcomponents, but I'm not really at the surface-mount stage of my progression yet.)

- also a simple voltmeter/ammeter panel with LED display, looking something like this one. I can find big-boy ones that cost hundreds of dollars, but nothing more...quotidian for my hacking around. Lately getting stuff shipped from China is a multi-multi-week affair, IME, so I'm looking to figure out what to ask Mouser/Digikey for.

Also taking recommendations on pleasant pre-assembled bench supplies that I might acquire!

ante
Apr 9, 2005

No... Not without incident.

If solder is coming up with the tip, your joint isn't hot enough. Solder follows the heat - look up soldering videos on YouTube, and you'll see that the iron only gets dabbed with solder briefly to allow faster heat transfer, and then the majority of solder gets jammed into the joint itself.

For programming, you can probably just hold the pins at an angle with a little bit of tension, if it's just for a second. Unless you're using OTP microcontrollers, a failure just means you have to try again.
Blutak has a spot on my bench, though.

Shame Boy
Mar 2, 2010

THE HORROR
THE HORROR





ante posted:

If solder is coming up with the tip, your joint isn't hot enough. Solder follows the heat - look up soldering videos on YouTube, and you'll see that the iron only gets dabbed with solder briefly to allow faster heat transfer, and then the majority of solder gets jammed into the joint itself.

One thing I was never able to pick up from videos and had to learn was that it's okay to put a bit of down-force on the iron, your goal is to make good thermal contact between the iron and the joint so it dumps in enough heat quickly enough. I mean not enough that you're wildly bending the board but it's fine to hold it down nice and firm. My technique is generally:

Make sure the iron is a little wet with solder (just a little)
Press it into the joint, try to get it up against both the lead and the hole
Feel that the chisel tip is actually seated flat, if not wiggle it a little
Push the solder into the joint (not onto the iron tip)
Hold the iron there for another half second to full second, as capillary action draws the solder down into the hole (another thing that a lot of videos gloss over, or don't explain why you do it)
Remove and let it cool, observe to see if it's the right shape / shiny / etc.

Once you get into a rhythm this whole process becomes second-nature and you can do it all real fast automatically without having to think about each step.

That Works
Jul 21, 2006


Fun Shoe

I have this linear actuator https://smile.amazon.com/gp/product...0?ie=UTF8&psc=1
and this relay https://smile.amazon.com/gp/product...0?ie=UTF8&psc=1
https://www.youtube.com/watch?v=4oPFm2tyM58

a 12v battery and a Raspberry Pi zero W.

I've got a script that will fire off the right GPIO for 30s (takes 20s to extend or retract the linear actuator). Thanks to earlier recs from the thread I was able to solder the headers onto the PiZero board and it still functions / fires off the right pin at the right time. Counting this as a huge win.

Ok so now I am trying to get my head around how to make the Pi control a 12V DC linear actuator. I naively thought that a single relay could just make the actuator go down and then take the signal off of it and then it would go the other way.

Just wiring the actuator directly to the battery does this:

Blue wire (-) Brown wire (+) = actuator extends
Blue wire (+) Brown wire (-) = actuator contracts

So I can't just turn relay on and off to change directions. I guess I would need 2 relays. I think maybe they could work if wired like so?



I apologize for my crude diagram. I've never had a circuits course and have only been reading about this stuff for like 2 weeks off and on.

Would this work instead? And I just have the Pi run an "open door" command to light up GPIO4 for 30s then stop, then a "close door" command to light up GPIO17 for 30s then stop?

Also would I need to run the grounds on each relay (bottom rung of each facing the center) to the Pi as well?

That Works fucked around with this message at 20:05 on May 26, 2020

Forseti
May 26, 2001
To the lovenasium!


For soldering I use a pretty big chisel tip as my go to (I think it's 2.4mm but I don't remember off the top of my head). For through hole parts I put the tip against the pin and try to lay the flat end down on the pad. As mentioned, it should be "wet", though it doesn't need a blob of solder hanging off it. If it's already pretty wet (like I'm going down a line) it usually heats the pad and pin fast enough to just touch the solder to the opposite side and keep going but sometimes when I'm getting started I'll touch the solder to the tip itself near the pin then trace it around the pin and back to the tip to fill it in.

If the last soldering you did was 30 years ago I'd guess you probably used lead solder. If you just grab the first solder you see now it's probably lead-free, which needs more heat and usually just isn't as easy to get a good joint with, although I wouldn't say it's horrible to work with personally. But lead is definitely easier.

Lots of flux helps too, especially if the joint isn't pre tinned but it's annoying to clean off after so it's best if you can get away with just what's in the solder wire itself. You probably aren't going to come across a PCB that isn't tinned unless you make it yourself though but if you're soldering to something like the terminal of a speaker you'll probably want to add flux.

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012





Gravy Boat 2k

That Works posted:

I naively thought that a single relay could just make the actuator go down and then take the signal off of it and then it would go the other way.

Just wiring the actuator directly to the battery does this:

Blue wire (-) Brown wire (+) = actuator extends
Blue wire (+) Brown wire (-) = actuator contracts

So I can't just turn relay on and off to change directions. I guess I would need 2 relays. I think maybe they could work if wired like so?



I apologize for my crude diagram. I've never had a circuits course and have only been reading about this stuff for like 2 weeks off and on.

You have run into a fundamental problem of DC motor control that is fixed with something called an H-bridge.

https://en.wikipedia.org/wiki/H-bridge

You have nearly designed one yourself, and the half-bridge thing you've got drawn up could theoretically work. But the problem with your design (if I'm reading it correctly) is that there are only two switches and there's no neutral position. So you risk shorting everything out if the timing isn't exactly simultaneous, which is impossible to guarantee with mechanical switches. Actually, now that I look at it more closely, I think you'll be fine -- the intermediate position will just connect both sides of the load to the same voltage so nothing should happen. What you have will work.

The good news is that H-bridge chips are super cheap (search Amazon, there will be tons of modules), or if you want to build one yourself, they aren't difficult to put together.

Sagebrush fucked around with this message at 20:27 on May 26, 2020

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«531 »