Author Topic: what's your recent fail?  (Read 9386 times)

0 Members and 1 Guest are viewing this topic.

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3229
  • Country: be
    • Freelance Hardware Engineer
Re: what's your recent fail?
« Reply #25 on: April 24, 2021, 09:08:45 am »
Yeah, well, I briefly saw something about temperature on the display and that was all she wrote.
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23099
  • Country: gb
Re: what's your recent fail?
« Reply #26 on: April 24, 2021, 09:11:17 am »
RIP  :-BROKE
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: what's your recent fail?
« Reply #27 on: April 24, 2021, 09:43:30 am »
Needed a 1kV signal so hooked up my bench DMM to the source to tune it. Turned on the source.

...

The source goes up to 2kV and that was exactly what it was still set to. Hint: the bench DMM goes up to 1kV.
I hoped you were going to tell us that the probe wires have a 500v loss across each one.
iratus parum formica
 

Offline exeTopic starter

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
Re: what's your recent fail?
« Reply #28 on: April 24, 2021, 05:43:42 pm »
Hint: the bench DMM goes up to 1kV.

What was the model of DMM?
 

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3229
  • Country: be
    • Freelance Hardware Engineer
Re: what's your recent fail?
« Reply #29 on: April 24, 2021, 05:50:55 pm »
Rigol DM3058E
 

Offline exeTopic starter

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
Re: what's your recent fail?
« Reply #30 on: April 27, 2021, 09:37:09 am »
Oh boy, I think I bought lt1468-2 instead of lt1468. No wonder my circuit oscillated.

I found that lt1468 and lt1468-2 are confused in many places, including in the part's datasheet and ltspice. I reported errors to analog.com and mouser, will see if they fix them.
 

Offline Gribo

  • Frequent Contributor
  • **
  • Posts: 649
  • Country: ca
Re: what's your recent fail?
« Reply #31 on: April 28, 2021, 08:09:25 pm »
Connected the /wr line of AD8251 to the positive rail instead of the negative  |O
I am available for freelance work.
 

Offline galvanix

  • Contributor
  • Posts: 38
  • Country: de
Re: what's your recent fail?
« Reply #32 on: April 29, 2021, 02:18:54 pm »
My recent fail is thinking the global chip shortage isn't going to affect my small hobby project for some reason. I designed the PCB on the weekend and spec'd all the parts.
Got the message that the PCBs were shipped to day.
When ordering parts I find out that my chosen chip (TPS65253-5) is out of stock everywhere with 35 week lead time. :palm:

Well, at least I don't have to pay the import duties on the PCBs when I get a letter from the customs office. ;D
 

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 788
  • Country: us
Re: what's your recent fail?
« Reply #33 on: April 29, 2021, 03:01:05 pm »
FWIW, TPS65253RHDR DigiKey has 4300 pieces in stock.

I’m putting in an order tomorrow. Can post them in a padded bag to Germany for cheap if it’s just a couple of pieces.
 

Offline exeTopic starter

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
Re: what's your recent fail?
« Reply #34 on: April 29, 2021, 03:19:38 pm »
When ordering parts I find out that my chosen chip (TPS65253-5) is out of stock everywhere with 35 week lead time. :palm:

Huh, I feel you here. I couldn't find opa2192 anywhere. Guess what, it showed up (but in weird qty of 24) in Mouser two days after I placed the order. It's so strange to see shortage on opamps, but it's not the first time. I found reports from 2018 that it was hard to get it. So, I'll try to substitute it for now.
 

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3229
  • Country: be
    • Freelance Hardware Engineer
Re: what's your recent fail?
« Reply #35 on: April 29, 2021, 03:25:13 pm »
...(but in weird qty of 24)...

Tube?
 

Offline galvanix

  • Contributor
  • Posts: 38
  • Country: de
Re: what's your recent fail?
« Reply #36 on: April 29, 2021, 04:57:32 pm »
FWIW, TPS65253RHDR DigiKey has 4300 pieces in stock.

I’m putting in an order tomorrow. Can post them in a padded bag to Germany for cheap if it’s just a couple of pieces.

Thanks for the offer, but I actually had a typo in the part number. I was looking for a TPS652353 which is a voltage regulator specifically designed for universal LNBs. I wanted to make my own LNB bias tee for receiving the QO-100 amateur radio satellite using off-the-shelf universal LNBs.
 

Offline josh132

  • Contributor
  • Posts: 37
  • Country: us
  • OSCILLOSCOPE
Re: what's your recent fail?
« Reply #37 on: April 30, 2021, 12:58:17 am »
cap in reverse polarity.
bu du bu nu
 

Offline AndrewNorman

  • Contributor
  • Posts: 21
  • Country: au
Re: what's your recent fail?
« Reply #38 on: April 30, 2021, 08:47:49 am »
Getting 5V and 12V power supply outputs mixed up when playing with a LED/resistor pair to test brightness.

One very bright followed by one very dead LED later.
 

Offline mindcrime

  • Supporter
  • ****
  • Posts: 396
  • Country: us
Re: what's your recent fail?
« Reply #39 on: April 30, 2021, 01:51:45 pm »
As part of this reflow oven project, I bought an Adafruit MAX38556 breakout board for reading temperatures from a thermocouple. Last night I broke that out, soldered the headers on, and jumpered it to an Arduino and loaded the sample sketch. And BOOM, I got temperatures.

In Celsius.

I live in the USA. To us, Celsius barely exists... it's some weird abomination that's used by people from weird places like the UK, Europe, Australia, etc. So of course being the flag-waving nationalist that I am, I just had to convert the temperature to good ole Fahrenheit. So I wrote code that looked something like this:

Code: [Select]
Serial.println( ( maxtemp.readCurrentTemperature() * (9/5) ) + 32);

And none of the numbers that got displayed looked right. The thermocouple was apparently reporting the ambient temperature in the room as off by about 10°. Moving the thermocouple tip close to a lightbuib had the effect of sending the numbers higher, but still off by quite a bit.

Does everybody see my mistake? It's subtle in a sense, but very obvious in another sense.


.


.



.



.



.


.



.



.


.


.


.


.



.


.



.


.


The problem is integer division. Dividing an integer by an integer (9/5) yields an integer (1). To get the expected value there [1.8] I had to either make one (or both) of those literals a float, or cast one of them to float during the calculation. The easy fix was just to change that expression to (9.0/5.0). D'oh.


And of course I'm just kidding about the nationalist bit. But an (unfortunate?) side effect of having lived in the USA my whole life, is that using Fahrenheit does, indeed, come much more naturally to me. So when it comes to recognizing something like, say, the ambient temperature in the room, I can only really process something like that in F° without jumping through hoops to do conversions.

When implementing the reflow oven, I expect all the temperature stuff will be done in C° as that's probably how the solder paste manufacturer specifies their temperature profile.
« Last Edit: April 30, 2021, 01:53:33 pm by mindcrime »
 

Offline RichC

  • Contributor
  • Posts: 14
  • Country: gb
Re: what's your recent fail?
« Reply #40 on: April 30, 2021, 04:12:08 pm »
Laid out my board, got it made up (luckily a DIY job on the CNC not a fab) and mounted everything on it. It didn't work. Checked things over. I had swapped drain and source on a mosfet.  :palm:
I can't even easily fix it because it's half of a single package pair so it would mean swapping pin 2 to pin 4 (on a 6 pin package). Guess I'm making a new PCB for that one.
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2187
  • Country: au
Re: what's your recent fail?
« Reply #41 on: April 30, 2021, 11:08:06 pm »
Laid out my board, got it made up (luckily a DIY job on the CNC not a fab) and mounted everything on it. It didn't work. Checked things over. I had swapped drain and source on a mosfet.  :palm:
I can't even easily fix it because it's half of a single package pair so it would mean swapping pin 2 to pin 4 (on a 6 pin package). Guess I'm making a new PCB for that one.
Dead bug the IC, small bare wire and steady hands might let you test the rest of the board until your re-spin arrives
Never mind, you're cncing the pcb
 

Offline exeTopic starter

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
Re: what's your recent fail?
« Reply #42 on: May 01, 2021, 07:48:54 am »
I live in the USA. To us, Celsius barely exists... it's some weird abomination that's used by people from weird places like the UK, Europe, Australia, etc.

I can imagine how weird it is to use a "wrong" scale. When I was in the UK they measured my weight in ... stone. What is that, a measure system from the stone edge? (kidding).

I had swapped drain and source on a mosfet.  :palm:

Ouch, that must be painful  :'(
 

Offline harerod

  • Frequent Contributor
  • **
  • Posts: 483
  • Country: de
  • ee - digital & analog
    • My services:
Re: what's your recent fail?
« Reply #43 on: May 01, 2021, 03:32:32 pm »
mindcrime, if you don't mind a suggestion from an old German guy who went to uni in Konrad-Zuse-Strasse:
No need for float, if you can make sure that your integer accumulator is large enough.
Make sure to tell your MCU in which order to process the numbers. If you don't trust brackets and precedence, do:

int16_t accu; // (adequate till 2^15 / 9 )
accu = maxtemp.readCurrentTemperature();
accu *= 9;
accu /= 5;
accu += 32;
Serial.println( accu );

or:

Serial.println( (int)(( maxtemp.readCurrentTemperature() * (9./5) ) + 32));
 
The following users thanked this post: Ed.Kloonk, mindcrime

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: what's your recent fail?
« Reply #44 on: May 01, 2021, 07:30:45 pm »
You can even take the remainder (from the division) and, if it's 3 or 4, add 1 to the result to get correct rounding.

Or uh... add 2 before the division, I suppose.

Or to maintain accuracy, multiply by say 16 (or << 4), to get 12.4 fixed point -- this shift has to be un-done for printing, so it may be a bit inconvenient, or the 62mK resolution may simply be unnecessary.

That is:

Code: [Select]
accu = readCurrentTemperature() * 9;
accu <<= 4;
accu /= 5;
accu += 32 << 4;
printf("%d", accu >> 4);
printf(".%03d\n", ((accu & 0x0f) * 125) >> 1);

Or if you want to write out the print routine yourself, take the fractional part (accu & 0x0f), multiply by 10 to get a new digit above the decimal, print the digit, mask it off, and repeat:

Code: [Select]
for (...) {
frac = frac * 10;
printf("%d", (frac & 0xf0) >> 4);
}

Only a few digits are needed, since 4 bits of fraction = (0..15) / 16, which by itself doesn't fit into 1 digit (but the fifth in the present problem handily does), does easily fit into 2 digits (100ths), and terminates after 4 digits (0.0625000, etc.).

This is, in part, how you work with fixed point numbers.  Once you get a feel for them, it's not much harder to work with than floats in most problems, and goes much faster on most embedded platforms. :-+


I can report my own partial fail in this regard, as I had a recent problem with just too much dynamic range in play to handle easily even in 32 bit fixed point; as I couldn't justify spending time figuring it out, I fell back on floating point, which actually only added about 2kB to the binary, and my MCU had plenty of cycles to spare for the operation.  (This was math in the complex domain, a bit weightier than whole numbers -- that's already 64 bits per complex number.  Doing it with [32 bit] floats, takes up as much memory, but I don't have to pay any attention at all to dynamic range and shifting -- that's really what it's about, a "floating point" is literally just doing that every time.)

Tim
« Last Edit: May 01, 2021, 07:35:44 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Ed.Kloonk

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1478
  • Country: ua
Re: what's your recent fail?
« Reply #45 on: May 01, 2021, 09:40:57 pm »
or:
Serial.println( (int)(( maxtemp.readCurrentTemperature() * (9./5) ) + 32));
Why not this (I'm not C, C++ developer):
Serial.println((int)(( (maxtemp.readCurrentTemperature() * 9)/5 ) + 32)); ?
« Last Edit: May 05, 2021, 12:40:34 pm by Vovk_Z »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28429
  • Country: nl
    • NCT Developments
Re: what's your recent fail?
« Reply #46 on: May 01, 2021, 10:13:59 pm »
This is, in part, how you work with fixed point numbers.  Once you get a feel for them, it's not much harder to work with than floats in most problems, and goes much faster on most embedded platforms. :-+
A more natural way is to use a unit which has enough resolution by itself. Like milli-Fahrenheit in this case. It is a good practise to always use clear SI units in software.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: what's your recent fail?
« Reply #47 on: May 01, 2021, 10:56:37 pm »
I avoid units where possible, as numbers are just that: numbers, dimensionless and arbitrary.

For example, an ADC reading isn't any particular voltage or current or whatever: it's some ratio to whatever VREF was at that instant.  If VREF is very well known, it also corresponds to a meaningful (calibrated) value, but it's not necessary to track it as such.  And with the ADC reading being scaled to a power of 2, you're only going to lose dynamic range by using different units in software.  Most applications do eventually need to record or display units, but that can be done entirely at the end: a gain factor (and offset if applicable) before printing and you're set.

(So yes, I find those special-value references a bit amusing.  2.048V, 4.096V, who cares? ;D )

(I will add, this is particularly useful for core operations, heavy on numeric analysis and independent of application.  At higher levels -- especially if floats are heavily involved -- using units is probably a good idea.  Scientific computation for example.)

Tim
« Last Edit: May 01, 2021, 10:58:12 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28429
  • Country: nl
    • NCT Developments
Re: what's your recent fail?
« Reply #48 on: May 01, 2021, 11:10:32 pm »
I avoid units where possible, as numbers are just that: numbers, dimensionless and arbitrary.

For example, an ADC reading isn't any particular voltage or current or whatever: it's some ratio to whatever VREF was at that instant.  If VREF is very well known, it also corresponds to a meaningful (calibrated) value, but it's not necessary to track it as such.  And with the ADC reading being scaled to a power of 2, you're only going to lose dynamic range by using different units in software.  Most applications do eventually need to record or display units, but that can be done entirely at the end: a gain factor (and offset if applicable) before printing and you're set.
In theory yes, but software is much easier to maintain if the next person doesn't need to figure by what odd value a variable is scaled. When I read a value from an ADC I always convert it to Volts. That the reading is accurate to the extend of the quality of the reference should go without saying. Trouble shooting is much easier when the firmware says it is reading 3.22 Volts and the DMM connected to the input of the circuit says the same.
« Last Edit: May 01, 2021, 11:12:05 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: what's your recent fail?
« Reply #49 on: May 02, 2021, 07:18:13 pm »
while I decided whether to refurbish it

I guess the decision has been made :)

If it was only that simple.  After several days of randomly changing various things with no positive result, I was inspired to leave it powered up, and after several more days it POSTed.  Now it reliably POSTs, so far.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf