Poll

Would you routinely place a resistor in series with a jelly bean LED on an RPi 3.3V GPIO?

Yes
No
What's a resistor?
What's a datasheet?

Author Topic: Software guys, please, no.  (Read 10495 times)

0 Members and 1 Guest are viewing this topic.

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5247
  • Country: gb
Software guys, please, no.
« on: September 17, 2022, 11:36:22 pm »
This time, it's Dave's Garage. I like this channel, plenty of interesting stories, and I often learn a thing or two. But he is most definitely a software guy first and foremost.

Timestamp 3:10, hooking up a jelly bean LED directly to a Raspberry Pi GPIO deliberately without a resistor: deliberately because, well, it works for him, and he asks viewers to convince him otherwise.


 

Online coppice

  • Super Contributor
  • ***
  • Posts: 7458
  • Country: gb
Re: Software guys, please, no.
« Reply #1 on: September 18, 2022, 12:31:33 am »
Look on the bright side. If it wasn't for idiots, there'd be no merit in competence.
 
The following users thanked this post: David Aurora, amyk, srb1954

Offline John B

  • Frequent Contributor
  • **
  • Posts: 647
  • Country: au
  • Suspected ChatGPT Bot
Re: Software guys, please, no.
« Reply #2 on: September 18, 2022, 12:40:42 am »
No need to worry about burning out GPIO pins, since RPis are plentiful and easy to obtain at the moment.
 
The following users thanked this post: tom66, mikerj, AlbertL

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 5031
  • Country: fi
    • My home page and email address
Re: Software guys, please, no.
« Reply #3 on: September 18, 2022, 02:18:52 am »
But he is most definitely a software guy first and foremost. [...] well, it works for him, and he asks viewers to convince him otherwise.
Ah, a "coder".

You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".

Please do not confuse him with anyone who can actually develop useful software that works in a predictable fashion, okay?
 
The following users thanked this post: Someone, JPortici, AndyBeez

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 3692
  • Country: au
  • Cat video aficionado
Re: Software guys, please, no.
« Reply #4 on: September 18, 2022, 02:28:34 am »
I did see the video and fully expected a response after the omission of the resistor. Couldn't believe he couldn't at least have stuck something in there.

So what's your preferred value of resistor in this example?
iratus parum formica
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 369
  • Country: us
Re: Software guys, please, no.
« Reply #5 on: September 18, 2022, 02:46:48 am »
I haven't done through the details to see if it's ok to do what he did... but it might be ok. The GPIOs on a PI have a programmable drive strength from 2mA to 16mA. Basically you get to vary the number and size of the inverters driving the pin (which dictates Idss). The default "strength" is 8mA. Consider also that the LED voltage is 2V or so.
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 3692
  • Country: au
  • Cat video aficionado
Re: Software guys, please, no.
« Reply #6 on: September 18, 2022, 03:59:44 am »
But he is most definitely a software guy first and foremost. [...] well, it works for him, and he asks viewers to convince him otherwise.
Ah, a "coder".

You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".

Please do not confuse him with anyone who can actually develop useful software that works in a predictable fashion, okay?

The video appeared in my feed at stupid 'O clock, so the first thing I did was mis-read the title as hello Py. Interested only because I'm straight C, but Py curious.  :P

And when he started connecting up LEDs directly to pins, I began to wonder if I had had too much to smoke for the evening.

What baffles me is why not just make the SBC eat it's own dog food rather than bothering with all that remote building nonsense? FFS. For a blinky prog, just log in, start a text editor, compile and run.

Whilst sure, if you're building a kernel or designing a driver or something. But if that Pi project grows into something bigger and useful and then gets put into use somewhere, years later you might want to change a couple of lines of code, you have to setup that whole MS build env again and prolly need to figure out why bloody Code Studio wont work anymore..  |O

No hate on those who do like using the big IDEs for big code bases, everyday.

Just wish more emphasis was placed on keeping it simple for the hobbyist. You should make sure that you can recompile from a terminal.

The pointlessness of shoehorning bloody MS programs into everything.
iratus parum formica
 
The following users thanked this post: Zeyneb, pcprogrammer

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 2834
  • Country: us
Re: Software guys, please, no.
« Reply #7 on: September 18, 2022, 04:02:57 am »
So what's your preferred value of resistor in this example?

1K is a convenient value for modern LEDs at either 3.3V or 5V.
 
The following users thanked this post: Ed.Kloonk

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Software guys, please, no.
« Reply #8 on: September 18, 2022, 04:36:53 am »
Beware software weenies wielding screwdrivers or even worse, a soldering iron.
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 3692
  • Country: au
  • Cat video aficionado
Re: Software guys, please, no.
« Reply #9 on: September 18, 2022, 04:39:12 am »
Beware software weenies wielding screwdrivers or even worse, a soldering iron.

Do hobbyists use soldering irons anymore? Everything is breadboard and ribbon cables isn't it?

iratus parum formica
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3093
  • Country: nl
Re: Software guys, please, no.
« Reply #10 on: September 18, 2022, 05:09:20 am »
What a luck that I'm BI, otherwise I might take offense in this coder bashing :-DD

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3093
  • Country: nl
Re: Software guys, please, no.
« Reply #11 on: September 18, 2022, 05:11:05 am »
Beware software weenies wielding screwdrivers or even worse, a soldering iron.

Do hobbyists use soldering irons anymore? Everything is breadboard and ribbon cables isn't it?

If you want to make something that actually works you need a soldering iron. How often have I had something on a shitty breadboard not work properly :palm:

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3093
  • Country: nl
Re: Software guys, please, no.
« Reply #12 on: September 18, 2022, 05:21:11 am »
What baffles me is why not just make the SBC eat it's own dog food rather than bothering with all that remote building nonsense? FFS. For a blinky prog, just log in, start a text editor, compile and run.

Whilst sure, if you're building a kernel or designing a driver or something. But if that Pi project grows into something bigger and useful and then gets put into use somewhere, years later you might want to change a couple of lines of code, you have to setup that whole MS build env again and prolly need to figure out why bloody Code Studio wont work anymore..  |O

There is a benefit in working remote with an IDE on your main system and not the PI. Remote debugging is very easy when doing development.

I use netbeans 8.2 for basically all my coding and like it very much. The compiling is done on the PI, but the typing on the main PC. The source is copied when I press the compile button. This way it is easy to backup the source code too.

Having to use command line for compiling and debugging is tedious and not needed and luckily there are other solutions in the world besides microsoft shit.

Offline Brumby

  • Supporter
  • ****
  • Posts: 12057
  • Country: au
Re: Software guys, please, no.
« Reply #13 on: September 18, 2022, 05:33:17 am »
I was thinking of asking if they drive their car with the engine revving at the redline all the time?


Just because you may be able to get away with it doesn't mean it's a good idea.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 7946
Re: Software guys, please, no.
« Reply #14 on: September 18, 2022, 07:13:49 am »
If only Broadcom would've released the GPIO electrical specs... ::)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 17281
  • Country: gb
    • Having fun doing more, with less
Re: Software guys, please, no.
« Reply #15 on: September 18, 2022, 08:09:11 am »
Beware software weenies wielding screwdrivers or even worse, a soldering iron.

Do hobbyists use soldering irons anymore? Everything is breadboard and ribbon cables isn't it?

If you want to make something that actually works you need a soldering iron. How often have I had something on a shitty breadboard not work properly :palm:

Positive: solderless breadboards give you opportunity to hone your debugging skills.
Negative: skills at debugging solderless breadboards, not your circuits.

Solderless breadboards: just say no. Use the selection of these techniques that matches your requirements https://entertaininghacks.wordpress.com/2020/07/22/prototyping-circuits-easy-cheap-fast-reliable-techniques/
« Last Edit: September 18, 2022, 08:12:30 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: magic

Offline magic

  • Super Contributor
  • ***
  • Posts: 5525
  • Country: pl
Re: Software guys, please, no.
« Reply #16 on: September 18, 2022, 08:16:59 am »
I haven't done through the details to see if it's ok to do what he did... but it might be ok. The GPIOs on a PI have a programmable drive strength from 2mA to 16mA. Basically you get to vary the number and size of the inverters driving the pin (which dictates Idss). The default "strength" is 8mA. Consider also that the LED voltage is 2V or so.
Please stop muddying the water with those confusing acronyms.

YouTube told me that a MOSFET is a switch which is either ON or OFF; this cannot possibly work :box:
 
The following users thanked this post: WattsThat

Offline AndyBeez

  • Frequent Contributor
  • **
  • Posts: 464
  • Country: gb
Re: Software guys, please, no.
« Reply #17 on: September 18, 2022, 08:32:26 am »
One can shave half a cent by removing a series resistor in a 3V3 GPIO line, but I have never seen this done in the wild. Not even on the RPi. To drive (and dim) a naked LED requires 50% PWM maximum.
Do hobbyists use soldering irons anymore? Everything is breadboard and ribbon cables isn't it?
Hobbyists today not only have software to suffer, but dreaded SMDs. Soldering hell 101. PTH parts and breadboards go together, but at some point in the future, PTH parts will go out of production, and breadboards will only work in software. Hoard LEDs now.

...You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".
Which is why I gave up on open source development. Often some dumb Reddit bros with a Linux shell for social skills. Everyone can do the blinky example, on every embedded device thanks to VS Code and Platform.IO, but can they write a library with embedded assembler patches? This requires reading and understanding datasheets. Wot do the thinking :-//

 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3093
  • Country: nl
Re: Software guys, please, no.
« Reply #18 on: September 18, 2022, 08:36:58 am »
Solderless breadboards: just say no. Use the selection of these techniques that matches your requirements https://entertaininghacks.wordpress.com/2020/07/22/prototyping-circuits-easy-cheap-fast-reliable-techniques/

The only good use I have for the solderless ones is with modules like a blue pill or arduino nano and dupont style wires that make reasonable connections, but as soon as you start connecting other components like resistors or capacitors that are a bit older or have thin wires it gets wonky. And when you want to scope a signal on such a component it always flips out the hole. |O

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13215
  • Country: gb
    • Mike's Electric Stuff
Re: Software guys, please, no.
« Reply #19 on: September 18, 2022, 08:55:02 am »
For  a demo like this I think it's perfectly reasonable to omit the resistor for simplicity. Nothing will burn or catch fire. The LED and GPIO pin will limit the current enough.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: janoc, splin

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1713
  • Country: us
Re: Software guys, please, no.
« Reply #20 on: September 18, 2022, 09:17:13 am »
Ah, a "coder".

You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".

Please do not confuse him with anyone who can actually develop useful software that works in a predictable fashion, okay?
He made his bones writing code long before “the web” existed.
 
The following users thanked this post: SeanB, rsjsouza, tooki, newbrain

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 3692
  • Country: au
  • Cat video aficionado
Re: Software guys, please, no.
« Reply #21 on: September 18, 2022, 09:20:57 am »
Ah, a "coder".

You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".

Please do not confuse him with anyone who can actually develop useful software that works in a predictable fashion, okay?
He made his bones writing code long before “the web” existed.

MS stock made his bones, I suspect.
iratus parum formica
 

Online wraper

  • Supporter
  • ****
  • Posts: 15576
  • Country: lv
Re: Software guys, please, no.
« Reply #22 on: September 18, 2022, 09:47:55 am »
But he is most definitely a software guy first and foremost. [...] well, it works for him, and he asks viewers to convince him otherwise.
Ah, a "coder".

You know, the person who copy-pastes code off the web, until something compiles and passes through the minimal test.  In the open source world, the person who responds to bug reports with "it works on my machine, so I'm closing this bug report as invalid".

Please do not confuse him with anyone who can actually develop useful software that works in a predictable fashion, okay?
Just so you know. He wrote a significant part of Windows, a lot of his code like Task manager and disk formatter are still on your computer many years later.
 
The following users thanked this post: SeanB, janoc, rsjsouza, tooki, newbrain

Offline magic

  • Super Contributor
  • ***
  • Posts: 5525
  • Country: pl
Re: Software guys, please, no.
« Reply #23 on: September 18, 2022, 10:29:47 am »
Well, do not confuse Windows with useful software that works in a predictable fashion.

Or, dunno, don't confuse software with something useful that works in a predictable fashion if we are at that.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5247
  • Country: gb
Re: Software guys, please, no.
« Reply #24 on: September 18, 2022, 11:07:58 am »
FWIW, I took a measurement of 27mA for a red LED without a resistor on a GPIO.

The SoC GPIO current limits are for power limiting during transients, not for driving LEDs.

Yes, it works, most of the time. So does driving home drunk. Just because you can doesn't mean you should.
 
The following users thanked this post: AlbertL


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf