-1

In order to monitor engine speed changes in real time, sensor is detecting the motion of few magnets around a disk driven by the motor. 1st approach Hall effect sensor signal is regulated by LM393 comparative IC, resulting digital clean signal, connected as input to a selected pin then measuring the timing changes between of the signals to calculate the speed changes. 2nd approach is to connect hall sensor directly without modeling to a micro controller ADC, then process the digital noisy unclean signal which require much processing power than 1st approach. Better approach are welcome, but the question is how to choose proper controller specs for such task

Hamed
  • 1
  • 3
  • There is too much guesswork in trying to understand what you are asking. Can you post some schematics, code and pictures? – MichaelT Dec 11 '19 at 13:14

1 Answers1

0

The first option is way better than the second. Measuring a voltage with the ADC takes time and you don't really need the analog values in your code. (Though depending on the actual values you might not need a comparator befor it. The digital input pin acts as Schmitt Trigger. The only requirement for this is, that the signal range is greater than 0.3*Vcc to 0.7*Vcc.)

About the needed controller: That greatly depends on the speed, that the motor is running at (e.g. the frequency of pulses), and the way you are measuring it.

  • The easiest Arduino way is to attach an interrupt to the pin and increment a counter variable in it. Reading and resetting the variable in regular time ranges (using millis() will give you the pulse frequency and thus the speed. For this you don't need much extra functionality in the microcontroller. One with external interrupts or pin change interrupts is sufficient (almost all microcontrollers have those).

  • Another way is to utilize a hardware timer as counter. You can configure a timer of a microcontroller to get it's clock source from a pin. If you connect your sensor output to it, the counter will increment on every edge (falling and rising). The first timer of an Arduino is used by the Arduino core as time-keeper. You can use it to get the time component. Configure the second timer as counter, set it's value to zero, then start the timer and track the time passed using millis(). When the measurement time has passed, you read the counter value, reset it to zero and start a new measurement. While the hardware timer counts the pulses, you can calculate the speed with the number of pulses and the time passed and do whatever you want with it. This approach of course needs at least 2 timers (which most microcontrollers have, I think).

Of course the general speed of the microcontroller, meaning it's clock frequency, is also a concern. But this only becomes relevant, as you reach high pulse frequencies.

This answer is a general overview on how to go on. For a more specific answer, you should edit your question to also be more specific. For example you could include the expected pulse frequency.

chrisl
  • 15,197
  • 2
  • 16
  • 26
  • Thanks chrisl for your adequate details, I'm concern if the hall sensor direct connection without LM393 will be sufficient so each changes will count. – Hamed Dec 04 '19 at 22:32
  • on the other hand, I don't want to calculate only the speed, but also the real time changes "acceleration" that's why we put many magnet on the rotator not only one, to sense the changes in each rotation not every many rotations. – Hamed Dec 04 '19 at 22:35
  • If it will work without the LM393 depends on the voltage levels of the signal. And what is important is the pulse frequency. What frequency do you expect? – chrisl Dec 05 '19 at 09:04
  • frequency is below 1000 HZ, but my test for the Hall effect sensors available result in different voltage depend on the speed, lower speed means lower voltage – Hamed Dec 05 '19 at 20:35
  • I didn't comprehend the difference between Schmitt trigger and comparator, but I noticed schmitt will keep only the larger wave while smalls will not be detected – Hamed Dec 06 '19 at 07:30