how use 230 mV input with digital pin

Hi, I am currently trying to use a 230mV source with a digital pin on the arduino. From a previous question, I have started by using an opto coupler (4N35) to seperate the source from the arduino, with the gnd of the arduino connected with the gnd from the source. At the moment I am just trying to get the cicuit to work, using PWM output from an arduino pin to represent the 230mV source.


I have been able to get a LED to blink, using the PWM through the opto copuler and an additional power source, but unable to get the digialRead to detect the changes in the state unless I increase the PWM to analougeWrite(9,100);. I have very little knowledge in electronics. I thought, that it may be possible to use a transistor to act as a switch, but I'm not sure.

Any help would be great Thanks Jason


Well, you spell it "analogWrite", and it doesn't take floating-point parameters.

Can you give more detail of what you have and what you're trying to achieve?

Unless you low-pass filter the PWM output, all you'll get is a fairly rapid full-on and full-off.

We need some more info, are you trying to detect a 230mv as a "HIGH" state? or is it the output from the optocoupler? please post some kind of schematic or wiring diagram.

jas007: I have started by using an opto coupler (4N35) to seperate the source from the arduino, with the gnd of the arduino connected with the gnd from the source.

Using an optocoupler, you don't need to connect ground.


You would need to provide us with more information of the characteristics of your '230mV' signal. Is this a digital signal that can have only two values, 0vdc and +.230vdc ? Or is a slowly changing analog voltage that can vary between o and + .230vdc, or is it an AC signal that can vary +.230 to -.230vdc?

Only with this information can proper signal conditioning be determined to allow the arduino to read it as a logic level signal.


Sorry for the typos and the lack of information. I am trying to interface an arduino with a stream height flow meter. The flow meter is designed to be connected with a water sampler. The flow meter uses a 230mV output to communicate the condition of the stream with the water sampler. The output from the flow meter is either 230mV or 0 volts DC. I would like to connect this to the arduino and be able to determine when it is at HIGH (230mV) and LOW (0 volts). I believe that this could be done with one of the analog pins, but i am woried about noise, and false detection from the arduino. Am I worrying about nothing, and is this the best approach.

My earlier post, I was trying to replicate the 230mV output using the PWM function of the arduino with the following setup and detect the state with another digital pin.

No resistor on the led input to the opto? That can result in a damaged arduino digital output pin.


230mV will not work through an opto so there's little point experimenting with one. The LED will need a lot more than that to fire.

You can run the signal directly into an analog pin or buffer/amplify it with an opamp.

I gather this is a flow "detector" not a meter or is it supplying a pulse train that is proportional to the flow?


Hi Rob,
Thanks for the tip with the opamp, I will have a look at this. The ouput is conditional on the flow height, pre programmed into the flow meter, therefore it is either on or off.