Big noob here, it's my first Arduino project, and I'm stuck about the power supply for my sensor (Laser range). It's a Sensopart Smartrange FT92 ILA-PSL5
I just figured out that Arduino delivers 9V max and therefore my 12V external power supply is'nt enough. My sensor as you can see needs at least 18V. Seems like I need an industrial 24V power supply, but I have no idea how I'm supposed where to find this type of power supply and how to "use" it with my sensor's cables:
Also be aware that this is a current type output so you will need a resistor between the output and ground for the Arduino to read the voltage - E=IR or R = E/I or R = 5V / 20mA or R = 250 Ohms. Voltage reading will go from ~0.8V to 5V
I managed to cut then isolate +/- cables from this power supply:
Pretty aweful, I know. It's delivering 19.5 V/DC 4.26A.
And now my sensor is ON and seems to react when I place objects on his road for example.
Also be aware that this is a current type output so you will need a resistor between the output and ground for the Arduino to read the voltage - E=IR or R = E/I or R = 5V / 20mA or R = 250 Ohms. Voltage reading will go from ~0.8V to 5V
Yup ! I have a 250R. But now you're speaking about it, (I'm also noob in electronic..) I have now an empty Arduino. GND pin is not occupied anymore
Are you suggesting something like this ? (I have no breadboard neither straps :()
The analog output as mentioned, is specified as a current output.
The sencor varies the current out of the pin, between 4 and 20 mA depending upon range.
To detect a current with the arduino, one needs a voltage between 0 and 5v.
using ohms law, as mentioned above, 250 Ohms between the output pin and ground will give a voltage up to 5Volts. If you go above 250 Ohms, then the sencor will output a higher voltage to give the 20 mA, which could blow the arduino,
Personaly I'd go for a smaller resistor, say 200 Ohms or even 100 Ohms, to give a lower impedance, less noise pick up, although less range into the arduino, and scale the arduino adc reading accordingly.
so stick a resistor between the signal pin and ground, gives u a voltage , that should be visible on a multi meter. On your picture your using Analog in 1 ? so your resistor is just fine, thought the gnd pin marked power is nearer,
The analog output as mentioned, is specified as a current output.
The sencor varies the current out of the pin, between 4 and 20 mA depending upon range.
To detect a current with the arduino, one needs a voltage between 0 and 5v.
using ohms law, as mentioned above, 250 Ohms between the output pin and ground will give a voltage up to 5Volts. If you go above 250 Ohms, then the sencor will output a higher voltage to give the 20 mA, which could blow the arduino,
Personaly I'd go for a smaller resistor, say 200 Ohms or even 100 Ohms, to give a lower impedance, less noise pick up, although less range into the arduino, and scale the arduino adc reading accordingly.
so stick a resistor between the signal pin and ground, gives u a voltage , that should be visible on a multi meter. On your picture your using Analog in 1 ? so your resistor is just fine, thought the gnd pin marked power is nearer,
Honestly, it scares me ahah. I don't really know if it's how it is supposed to be.
So basicly as you can see I put my 250R between the blue wire (GND) and green&yellow (analog output), then makes the resistor ending inside analog pin 0......
:.
Then with a basic program to read analog value and convert to voltage, I got some inconsistent results.. But I guess that's another problem. Let's stick to wires now
Voltage = 0.00 V
Voltage = 5.00 V
Voltage = 0.00 V
Voltage = 5.00 V
Voltage = 0.00 V
Voltage = 5.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 4.55 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 0.00 V
Voltage = 4.64 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 5.00 V
Voltage = 4.76 V
Voltage = 0.00 V
Voltage = 0.00 V
okey, so my multi meter display ~1.28V when the object is at distance 0% (supposed 4mA) and ~4.78 when at max distance (20mA). I saw, maybe twice ou 3 times, 5.05 and 5.09, but the voltage is mainly under 5V.
Sounds good for me XD, first time I get a signal !!
But not very accurate as you mentioned in your post, indeed.. :.
Thank you so much drjiohnsmith
edit: hm, after some more tests, it appears that the true values are: min distance = 1.37v max distance = 5.10v !
id go for the 200 ohm, dosnt have to be acurate, just predictable.
if you have five of the 250,
you could put two in parallel, to give 125 ohms
and another three in parallel to give 83 ohms,
which in series gives 208 Ohms.
Yup, I ordered 10 250ohm resistors last time
But I'll order some 200R for sure.
Time to use Arduino now I will update this thread soon I guess.
And again, thank you very much man. You can't imagine what your help means for a TOTAL beginner like me who have to show something to his client next tuesday..
Output is changing even if I don't move the object, and never gives the correct value displayed on the multimeter, which is also plugged. I keep on investigating.
The situation as changed in a good way since my last post.
ground missing.
Yes, that was exactly what I missed to do. I was then able to get the "correct" voltage in my program when I was playing with the sensor.
Values were corrects, voltage didn't go above 5V, and I had to substract 180 from analog signal..
Next problem I encoutered was the "noise" from analog output, always fluctuating, not really accurate and stable. Despite the fact that the multimeter in front of me displayed voltage without any change.
And because of that I decided to rebuild the whole installation from scratch, and now "catastrophe", my multimeter show me a maximum voltage = 7V... ^^
Just to keep updated this thread, and maybe close it.. It seems that it's impossible to get constant value output with this laser.
As mentionned in the PDF descriptor, we believe that the line showing "Linearity: < ± 40 mm" explain the fact that the sensor will always output a value fluctuating inside a range..
Yeah I think it's all about maths & programmatic "solution" now.
Since my last post, I read a lot about Linearity concerning sencors, and it seems that it is a common problematic when it comes to get a "corect" value with fluctuating analog output. In fact, there's no way to find the exact value. It's just a question of interpolation.
Best way to stabilize signal might be, as you say, to smooth the value. And.. I tried a LOT of smoothing/filtering algorithms, even the one you gave me
One absolute fact with this sencor is: analog output can fluctuate a LOT. Say the corect value I should get is 950. Suddenly the signal can goes to a damn 961, then goes down to 954, 949, 953 etc.
If a try to interpolate all these values over the time, I have a pretty nice smoothed value. It's good for heavy distance changes (like 30cm in 500ms), BUT, then again, it becomes problematic when I want to catch very small changes of the distance..
Dunno if you see my point. Everytime I try something, I come to the same conclusion.
when I smooth values and move the object quite quickly, my program detect the movement. BUT if I move the object slowly, no movement at all are detected because values are "too smoothed".
when I don't smooth values, if I don't touch the object my program still detect some creepy movements due to BIG fluctuations.
I see the same fluctuations when I use Firmata_test.exe, so they come directly from the sencor.
My wiring is very messy, that's for sure, as you can see in my previous pictures. And you could say like some other people told me: "Instead of complaining to get stable values, build a correct wiring." But I'm pretty sure my wiring is correct. The multimeter tells me that there's 1V for the minimum distance, and 5V for the maximum distance. And that's exactly what I'm supposed to get with a 250R between GND and signal output.
Plus, this "Linearity" thing wich convince me that it comes from the sensor.
That being said, I'm very surprised that such a sensor is capable to give such fluctuating values..
Anyway, yesterday I came to the conclusion that this laser is not appropriate for the purpose of our project. My boss ordered another laser for tomorrow, it's like "red alert" in our office right now.