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
how to emongLCD and emonTX produce a beep?
Submitted by modenet on Thu, 08/08/2013 - 16:20»
Re: how to emongLCD and emonTX produce a beep?
there is someone else interested of this idea? is complex?
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.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
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.
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.
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.
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!
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.
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
Re: how to emongLCD and emonTX produce a beep?
This is a good start:
http://arduino.cc/en/Reference/digitalWrite
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);
...
}
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?
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
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.
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.
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!