Show Posts
Pages: 1 [2] 3
16  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 16, 2012, 11:07:36 am
Lefty just in case I've negated a negative (!?), the first implementation displayed similar wobble without the function 'analogReference()' being called.

It's interesting what you say about alternative chips and I wonder whether you have any models in mind.  I admit that I'm trying to do this on half a shoe string, but a few quid of prudent expenditure is surely horses for courses.

Thanks for your view...
17  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 16, 2012, 02:55:16 am

4. Induction in that 4 meter cable (from near by mains cables) is the cable shielded?


Mark after I mentioned 4m, I thought that it might lead (no pun intended) to trouble.  In fact we have two NT6's in this embryonic system and the newer (recently bought - albeit an old model) was on my mind.  The irony being that this is the eye that is providing the digital signal, whereas the other analogue one has a miserly 10" ± (254mm ± in new money) of cable - both Sick cables are shielded.

N.B. In terms of which model the analogue NT6 is, I think it might be the ...22 as discussed in an earlier post.

Thanks Mark
18  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 16, 2012, 02:39:43 am
The first thing I would try as a simple experiment would be to remove the external Aref voltage you are applying to the Aref pin and use the instead default internal Avcc reference and see if your wobble improves, gets worst, or remains the same.


Lefty, Aref was only tried after suffering with wobble and made very little perceivable difference compared with the Unos' default 5V.  I should just check: When you say 'internal', do you mean something other than using the 'DEFAULT' Const when setting the reference in 'analogReference()'...this is how it was being used prior to using the Aref pin (although it was used by default, i.e. no specific call to 'analogReference()')...

Thanks Lefty
19  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 15, 2012, 02:35:27 pm
If your requirements are so close to the resolution of the ADC that a variation of one or two is important to you, you probably need to use a more precise ADC.

Under battery power the ADC is pretty well behaved (certainly noise below 1 lsb) - I suspect this is power supply noise - is the PSU a switching one?  Extra decoupling can help.

MarkT sorry, I have little idea what a switching supply is but I can say that it is pretty cheap.  It is surprisingly accurate though despite this (compared with other supplies I've measured), reading 11.94 for a 12v supply.

20  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 15, 2012, 02:14:51 pm
In principle this is the sensor but mine is a rare variant, NT6-03014 (from memory) with a 4m cable, which Sick has assigned a new part number to.

The beuaty about these great yester year devices (unlike many modern eyes) is that they were made with an anaolgue output too.  If you dig into the specs you'll find references to it: They have a green light and a red one and this topic ties nicely into the figures I've just recieved from the analysis as promissed.

Following my rationalisation of what matters and what doesn't, I have the following (all relative to 1024 values [10 bits]):
Set to the green light...
A glossy white mark: 75..77
A glossy black mark: 15..17

Set to the red light...
A glossy white mark: 201..204
A glossy black mark: 37..39

The key to this project holding water is a matter of the ratio of distance moved (image movement beneath the sensor) to ADC change.  The green gives around 0.1mm per count and the red around 0.01mm.

My conclusion is that 0.01mm is fine whereas 0.1mm isn't and unfortunately this is the best scenario as other colours produce a much smaller range.  Therefore I feel I need to continue refining.  I would be gratefull for peterH (author of 20 bit suggestion) or of course for anyone who knows some ins and outs of taking the 20 ADC bit route because I'm new to this and hoped my little Arduino would cope.

Thanks a lot all.
21  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 12, 2012, 12:58:49 pm
I think the first thing to do is to see what the averaged wobble means to the project.  I'll do some crunching and come back.

Thanks again PeterH
22  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 12, 2012, 02:03:13 am
Oh right. I was struggling a bit with what seemed to be a bad run of luck in that I felt the quantisation rounding was being 'invoked' far to often i.e surely I couldn't be that close to a threshold of 0.5 that often.

Given that you think the system is largely working healthily in its current guise, would you expect the only approach (when using 20 bit ADC) to be simple mean averaging or, do you think a Median or Mode function might be the route (in other words: might there be a pattern in the data).  A while ago I looked into ways to average because I thought it was at least something to consider, trying to find a library Mode function in C# (rather than rolling my own) to no avail and so hence an [additional] lingering reluctance to average - at least using C# (I'm using a PC to plot a graph in real time).

Thanks a lot PeterH
23  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 11, 2012, 02:36:23 pm
PeterH I hear you.  However, given that I have a issue (or non-issue) with 10 bit, without the reduction in mV wobble, it will only get worse unless the greater resolution somehow shows up a frequency pattern wont it?

24  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 11, 2012, 02:09:07 pm
AWOL is this mantra always applicable when the inconsistency is this small or should I try to improve the design - given that I really don't have much idea about earth loops and the like.  As this is my first experiment with anything electronic really, I'm all ears.  As you say, this result is not bad and so I guess I should begin to focus on what the implicatons are.  I'll take a look at what constitutes a shortfall in performance and what doesn't - given the right method of interpreting the result/s.

Just for your interest, there is really only one shot when it comes to reading the voltage from the sensor - this is because the colour is moving beneath it and any second read, should be labelled as 'second read' and compared with an 'ideal second read' value - at least this is my current thinking.

Thanks for the input, I'm getting a feel for the subject.
25  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 11, 2012, 12:52:10 pm
Yeah, this is the cheating that I refer to... smiley-cry
26  Using Arduino / Project Guidance / Re: Input from Photocell or otherwise on: October 11, 2012, 12:51:02 pm
As it happens I'm working on something similar and have two photocells working in tandem to recognise average greyscale.  In my case, one digitally configured cell tells the Arduino when to read the analogue voltage coming from the other and it works, though I have a bit of noise which I'm trying to troubleshoot in the analogue readings.
27  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 11, 2012, 12:46:00 pm
Yup... SICK is the manufacturer and the NT6 is an optical sensor that views colours in greyscale, rather like a black and white photo.  Wobble is the inconsistent readings I'm getting which are in the region of ± 1 (56..58 out of the 1024 10-bit range).  Actually it is not known whether this is ±1, +2 -0 or +0 -2...and so whether additional wander is possible at the wave of a hand (not a metaphor) I can't say.  Neither can I say whether the mean value can change easily or what can (or perhaps what can't) make it change.

I'd really like to constrain this further because I would feel like I'm cheating to 'program' around it.  Perhaps an experiment with a battery will at least give me experience in this matter and I have to say, the idea of noise originating from processor activity makes me think this analogue business might be an art (based on science obviously!).

Thanks for the advice. 
28  Using Arduino / Project Guidance / SICK sensor and AD wobble on: October 11, 2012, 06:26:17 am
OK so I have two SICKs (NT6) greyscale sensors where one is the digital trigger that tells the Arduino to read the voltage from the other - all working well except for AD wobble.

Being pretty new to just about everything 'electronics' I am experimenting with this and that: I have a 12V power supply measuring 11.94V ± under load with the load being both NT6's, the Arduino and my electronics, amounting to:

'Dividing' the voltage from the digital sensor from 11.94V to <5V
Restricting the analogue current with a resistor (Voltage range is 0..<3V before any tinkering)
Using a 4V7 zener diode to cut the 11.94V supply down as an attempt to smooth the reference in conjunction with the AREF pin (also uses 4K7 resistor in series to allow software reference switching safety)

My wobble problem manifests as readings varying between say 56 and 58  (parts of 1023) for a typical analogue reading where the 'test' colour is physically static and I am wondering about Earth/Ground/GND implications.

The wiring that 'works' (with wobble) has the plain divider (not the zener whatsit) connected to the power supply Blue wire (European hardware if relevant) and is in parallel with the GND on the UNO R3 'Power' section.   The bottom of the zener divider goes to the GND which is next to the AREF pin.  In addition the analogue is pulled down using around 9K Ohm - to the GND in the Uno's 'Power' section.

N.B. The zener setup (AREF) doesn't seem to have done anything to change the wobble either way (compared with setting the ref to DEFAULT) and I haven't bothered dividing by anything other than 1023 yet and of course that will only make the wobble appear worse.

I read a technique about making the processor go to sleep when taking AD readings but the C was unfamiliar (I need more practice) and don't yet understand how to use capacitors.  Incidentally I came across how to program the system to automatically calibrate to the AREF.  If anyone has an idea about what is wrong (and right!) I would be very grateful.

Thanks a lot 2Tricky
29  Using Arduino / General Electronics / Re: What are the recognised principles of avoiding 'noise' when using sensors on: September 29, 2012, 03:09:50 am
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

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!
30  Using Arduino / General Electronics / What are the recognised principles of avoiding 'noise' when using sensors on: September 28, 2012, 04:18:16 pm
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.
Pages: 1 [2] 3