Analog to Digital question.

Hi,

I'm pretty much a newbie in this area but trying to come up to speed with building simple sensor circuits and interfacing them with Arduino. My latest project is to hook up a remote control to a digital input pin. I purchased a really cheap remote door chime set, and removed the speaker, using the cables to drive a small transistor. Across the Collector-Emitter I have +5V and by connecting a 1M resistor between the +rail and the Collector, I can sample the voltage which I was hoping to use to drive the Arduino digital input.

When the door bell is activated, I get a voltage of about 4.8V, however the problem I am having is that when the door bell is not activated, there is still a small voltage (0.4v) present at the Collector.

Despite what I have read in the Arduino documentation, this appears to be sufficient to drive the Digital input to a HIGH state. I was hoping that anything under say, 1 Volt would give a LOW reading but this does not seem to be the case. The only way I have managed to drive the pin LOW is to connect it to Gnd.

I should perhaps point out that the board I am using at the moment is a Bare Bones Board, not that it should matter.

Has anyone else seen this behaviour? Or better still, can someone suggest a way of 'getting rid' of that unwanted 0.4V and ensuring that when the door bell is not activated, the collector shows 0V?

Thanks for any help.

Mike

Well I played around with a voltage comparator for a while but didn't get the results I expected. FYI, what I did was to wire the input from the chime into Input_1 and use a simple voltage divider to feed about 2.5V into Input_2. I was then hoping that the output from the comparator would be set to 0 until Input_1 rose above the Input_2 threshold. Unfortunately that didn't happen, so either I've misunderstood how the comparator works, or I've got a misfunctioning component. I suspect the former!!

Anyhow, I've solved the problem with a really simple hack. I just 'sank' the unwanted 0.4V by connecting a large resistor between the sensor output and Gnd. This now gives a residual voltage of about 80 mV which is not sufficient to set the Arduino digital input HIGH.

If anyone has any advice on whether or not the comparator was the right approach (and I just miswired it) then I'd appreciate the feedback. FYI it was an LM311 I was using.

Cheers,
Mike