I'm in the middle of a school project and am running into some issues. I'm trying to use an Arduino to sense the voltage spike from a Hall Effect sensor that is in close contact with a spinning "pick up" wheel that we had cut out from a water jet table. The pickup wheel goes onto a spinning shaft extruding from the differential of our buggy. Over the weekend we took the sensor into the lab and simulated our spinning wheel and used an oscilloscope to look at the signal and a multi-meter to test max voltage generated. The max voltage we got was .33 DCV. We found a code online for Arduino that hopefully I can post below and simply had us put one wire from the sensor into an analog input on the uno and the other wire from the sensor to ground on the uno. We opened up the serial monitor and watched the program and uno sense voltage.
My questions are, we had no time reference so is there a way to have the time posted beside the voltage value in the serial monitor window? Also, what is the base line sensing time that the uno is set to and how to I change it to the shortest time increments as possible. Thirdly, is there a way to set the uno up to just sense an incoming voltage when a signal is presented to the uno? I would prefer that was so if the buggy becomes stationary for a couple of minutes, the uno is not filling up pages and pages of zeros.
I honestly do not know how to write code so this has been very frustrating. The group is talking about using a raspi in conjunction with the uno but that is down the road. Thanks for the help
I wish I could find the data sheet for the sensor. It was given to us for free off of some vehicle and the part number off of the sensor is rubbed off unfortunately. Here is a picture of its signal on the scope I don't know if analog or digital. We did get data when it was plugged into a analog port on the Uno
I'd try to connect it to pin 2.
You can determine if it can be used as a digital sensor.
If you can detect the magnet (read both 0 and 1) -> use it interruptdriven
If all readings are 0, try a 10k pullup resistor (or internal pullup)
I feel like the sensor is working fine. I just need to know how to speed up the sensing time of the arduino or switch it to a completely reactive state
When we increased the rpms there were more spikes. Depending on how close the magnet of the sensor was to the spinning wheel, the spike would get larger or smaller.
I don't want to get off into the weeds are far as our sensor goes. When testing, we got an analog signal (at least it looks analog on the scope) and when used in one of the Uno's analog inputs, it sensed the voltage. In class our professor told us to find out the maximum number of signals that will be generated by our sensor per second and then adjust the Uno's sensing rate to 10 times that so that it never "misses" a signal. So, is there a way to adjust the Uno's sensing rate to about 800 signals/sec? It says on the arduino webpage that the Uno's maximum reading rate is 10,000 times/sec which is far more than 800.
Well, I got some more clarification today at school. Someone had the idea to instead of trying to "change" the sampling time of the Uno, write the code for the Arduino so that it is made to sense voltage at a specified frequency. I was planning on using the AnalogRead function. Should I create a loop with say an if statement or while statement that calls on the AnalogRead function every .00125 seconds? Doing it this way I would have my time intervals already. Any help is appreciated