Go Down

Topic: Use voltage as input? (Read 398 times) previous topic - next topic

XOIIO

I was wondering, how can I use voltage to trigger something? I want to add something to an alarm clock, that goes off whenever the piezo buzzes. How would I accomplish this?

retrolefty


I was wondering, how can I use voltage to trigger something? I want to add something to an alarm clock, that goes off whenever the piezo buzzes. How would I accomplish this?


Well a piezo buzzing creates a audio sound output not a voltage output. So is your question how to have a audio sound turn something on or off?

Lefty

XOIIO

I basically just want the arduino to "see" that the buzzer should be on, and have a variable assigned to that

retrolefty


I basically just want the arduino to "see" that the buzzer should be on, and have a variable assigned to that


"See' implies light input? If you need to detect that the buzzer is sounding off it would most likely require a microphone used as a sound detector and suitable circuitry to convert it to a on/off signal for the arduino. Should be lots of example around if you search.

Lefty

DVDdoug

Yes, you can probably wire the piezo circuit to the Arduino.   You need to know the piezo voltage, and if the clock plugs-into wall-power it's really important that the internal circuitry in the alarm clock is totally isolated from the AC line voltage.

Quote
Use voltage as input?
That's exactly how digital electronics works!   With the Arduino's 5V logic, 5V is read as 'HIGH" or "1", and zero volts is read as "LOW" or "0".    (It doesn't have to be exactly 5V and zero volts... You can check the chip specs if you want the details.)

Besides the signal connection, you'll need a common ground between the clock and the Arduino.  And, you can't put more than 5V into the Arduino without (potentially) damaging it.   So, if there is more than 5V on the piezo, you'll need a voltage divider (two resistors).

And/or since you may not know what you are connecting to it, you might want to add a resistor and a couple of protection diodes to block any negative voltages, or voltages greater than 5V from hitting the Arduino.

The signal to the piezo won't be constant DC.  It will be a pulse, but that's OK.  You just need to detect something that's not zero.   Hopefully, it's near zero volts when off.

XOIIO


Yes, you can probably wire the piezo circuit to the Arduino.   You need to know the piezo voltage, and if the clock plugs-into wall-power it's really important that the internal circuitry in the alarm clock is totally isolated from the AC line voltage.

Quote
Use voltage as input?
That's exactly how digital electronics works!   With the Arduino's 5V logic, 5V is read as 'HIGH" or "1", and zero volts is read as "LOW" or "0".    (It doesn't have to be exactly 5V and zero volts... You can check the chip specs if you want the details.)

Besides the signal connection, you'll need a common ground between the clock and the Arduino.  And, you can't put more than 5V into the Arduino without (potentially) damaging it.   So, if there is more than 5V on the piezo, you'll need a voltage divider (two resistors).

And/or since you may not know what you are connecting to it, you might want to add a resistor and a couple of protection diodes to block any negative voltages, or voltages greater than 5V from hitting the Arduino.

The signal to the piezo won't be constant DC.  It will be a pulse, but that's OK.  You just need to detect something that's not zero.   Hopefully, it's near zero volts when off.


That's exactly what I want to do, I was wondering how I can do this without a common ground though, I'm going to use a 7805 right after the transformer to drop whatever voltageit is putting out to 5 volts, and power the arduino with that (well, really an attiny85 but same thing basically), or would it still be common ground all the way at the piezo?

groundfungus

you could use an optoisolator with the led wired accross the piezo and the transistor to the arduino.  You need a separate power supply for the arduino but it will be totally isolated from 110.

Go Up