I would like to ask you for some help in designing some testing device which could detect shorts or coil break.
For testing coil break I think I have figured it out how to program Arduino, but when it comes to detecting shorts I can't figure out how to do it.
Circuit consist of 6 coils which all have common ground and seperated outputs (1 to 6). Coils have resistance of 16,5 ohms.
Testing if coil has been damaged (broken connection) would be easy, I would put HIGH signal to common ground and then check each coil output for HIGH signal.
But what about testing for shorts between pins 1 thru 6?
You need to inject a known current (such as via a resistor) and measure the voltage drop across the coil
with analogRead(). Inject 10mA using a 470 ohm resistor from 5V will produce 165mV on a good coil,
5V on an open coil and a lot less than 165mV on a shorted one.
So guys I have written my first code yesterday. I thought that I could make program from various examples, but I have decided to write my own.
Since this is my first attempt in to programming please excuse my messy code..
What I did was following:
defined all of the outputs and inputs along with (probably to much) variables for storing results
I have used "while" function because I wanted the main loop to run only when button is pressed
first variable "senTul1" will measure voltage drop on coil and regarding this result from analogRead(tul1, A0) it will put new variable "tulMer1" in to HIGH or LOW state so I can read this variable so I can later put it in to "if" statement which will be responsible for turning on green LED if all of variables are HIGH (all coils OK)
the second "if" statement will be responsible for turning on RED led in case that any of 6 coils will be damaged
Is that the correct approach for this testing procedure?
MarkT:
You need to inject a known current (such as via a resistor) and measure the voltage drop across the coil
with analogRead(). Inject 10mA using a 470 ohm resistor from 5V will produce 165mV on a good coil,
5V on an open coil and a lot less than 165mV on a shorted one.
Hi,
I have begun testing my device and I found a problem which I can't find the cause of it. My program and test setup detects coil being short to ground and an open coil, but ir does not detect coil outputs shortened.
Reading two coil outputs shortened with multimeter it does show 1/2 of resistance (around 8 ohms, instead of 16 ohms which is normal resistance of one coil), but when I connect it to test device the voltage drop is 165mV on both of coils, even though that the voltage drop should read around 80mV.
But if I remove test pin from one of the shortened coil then drop voltage reading is correct (arround 80mV).
OK, so what you have at present, is six 470 Ohm resistors pulling up 6 analog pins with each connected to one of your coils to ground.
You are apparently saying that you cannot tell when one of the coils is connected to another.
Turns out this is rather easy.
Just pull one of the coils - at a time - down to ground by setting that analog pin as OUTPUT and LOW. See if that affects any other coil, then set it back to INPUT and do the same to the next one - and so on.
By the way an Arduino Nano (or clone) is better for serious projects (unless there is a "shield" which helps you to do the job perfectly. )
So I basically put one analog output to ground and I measure voltage drop on other coils, like A0 to output LOW and then measure voltage drop on coils A1-A5?
Did I understood this correctly?
PS: Isn't NANO way smaller board? Are you telling me that NANO is better than UNO? I have UNO and NANO, so you suggest that I put this program on NANO? What about current capability for LEDs and buzzer?
rpogacar:
So I basically put one analog output to ground and I measure voltage drop on other coils, like A0 to output LOW and then measure voltage drop on coils A1-A5?
Precisely. Then you switch them around, set A0 as input again, A1 LOW and test A0, A2-A5.
rpogacar:
PS: Isn't NANO way smaller board? Are you telling me that NANO is better than UNO? I have UNO and NANO, so you suggest that I put this program on NANO? What about current capability for LEDs and buzzer?
A UNO is a Nano with a different USB interface chip and pins on a bigger board in funny places. Not useful for plugging into breadboards like a Nano is. May use a slightly different bootloader so you have to specify the right one.
Otherwise electrically identical. (Almost) same ATmega328 chip with same specifications. I/O drivers cannot be used to supply or sink more than 30 mA each (with overall limitations) and must not be subject to voltages outside 0 to 5 V.
But is it a UNO you have? Does it have a 16U2 chip in the top left corner behind the USB connector and a 6 pin header adjacent?
I mention this because if it does not have these, it is not a UNO but a fraud - a version of the much older Arduino Duemilanove which is functionally identical to a Nano.
Thank you very much for extensive explaining on Arduino family and helping me out on this test device. I really didn't know that you can assign different states of pins during program running.
I currently have some Geniuno 101 (bought from official store) and some clones bought from Aliexpress, but even Uno (clone) has characteristic that you have described so I guess it's not an older version (non R3). I had this boards for along time and I never had a time to learn this language, but now was the perfect time to begin exploring the capabilities of this board.