Posts

LG 2011 front loader washing machine buttons don't work: repair (Model wm2140cw)

Removable top
This 2011 washing machine has served us well thru one child's worth of cloth diapers. But while it still cleans, the front panel buttons have gotten somewhat less responsive (in particular the "play/pause" button which we use every single time, natch).

After I got the top off the hard part started
Unfortunately the front panel is somewhat time consuming to remove. You need to remove the top of the washer. To do this, you need to remove two screws from the back of the washer. These attach a pair of plastic standoffs to the top and body of the washer. You can leave the standoffs attached to the top. Then just push the top back, it should slide fairly freely. Then you can lift it off.

Now, getting the front panel off. This part was the tricky bit. Two screws from the front under the detergent door (green circles), and one from the back (red circle). But there are these three tabs (red circles) that also hold it on, which make the screws kind of unnecessary. I'm still unsure what exactly I did to make it all give way. MAYBE some upward prying, maybe some prying on the tabs themselves (one broke). Maybe it just had pity on me after I cut myself (or, could it be that blood sacrifice is required?).
Once you get here it's easy

Actually I'm sure it wasn't so bad. Just very annoying and at least 10 minutes of futzing. Now the rest is pretty obvious and in no time I'm looking and the circuit board.

The buttons are fairly standard; on ebay I found them under the title Tact Switch Push Button 6*6*5 6mm*6mm*5mm 2pin Through Hole SPST-NO.

Of course I didn't know that's what I was going to need ahead of time so rather than wait for them to be delivered from china I did my favorite repair "hack" and stole a less used button from the same panel (the signal volume) and swapped them (soldering iron required, of course). I actually swapped several, since the temp control button was also getting a little iffy.

For reassembly, I skipped the internal screw that hend the panel down. Seems secure enough without it, and it appears that I could  get the thing apart now without taking the top off.


Circuit board: what I actually wanted to work on


All the buttons seem to be pretty nicely attached to this removable plastic bit screwed to the panel. I didn't lose a single one. I didn't even try that hard. 



Raspberry Pi ADC (measure analog voltages) using ADS1115

The raspberry pi only has digital inputs. With a capacitor and careful timing you can use that to measure analog voltage, but not with any temporal accuracy. Here I'm using an addon board (using an ADS1115 chip) which can take 860 samples a second with up to 15 bits of resolution.

Steps:

(1) set up i2c bus to connect to ADC

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

(2) characteristics of ADS1115 discussed here

http://www.bristolwatch.com/rpi/ads1115.html

(3) This link describes the wiring in pretty good detail and suggests that it's better to power the chip using 3.3v not 5v.

https://leanpub.com/rpcanalog/read#leanpub-auto-analog-to-digital-conversion-adc

(4) The actual wiring I used (breadboard):

https://alantechreview.blogspot.com/2020/04/photodiode-wiring-example-and-resources.html

(5) and now on the pi with the ADS1115 hooked up (5v power). black tube contains a photodiode

100k resistor is hidden inside the blue tape under the ADC board.



Here's some C code, stolen and modified. 

#include
#include
#include
#include
#include     // read/write usleep
#include     // exit function
#include   // uint8_t, etc
#include // I2C bus definitions

#include

long long microsec() { // since epoc
    struct timespec spec;
    clock_gettime(CLOCK_REALTIME, &spec);
    return ((long long) spec.tv_sec *1000000LL) + (spec.tv_nsec / 1.0e3); // Convert nanoseconds to microseconds (1.0e6 would give milliseconds)
}

// Setup to use ADC0 single ended

int fd;
int asd_address = 0x48; // Note PCF8591 defaults to 0x48!
int16_t val;
uint8_t writeBuf[3];
uint8_t readBuf[2];
float myfloat;

const float VPS = 4.096 / 32768.0; // volts per step

/* Signal Handler for ^C */
void sigint_handler(int sig_num)
{
    printf("\n User provided signal handler for Ctrl+C \n");
  // power down ASD1115
  writeBuf[0] = 1;    // config register is 1
  writeBuf[1] = 0b11000011; // bit 15-8 0xC3 single shot on
  writeBuf[2] = 0b10000101; // bits 7-0  0x85
  if (write(fd, writeBuf, 3) != 3) {
    perror("Write to register 1");
    exit (1);
  }
    exit(0);
}

/*
The resolution of the ADC in single ended mode 
we have 15 bit rather than 16 bit resolution, 
the 16th bit being the sign of the differential 
reading.
*/

int readval()
 {

  if (read(fd, readBuf, 2) != 2)  // read conversion register
{
  perror("Read conversion");
  exit(-1);
    }
    return readBuf[0] << 8 | readBuf[1]; // could also multiply by 256 then add readBuf[1]
 }

int main() {

 signal(2, sigint_handler); // runs until ^c,  this allows ADC cleanup 

 nice(-20); // as high priority as possible

    // open device on /dev/i2c-1 
  if ((fd = open("/dev/i2c-1", O_RDWR)) < 0) {
    printf("Error: Couldn't open device! %d\n", fd);
    exit (1);
  }

  // connect to ADS1115 as i2c slave
  if (ioctl(fd, I2C_SLAVE, asd_address) < 0) {
    printf("Error: Couldn't find device on address!\n");
    exit (1);
  }

  // set config register and start conversion
  // AIN0 and GND, 4.096v, 128s/s
  // Refer to page 19 area of spec sheet
  writeBuf[0] = 1; // config register is 1
//                76543210 
  writeBuf[1] = 0b11000010; //  continuous, ANC0,  amp gain 
  // bit 7 flag bit for single shot not used here
  // Bits 6-4 input selection:
  // 100 ANC0; 101 ANC1; 110 ANC2; 111 ANC3
  // Bits (3-1) Amp gain. Defaults to 010, here we use 001, see P.19
  // Bit 0 Operational mode of the ADS1115.
  // 0 : Continuous conversion mode
  // 1 : Power-down single-shot mode (default)
                //76543210
  writeBuf[2] = 0b11100101; // bits 7-0  0x85
  // Bits 7-5 data rate default to 100 for 128SPS. 0=8, 111=860
  // Bits 4-0  comparator functions see spec sheet.

  // begin conversion
  if (write(fd, writeBuf, 3) != 3) {
    perror("Write to register 1");
    exit (1);
  }

  sleep(1);


  // set pointer to 0
  readBuf[0] = 0;
  if (write(fd, readBuf, 1) != 1) {
    perror("Write register select");
    exit(-1);
  }
  
long long t;
int count = 0;

int buf[100];
float delta[100];
t = microsec();
while (count < 100)
  {
  buf[count] = readval();
  delta[count]= (microsec()-t)/1000.0;
  count++;
  }
for (int i = 0; i < 100; i++)
  {
  printf("Raw %i \t@ %3.3fms \t volts: %3.3f\n",buf[i], delta[i], buf[i]*VPS );
  } // end while loop

  close(fd);

  return 0;
}


changing raspberry pi zero i2c baud rate: what actually works

The syntax is fragile; an extra space breaks it, so just copy and paste into /boot/config.txt.

#100kbps, slow, default
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=100000

#400kbs, "fast"
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=400000

#1.2mbs, "high speed"
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=1200000


You may see elsewhere that you can check the baudrate with these commands, but they don't work for me:

cat /sys/module/i2c_bcm2708/parameters/baudrate
cat /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency

While you cannot verify the baudrate setting directly, you can time how quickly data can be read from /dev/i2c-1. I can read 100 bytes in 7ms at 1.2mbs "high speed" talking to an ADS1115 adc (note: it's sample rate is lower than that, but the currently digitized value can be read that fast).

Starcraft 2 installer stuck on "Downloading new files": fix!

Installing starcraft 2 just wasn't going anywhere: it was stuck on Downloading new files no matter how long I waited.

The logs suggested an infinite timeout (C:\ProgramData\Battle.net\Setup\s2_2\Logs):

E 2020-04-22 21:01:34.815206 [Main] {3f30} Downloader - {3f30} ERR (d:\buildserver\bna-2\work-git\bootstrapper-repository\contrib\contrib\bnl_dl2\fetcher\source\fetcher\httpfetcherimpl.cpp, line 392): HTTP: connection failed for host 137.221.106.19:1119: NET_CANCELED

The solution: somehow my spectrum-supplied router had gotten the firewall enabled, even though I had turned off the Windows 10 firewall long ago. THANKS SPECTRUM (/TWC). Setting the router firewall to "low" (allow all traffic) fixed the problem instantly.





Photodiode wiring example and resources

Being fairly new to circuit design I had to collect several resources to help me get started wiring a photodiode to a raspberry pi.  I used a so-called reverse bias configuration, where the shorter of the two pins on the photodiode is driven by +5v, and then voltage across a 100k resistor in series after the photodiode is the measurement point. Zero light gave millivolts, and the "flashlight" from my phone gave nearly 5V. An ADC is required to read the voltage with any precision, to get started I just used a voltmeter.

This is perhaps the most useful circuit diagram.

This was also helpful.

Which pin is which on the photodiode?

A nice affordable photodiode from my favorite electronic component store.


Adventures of the quarantined repairman: the kitchen scale fix (WH-B05)

New button, old plastic
This scale has been with us for 10 years and while it still measures accurately, it fails in another key function: turning on. The power switch takes more and more aggressive pushing to bring it to life. I found that an identical scale could be purchased from ebay for about $4, and my time is worth something so I got it. Unfortunately, the identical scale wasn't.

Same appearance, same model number, but different behavior: significant lag between changing the weight and changing the display. I'm guessing they decided that the occasional noise on the least significant digit was too annoying. It was "better" to use a noise rejection algorithm that prevents the display update until the new measurement has been significantly different from the old one for several seconds. Unfortunately this means that using the scale to measure something like flour or water (yes, I'm making bread) is an exercise in frustration. When you finally get 300g of water poured into the beaker, you find out 2 seconds later that it's really 330g of water. Ugh.

So, time to fix the old scale. Simple, hopefully. I've got two "identical" scales, perhaps I can reuse the new button on the old scale? No luck. It's nothing like "identical" inside, though there are enough conserved design features that I suspect the new one was evolved from the old one.

Solution 2: add a new button. Problem is getting exactly the same button as the old one is required if it's going to fit and work. So I used a random button from some old junk, and attached it on the outside of the case, running wires to the critical point in the circuit that need to be shorted to turn it on.
Cue the pictures. I got a new button from an old car cassette player. The buttons were surface mounted, and at first I tried to desolder them. Ouch, 4 points of contact and no space under the button makes this very tricky. Solution: cut the switch off with some of the circuit board still attached. Gives me more surface to glue to. 

Now I can solder two wires to the circuit board, and bend them under and hot glue the mess into a relatively monolithic blob on the side of the scale. Two holes in the scale allow for the wires to get inside. Then it was relatively simple to wire them to the pcboard: it had test points for gnd and p1 (the switch, apparently).

Source of my "new" button
The end result is not pretty. But it works nicely. Better than original, since the switch I used is from a high quality SONY tape deck. And you thought cassettes were dead!

plenty of space inside to run the wires



Counterfeit PS1 Memory cards or Genuine?

I have two PSOne (in color scheme at last) memory cards that didn't work, so I took them apart to see if there was anything obviously wrong. There wasn't. But I was quite surprised how different they looked on the inside. 

One had a big SONY emblazoned on the flash chip itself, the other had no mention of Sony anywhere. The PC boards certainly looked like different kinds of layouts, different pcboard dye, etc, and one was taller than the other. Since both were dead I can't speculate about the "crappy" counterfeit quality. 

Certainly I expect Sony made several iterations of their 128KB memory cards over the many years the PS1 was sold, but since these are both PSOne colored I assume them to be from that relatively short era at the end of the life cycle of the PSX.

PS: the PSone was named in contrast to the PS2, and was a smaller but genuine full-fledged PS1 console made by Sony and sold concurrently with the PS2. Sometimes it's called the PS1mini, creating confusion today since it's entirely different than the ARM based emulator sold a decade(plus) later to retro enthusiasts who didn't know better.

So what do you think? Do I have One, Two(!) or zero counterfeit memory cards?

Email me

Name

Email *

Message *