What are the recognised principles of avoiding 'noise' when using sensors

Ok...having got passed inconsistencies comparing two SICK datasheets for the NT6 optical sensor (greyscale) analogue output with success (I thought), I am focusing on it's digital output. This returns Vin as HIGH state and <1 Volt as LOW state.

Being new to all this, I was delighted to have figured out how to drop the voltage from around 11.7V to around 4.7V. But as I have problems, here is my divider wiring (using a cheap simple transformer as the power source):

The sensors analogue output (Vin to my divider) = 11.7V approx. which connects to...
10K Ohm Resistor which connects to...
6.9K Ohm Resistor which connects to...
0V which is the sensors' blue supply cable (this sensor is configured as PNP and is 'push-pull'. 'push-pull' means little to me)

Vout (4.7V approx.) was taken from between the two resistors.

Here's my problem: Using the 'DigitalReadSerial' verbatum (from the Examples >> 01 Basics folder) I can't get mush sense from the stream of 0's and 1's in the Serial Nonitor - it's as though there is a cycling of harmonics i.e. I'm seeing all 1's, then all 0's, then all 1's again - and so it continues to cycle - a bit AC like!. (it isn't affected by the sensor changing from HIGH to LOW at all)

My wiring is as follows:
Vout (4.7V approx.) goes to pin 2.
Pin 2 goes to Arduino GRD with 10k Ohm in series (pull down)

I've experimeted using the Arduinos GRD as the dividers Ground to no avail.

Please help if you can, thanks a lot.

using a cheap simple transformer as the power source

If you just have a transformer then the power source is AC. Are you sure it's just a transformer or is it a DC power supply?

Is the sensor responding to 50/60Hz lighting the room?

Vout (4.7V approx.) goes to pin 2.
Pin 2 goes to Arduino GRD with 10k Ohm in series (pull down)

If you are reading from the voltage divider you don't need a pull down resistor, and in fact it is parallel with your lower divider (the 6k9) resistor so will lower the voltage level considerably. Did you measure 4v7 with that pulldown in place?

You do have ALL grounds tied together?


Rob

Graynomad:
If you just have a transformer then the power source is AC. Are you sure it's just a transformer or is it a DC power supply?

I think (and very much hope) that it gives DC because it was 'borrowed' from an expensive spectrophotmeter. That said, It is a generic replacement for a supply that went west. I checked it before using it for this project and saw precious little information written on it - but increduality (and knowing that it succesfully charges the spectro's battery) led me to dismiss any worry.

Is the sensor responding to 50/60Hz lighting the room?

I doubt it, thinking the only possible effect in voltage (greyscale) would not be responsible for changing the logic from HIGH to LOW and vice versa.

If you are reading from the voltage divider you don't need a pull down resistor, and in fact it is parallel with your lower divider (the 6k9) resistor so will lower the voltage level considerably. Did you measure 4v7 with that pulldown in place?

Now that you point it out its as clear as day. I measured voltages here and there and do remember that sometimes, when I expected 4.7V approx, I didn't get it, getting close to zero, suspecting a short or wobbly connections on my cheese board. I also remember measuring around 2.5V at some point, but dismissed it because A) I couldn't understand it and B) I blamed wobbly components again. I did however disconnect the 10k pull-down for experimentation and measured 4.7V for sure. I think in this scenario the Serial Monitor showed all zeros consistently but don't remember seeing 1's (regardless of the the sensors' output logic state).

You do have ALL grounds tied together?

Yes as I understand it - but I fear not in practice. I think I've tried most or all combinations but I don't really know quite what distinctions to make. In a nut shell, and if I am indeed using a DC supply, can all 0V and grounds whether they be on the Ardiono, power supply or wired straight into a wall sockets Earth be treated equal? Obviously I would have to watch the current that any of the alterantives can carry, but...

Thanks Graynomad

UPDATE:
It now works (without my superfluous pull-down) and I can only assume that I had a wobbly connection. Thanks again Graynomad. My next chalenge is to work out how to choose a through-hole resister in Sparkdesign!

2Tricky:

Graynomad:
If you just have a transformer then the power source is AC. Are you sure it's just a transformer or is it a DC power supply?

I think (and very much hope) that it gives DC because it was 'borrowed' from an expensive spectrophotmeter. That said, It is a generic replacement for a supply that went west. I checked it before using it for this project and saw precious little information written on it - but increduality (and knowing that it succesfully charges the spectro's battery) led me to dismiss any worry.

I know you're issue was sloved, but for future reference the above is something that you should never have to wonder about. The vast majority of digital multimeters (DMMs), inlcuding many cheap ones, will have separate settings for AC voltage measurements. If you ever are unsure about if the output of a specific voltage adaptor is AC or DC set a DMM to AC voltage. If you get a reading of significant magnitude on the AC setting you know it's either supposed to be outputing AC or it's very broken.