how to emongLCD and emonTX produce a beep?

Hi, is there any project to integrate emonglcd or emontx for producing a beep when there are certain situations? for example, when consumption is too high?
thanks

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

there is someone else interested of this idea? is complex?

Robert Wall's picture

Re: how to emongLCD and emonTX produce a beep?

You could use a spare digital output on the emonTx to operate this buzzer (chosen for its low current & low voltage), but there are no spare outputs on the GLCD.  There are - at least on the GLCD V1.5 board, see below.

manicmoddin's picture

Re: how to emongLCD and emonTX produce a beep?

On the emonGLCD there is a spare digital IO and an Analog one also, these are on the JeePort connection.

The Digital is D8 and the Analog is A2. They should be fine and use the normal JeePort pinout.

Jimmy

Robert Wall's picture

Re: how to emongLCD and emonTX produce a beep?

It does indeed look as if you're right and I was wrong - I was quoting Glyn or Trystan from a reply a little while ago.

manicmoddin's picture

Re: how to emongLCD and emonTX produce a beep?

Ha-ha easily done, I only know as I built one the other week and what-not. Not sure if this is only from a new revision etc, mines the 1.5 revision of the board.
 

MartinR's picture

Re: how to emongLCD and emonTX produce a beep?

It does indeed look as if you're right and I was wrong

Well half right, ADC2 is used for switch S2 so no unused analogue pins.

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

thanks for the answers, so I'm forced to use only the digital output D8?

I am a newbie: how to modify the sketch of emonglcd to drive the suggested beeper using this digital output? 

please post me a simple example. thanks again!

mharizanov's picture

Re: how to emongLCD and emonTX produce a beep?

The piezzo buzzers are quite simple to drive, just set the D8 to HIGH and they will make a nasty, unbearable noise. I'd make short blips every now and then, not keep it on all the time because that would test wife's patience.

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

ok thanks, but can you write me a line to add to my sketch to do this? I'm newbie... thanks again

mharizanov's picture

Re: how to emongLCD and emonTX produce a beep?

This is a good start:

http://arduino.cc/en/Reference/digitalWrite

 

 

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

ok, so :

 

int D8Pin = 8;                 // LED connected to digital pin 13

void setup()
{
  pinMode(D8Pin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
...  

digitalWrite(D8Pin, HIGH);   

...
}

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

Hi, I come back to the question because I received last week an emonGLCD with a PCB  version 1.4 (I expected a newer 1.5);

I didn't solder the buzzer, I only tried to modify the sketch and I noted that when I write "pinMode(D8Pin, OUTPUT);" my green led didn't turn on anymore.

maybe only pcb 1.5 support digital 8 output?

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

oh my god I think I've find the problem:

http://openenergymonitor.org/emon/node/2063

Robert Wall's picture

Re: how to emongLCD and emonTX produce a beep?

pinMode(D8Pin, OUTPUT);

If you have copied it correctly, that sets the pin as an output pin. It does not actually set the output high or low. To do that, you need to use digitalWrite(pin, state). See here.

Unless you have removed the lines that set pins 6 & 9, the red and green LEDs should still work. Both versions of the PCB are identical in this respect.

Robert Wall's picture

Re: how to emongLCD and emonTX produce a beep?

Argh! You're right. Sorry, I'd forgotten that layout fault. It was mentioned in the build guide, I've added a few more words to that.

modenet's picture

Re: how to emongLCD and emonTX produce a beep?

no problem, I resolved as described in the post. now my buzzer is ready! thank you again for your usefull support!

Comment viewing options

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