9 years, 11 months ago.

Finding position of a signal.

Hello! I'm preparing myself to write a thesis, but I don't really know much about programming microcontrollers/sensors. My question is - f/e if I have a lot of machine faults (i/e sticks falling onto the bars ) which could output signal (drawing attached) and I would like to find out which one of them it really is. Could you help me finding literature and/or schematics, cause I don't even know where/how to search something similar to it.

P.S. Sorry for my sick paint skills. /media/uploads/1leven/untitled.jpg

1 Answer

9 years, 11 months ago.

As a first-pass, you need to know if the sensors are going to be analog or digital. If a stick lands on a sensor, does the sensor send back a "1 - yes it did," or "0 - no it didn't"? Or does it send back a, "The stick landed about half-way between the ends of the sensors, so you have half of a total signal" type? It's not a huge deal, as far as the overall logic, but it could simplify your design. Binary on/off is easier: it's either on or off. Otherwise, you'll have to calculate where on the sensor pad the contact happened. If you don't care where it happened, that makes the sensing job a little simpler, because then you just want to know, "Is the signal returned any value greater than 0?"

Beyond that, within your program, you're going to setup the individual sensors - either as DigitalIn or some analog input - and then loop over detecting when a signal is received. You can do this either by polling - repeatedly checking to see if a sensor has tripped - or through interrupts, which you configure to respond when a sensor notification is received.

What sensors are you using for this project? That might help to start fleshing things out.

I think I am not gonna use any sensors, just global 5V-ring, with all the metal "sticks" connected together.

As the the stick falls onto metal (horizontal) bar - it closes (connects) the circuit (works like an easiest switch).

All the horizontal metal bars are connected separately to some kind of AVR (I think it will be atmega8). Each machine will have 18x4=72 metal bars, so basically 4 atmegas needed for input for each machine.

The thing is I dont understand is what to do further. Like basically afterward I should output a string out of otmega (SMTH like MACHINE.NUMBER_ATMEGA.NUMBER_INPUT.PIN.NUMBER) to my MBED and then comes the Interface/Data part, which is not the part being discussed here :D

posted by Igor Shevkoplyas 09 May 2014