emonGLCD v1.3 buttons fixable by direct wiring?

As I understand from the post http://openenergymonitor.blogspot.com/2012/02/emonglcd-v13-pcb.html a PCB error makes the buttons non-functional. However could I rewire across the PCB to reinstate the buttons and if so, from where to where?

I assume that after installing the LCD rewiring will be next to impossible. So at step 20 of the build process, it is  now of never.

glyn.hudson's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Post deleted by the author - the buttons can be made to work by an easy software fix! More details soon. See https://github.com/openenergymonitor/EmonGLCD/tree/master/emonGLCD_tester for details of the fix

Lloyd's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Can someone advise me of the source and part number for the switches that would fit the pcb. Not sure if I want to use them yet, but I'd rather be prepared.

Thanks

Lloyd

glyn.hudson's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Rapid electronics part no. 78-1154

Drsdre's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

I've tried the rewiring from 3.3V to the S1 to S3 pins going to the Atmel, however I realized quickly that this would not work as all pins would now be connected together and no inidividual button press would be registered.

So I've decided to try a different approach. I've found a Arduino setting that allows to do a software 20k internal pullup on analoge ports. And this is working! So it looks like all three buttons can be made operational on the v1.3 board.

I have an updated emonGLCD_tester.ino script if you are interested.

Code:

const int enterswitchpin=A1;        // ADC pin of enter switch

const int upswitchpin=A2;           // ADC pin of up switch

const int downswitchpin=A5;         // ADC pin of down switch

void setup () {

    Serial.begin(9600);

    Serial.println("emonGLCD demo");

    Serial.println("openenergymonitor.org");

 

    // Setup switch with 20k internal pullup

    pinMode(enterswitchpin, INPUT);

    digitalWrite((14+enterswitchpin), HIGH);

    pinMode(upswitchpin, INPUT);

    digitalWrite((14+upswitchpin), HIGH);

    pinMode(downswitchpin, INPUT);

    digitalWrite((14+downswitchpin), HIGH);

}

 

void loop () {

  if (analogRead(enterswitchpin)<10) {

    glcd.drawString_P(64,  50, PSTR("enter sw"));

    Serial.print("enterswitchpin: "); Serial.print(analogRead(enterswitchpin)); Serial.println(" ");

  }

  if (analogRead(upswitchpin)<10) {

    glcd.drawString_P(64,  50, PSTR("up sw"));

    Serial.print("upswitchpin: "); Serial.print(analogRead(upswitchpin)); Serial.println(" ");

  }

  if (analogRead(downswitchpin)<10) { 

    glcd.drawString_P(64,  50, PSTR("down sw"));

    Serial.print("downswitchpin: "); Serial.print(analogRead(downswitchpin)); Serial.println(" ");

}

         
Drsdre's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Hmm, although the emonGLCD test sketch worked flawlessly, applying it to the emonGLCD_SolarPV sketch is giving a constant 0 on all buttons. Could it be that one of the libraries for temperature or RF is changing the analogue ports setup?

 

glyn.hudson's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Thanks a lot Drsdre, this is fantastic. I will test out the sketch when I'm in the lab tomorrow. Try setting the analog ports 1,2 and 5 as input. 

bramper's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

If I understand this, I can solder any button (with two pins) by connecting one pin to the upper hole of S1 on the PCB and the second pin to the 3V (just abouve the text WIRELESS graphical LCD display) on the PCB??

and do the same for S2 and S3 ??

glyn.hudson's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

I've had a change to test this and it works! Enabling the internal pull up resistors allows he switches to work with no hardware modifications. I've updated the emonGLCD tester sketch with the require code: https://github.com/openenergymonitor/EmonGLCD/tree/master/emonGLCD_tester

We will be making the switches available free through the shop next week to everyone who has bought an emonGLCD.. 

Thanks to Drsdre for the fix! Isn't it lovely when software fixes hardware mistakes! 

glyn.hudson's picture

Re: emonGLCD v1.3 buttons fixable by direct wiring?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.