Using a Hall Effect Sensor to Make a Tachometer

  Рет қаралды 165,842

Craig Hollinger

Craig Hollinger

9 жыл бұрын

An example of using a Hall Effect sensor to make a simple tachometer.
Link to my video on an LCD software driver:
• Microcontroller User I...
Link to my code and a schematic:
github.com/hollingerc/hall-ef...

Пікірлер: 140
6 ай бұрын
This code to create a tachometer in Arduino is spot-on correct. Other like videos track # of revolutions in set amount of time, then extrapolate RPMs. The result is an RPM read that jumps in 60 increments, as every additional revolution in a given cycle results in +/- 60 revolutions. Mr. Hollinger's code is dated now, but still so relevant. Thank you!
@petriekbink6103
@petriekbink6103 7 жыл бұрын
Thanks for the very comprehensive video. You did an excellent job explaining a not so easy circuit to a noob like myself. A high quality video indeed it is.
@craighollinger9972
@craighollinger9972 3 жыл бұрын
Thanks!
@WhoWantsToKnow81
@WhoWantsToKnow81 4 жыл бұрын
Beautiful execution and explanation, this helps me loads. Thank you!
@craighollinger9972
@craighollinger9972 4 жыл бұрын
Glad it was useful. Thanks for watcing!
@paulmaydaynight9925
@paulmaydaynight9925 2 жыл бұрын
the faces information in plain English is gold, that makes it far more useful.
@capistor1
@capistor1 4 жыл бұрын
that explanation was so precise and easy to listen to.... you really have a talent for this..please we need more videos like these... i subscribed, gonna check the rest of your content.
@craighollinger9972
@craighollinger9972 4 жыл бұрын
Thanks for the comment. Sadly, I haven't made videos for a while, work has been very busy lately. Maybe in the future...
@billfield8300
@billfield8300 8 жыл бұрын
Thanks for the tutorial. I want to create a cadence sensor for road cycling training and this may prove very useful. I will not have some of the speed issues you had but the concept is identical. Thanks again.
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Bill Field Thanks for watching!
@francopasinelli
@francopasinelli 8 жыл бұрын
Good work sir. Keep up and spread the "word".
@mikebrown7366
@mikebrown7366 5 жыл бұрын
PORTB.0 (Arduino digital pin 8) offers a very simple way to obtain amazing precision by capturing the Timer1 value on a rising/falling edge. By enabling timer overflow and capture interrupts, you can measure very long periods between the edges as well as sub-microsecond periods with exacting precision. I can give you some sample code that does this in the ISRs and passes the measurements back to main level code in a circular queue. It's surprisingly simple and small. Edit: Look at ICP1 facility in the datasheet.
@craighollinger9972
@craighollinger9972 5 жыл бұрын
Thanks for the info. I threw the project together in a lazy afternoon for the video, so not necessarily the best way to do it.
@widget_wizard
@widget_wizard 5 жыл бұрын
What a spectacular video. THANK YOU for being such an awesome content creator.
@craighollinger9972
@craighollinger9972 5 жыл бұрын
Thanks!
@johnlewis6880
@johnlewis6880 4 жыл бұрын
Wow. Cant thank you enough for posting this very lucid explanation of this hall effect sensor project. Im new to this technology and am working my way through an Arduino tutorial with my first being the design of a chain counter on the anchor windlass on my boat. I dont need RPM. I need to count rotations and convert that into feet of chain but your post told me a lot of things I did not know about using hall effect sensors and a lot of the info in pertinent to my project. My primary challenge is figuring out a way to detect which way the wheel is spinning (i.e., is the chain coming in or running out). I was thinking that I could use two hall effect sensors and use some sort of logic loop to set the direction by detecting which sensor is triggered first to determine direction of rotation.
@craighollinger9972
@craighollinger9972 4 жыл бұрын
Good luck with your project. The internet has a lot of good information. You just need to sort through all the mis-information though. Thanks for watching.
@josemardeoliveiraquevedo2826
@josemardeoliveiraquevedo2826 5 жыл бұрын
Great video, it was really helpful in my application. Nevertheless, I would like to suggest an improvement if I may. Looking at the falling and rising edges obtained from the amplifier in 9:30, the slope shown is not so sharp due to the linear response of the sensor. Such behaviour could modify the interrupt identification of the falling and rising edges on the microprocessor when the velocity of the shaft increases or reduces. In fact, this effect would be more significant for low speeds because the slope would be less sharp as the speed reduces. In order to reduce such a problem, it could be used a Schmitt-trigger on the output of the amplifier. Actually, some Hall-effect sensors use Schmitt-triggers for digital measurement of the magnectic field.
@craighollinger9972
@craighollinger9972 4 жыл бұрын
My apologies for not replying sooner, super busy at work. Your point would be correct if the system was measuring the time between a rising and a falling edge. But that's not how my system does it. Only one edge (rising or falling, I can't remember which) is used to trigger the timer. The time between successive rising edges will always be proportional to the rotation of the motor. The slope of the signal from the amplifier doesn't come into play in this case. I'm glad you found my video helpful. Thanks for watching and your comments.
@craighollinger9972
@craighollinger9972 4 жыл бұрын
My apologies for not replying sooner, super busy at work. Your point would be correct if the system was measuring the time between a rising and a falling edge. But that's not how my system does it. Only one edge (rising or falling, I can't remember which) is used to trigger the timer. The time between successive rising edges will always be proportional to the rotation of the motor. The slope of the signal from the amplifier doesn't come into play in this case. I'm glad you found my video helpful. Thanks for watching and your comments.
@craighollinger9972
@craighollinger9972 4 жыл бұрын
My apologies for not replying sooner, super busy at work. Your point would be correct if the system was measuring the time between a rising and a falling edge. But that's not how my system does it. Only one edge (rising or falling, I can't remember which) is used to trigger the timer. The time between successive rising edges will always be proportional to the rotation of the motor. The slope of the signal from the amplifier doesn't come into play in this case. I'm glad you found my video helpful. Thanks for watching and your comments.
@tonyfremont
@tonyfremont 10 ай бұрын
Microchip makes some fairly decent opamps with rail to rail outputs. Some have a built in Vcc/2 reference output for biasing an input. Their weakness is that they are only 5V parts.
@Mr2011Sami
@Mr2011Sami 8 жыл бұрын
Excellent Explanation, Thank you!
@dalwindersingh9455
@dalwindersingh9455 4 жыл бұрын
Thanks for your time explaining things very clearly
@craighollinger9972
@craighollinger9972 4 жыл бұрын
You are welcome! Thanks for watching.
@bartchelin
@bartchelin 6 жыл бұрын
Awesome walkthrough
@KAFA2020
@KAFA2020 7 жыл бұрын
Thanks you very very much for you very basic demonstration.
@josephcarbone34
@josephcarbone34 8 жыл бұрын
Excellent explanation and tutorial. I plan on working with a tach like this. I'm new at biasing opamps and am wondering what purpose the voltage divider on the non-inverting input between the hall sensor and opamp serves.
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Joseph Carbone It raises the opamp reference so that it will track the signal from the Hall sensor. The Hall sensor sits at 1\2 the power supply rails and its signal will go positive or negative from this level depending on the polarity of the magnetic field. Thanks for watching!
@mhdsait93
@mhdsait93 7 жыл бұрын
you are simply AWESOME !
@craighollinger9972
@craighollinger9972 5 жыл бұрын
Thanks!
@veganath
@veganath 6 жыл бұрын
Still being appreciated thank you
@ovalwingnut
@ovalwingnut 4 жыл бұрын
I'm late to "this" party.... Info is as fresh as a silicon daisy! Super 👍😁. Enjoying it immensely (it's Fri night 10:45pm:). This has SUBBED written all over it. Much appreciated. Cheers! Randy 🤗
@craighollinger9972
@craighollinger9972 4 жыл бұрын
Thanks for watching!
@EmerRify
@EmerRify 9 жыл бұрын
Thank you extremely much for this excellent video.
@craighollinger9972
@craighollinger9972 9 жыл бұрын
EmerRify Thank you for watching!
@moto-camper
@moto-camper 6 жыл бұрын
Awesome explanation
@craighollinger9972
@craighollinger9972 6 жыл бұрын
Thanks!
@danieloljirafufar2739
@danieloljirafufar2739 8 жыл бұрын
Thank you sir, it is very helpful to refresh memory...
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Daniel Oljira Fufar Thanks for watching.
@rafaelmarroquin4429
@rafaelmarroquin4429 8 жыл бұрын
great video, excellent form of explain us. this topic.
@craighollinger9972
@craighollinger9972 8 жыл бұрын
Thanks for watching.
@sonyobright2106
@sonyobright2106 5 жыл бұрын
great ... good work...
@kenhorner6836
@kenhorner6836 8 жыл бұрын
Craig... very nice presentation. Have you posted the software anyplace? It will be useful to see how you wrote it.
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Ken Horner Thanks for watching. I don't yet have anything set up yet to post software. I think the video is clear enough for you to be able to follow along and copy the software from your screen.
@gregbyankee
@gregbyankee 4 жыл бұрын
excellent video, very well done. One question: you say that you need to detect the falling edge because if you ‘d use the low signal (flat part) you don’t know if a single cycle could be counted multiple times, since the time it stays low is longer than the cpu cycle... But, why don’t you simply measure both low and high signal , and then (and just THEN) set the counter ? Isn’t it easier to reset the counter to zero after a Low And an High signal is detect, in sequence?
@craighollinger9972
@craighollinger9972 4 жыл бұрын
When the pin goes low, the timer is started. The next time the pin goes low (after one revolution of the motor shaft) the timer is stopped and the accumulated count converted to RPM. The whole process starts over next time the pin goes low. There is no need to detect when the pin goes high.
@manla9921
@manla9921 9 жыл бұрын
Excellent tutorials! I'm definitely going to make one of these.Can this technique be used to make a frequency meter/counter? If so, what would be the maximum frequency that could be measured? Thanks for sharing.
@craighollinger9972
@craighollinger9972 9 жыл бұрын
Thanks for the comment. Not sure how you would couple the signal you wanted to measure to the Hall sensor. It needs a certain amount of magnetic field to respond. Also, it's not a very fast device, you might get max 10kHz out of it.
@manla9921
@manla9921 9 жыл бұрын
Craig Hollinger Oh I meant using timer 1 and INT0 to measure the falling edge of the signal i want to measure the frequency of. For example instead of connecting the output of LM358 to INT0 connect the signal I want to measure, then do the calculations and conversions. English is not my native langue so I don’t know if i'm explaining myself correctly sorry.
@craighollinger9972
@craighollinger9972 9 жыл бұрын
Man LA OK, I understand what you want to do (BTW, your English is great). The way I implemented the tach is not a good way to make a frequency counter, there's a better way to do it. It will be too hard for me to explain how through KZfaq comments, but you've given me an idea for my next video. Stay tuned, I'll produce a video on making a simple frequency counter sometime in the next few weeks.
@manla9921
@manla9921 9 жыл бұрын
Craig Hollinger thanks for replying, for sure i'll stay tuned i bet it will be very interesting i've been watching your videos and i really like how you explain every detail in your designs i find that to be really helpful once again thanks and happy holidays!
@ScottRedstone
@ScottRedstone 8 жыл бұрын
Get video. I got the circuits all working. Did you ever post the code and a link to your lcd library? I don't mind retyping in the code from screen shots but it is a bit time consuming. Thanks.
@craighollinger9972
@craighollinger9972 7 жыл бұрын
The code for the LCD is now on my GitHub site: github.com/hollingerc
@hatuan291
@hatuan291 8 жыл бұрын
Thank you so much
@KJ7JHN
@KJ7JHN 5 жыл бұрын
Love the video, well done. I do have a question. Why have you used a 5A power regulator on a hall effect sensor? Would a LM317, @ 1.2A suffice? The current draw of the hall effect couldn't be more than a few mA. I'm new to this stuff, so my question is genuine. Thank you.
@craighollinger9972
@craighollinger9972 5 жыл бұрын
Thanks! I'm not sure what 5A power regulator you are referring to. If it's the LM7805 in the schematic, that's rated at only 1A. You are right, the Hall sensor doesn't draw that much current. In fact, the whole circuit wouldn't draw much current. I didn't measure it, but I'd suspect it would be 20-30mA tops. I threw the schematic together to give viewers an idea how to connect everything up. Any old regulator, as long as it can supply the current would do. Thanks for watching.
@saeedoroomy
@saeedoroomy 9 жыл бұрын
Excellent. Please make tutorials on how to measure other quantities like pressure, temperature and flow. Thank you.
@craighollinger9972
@craighollinger9972 9 жыл бұрын
saeedoroomy Thanks for watching. I'll keep your suggestion in mind for future videos.
@TheAmigodaniel
@TheAmigodaniel 8 жыл бұрын
Thanks for the instructive video. Can you tell me which language are using to programme your integrated circuits? I hear it is quite comun to use Python. Can you clarify me a litlle? thanks again!
@craighollinger9972
@craighollinger9972 8 жыл бұрын
Hi Daniel, The language I'm using is C. Thanks for watching.
@TheAmigodaniel
@TheAmigodaniel 8 жыл бұрын
Thanks again, good luck with your proyects!
@sgtigram
@sgtigram 8 жыл бұрын
hi! do you know whats the maximum detect-rate (with a raspberry pi and this sensor) if you want to measure the rpm of a motor? i have a 10k rpm motor and i dont know if the sensor or the pi thinks there is a constant magnetic field above a specific rpm..
@craighollinger9972
@craighollinger9972 8 жыл бұрын
I don't know what the Rpi can do, but the particular Hall sensor I used has an upper limit of about 40kHz. The OpAmp I used is not particularly fast either, but may do 40kHz in the configuration I used in the video. So, I suspect the circuit I presented in the video could be fast enough to detect the RPM of your motor.
@3bmon3em
@3bmon3em 3 жыл бұрын
Thanks for this wonderful video. Im currently working on a university project wich is a joystick , what i want to know is that wither this circuit is going to give me an analog range from 0 to 1023 (on arduino) or just a digital 0s and 1s. Thanks in advance.
@craighollinger9972
@craighollinger9972 3 жыл бұрын
Yes, the circuit will give an analog output proportional to the distance the magnet is from the Hall sensor. Just be aware that the analog output from the opamp will sit at a voltage (2.5V, or half the power supply voltage if my memory is correct) when the magnet is far away from the sensor. The voltage will go up or down from there depending on the polarity of the magnet and it's distance from the sensor. You may have to play with the values of the opamp gain resistors to get it working to your satisfaction. Good luck!
@42rexx
@42rexx 7 жыл бұрын
Is there a place I can download your code examples? Also wouldn't it be easier to use a sensor that puts out a digital signal rather than a linear one?
@craighollinger9972
@craighollinger9972 7 жыл бұрын
Here's a link to my code: github.com/hollingerc/hall-effect-tach I've also updated the video description with this link. Yes, there are chips out there that have signal conditioning circuitry built into them and they output a nice digital pulse, but I didn't have one. One of my intentions for this video was show some OpAmp biasing techniques for general interest sake.
@MegaKencam
@MegaKencam 8 жыл бұрын
Is there an advantage to this over a 555 (one shot)?
@craighollinger9972
@craighollinger9972 8 жыл бұрын
I'm assuming you mean replacing the OpAmp with the 555. The signal from the Hall sensor output sits at 1/2 the supply voltage. The OpAmp circuit removes this bias so a digital input can respond to the pulses. The 555 probably wouldn't work if the output of the Hall sensor was fed in directly.
@YorksVideoBank
@YorksVideoBank 4 жыл бұрын
how can you make a current meter using Arduino and a display with this sensor
@phinok.m.628
@phinok.m.628 7 жыл бұрын
Well... You could have easily done it with a normal I/O pin by just saving the last state and comparing it to the current state, to see if it has fallen or was already low. That's not the ideal way of doing it however if you have a free interrupt pin anyway, since the timing will be less accurate the lower the sampling rate and you would therefore have to insure that the main loop runs at fast enough or use timer interrupts. Although that would only become a problem at relatively high rpm...
@craighollinger9972
@craighollinger9972 7 жыл бұрын
Yes, you are right, my code is not the best way to do this. I threw it together quickly just to get something done. What the code is doing is measuring the time for the motor shaft to go around once, and it does this by blocking at the while((EIFR & _BV(INTF0)) == 0); statement until there is a pulse from the Hall sensor, then reading the accumulated value in Timer 1. If the Hall pulse never comes, (when the motor is stopped, for example) the code stalls forever. This is where using the INT0 pin as it was intended - as an interrupt - would work best. That way the microcontroller can go and do something else between pulses. This method works for well low RPM, another method would be needed for higher RPM. I'll leave improving my code example as a homework exercise for you and other viewers. Thanks for your comment.
@tomasppp8212
@tomasppp8212 7 жыл бұрын
Hello, can you give me the link of the circuit you had connected?
@craighollinger9972
@craighollinger9972 7 жыл бұрын
Check the description below the video, there is a link to my GitHub site. I just uploaded a schematic.
@tomasppp8212
@tomasppp8212 7 жыл бұрын
thanks
@marcrobert2603
@marcrobert2603 6 жыл бұрын
how can you measure any voltage at pin1 when it is shorted with the ground?
@craighollinger9972
@craighollinger9972 6 жыл бұрын
If you are referring to pin1 of the opamp, it isn't connected to ground. This is the signal going to the microcontroller to measure the time between pulses as the magnet spins around. Check the link in the video description for the code I wrote and a copy of the schematic.
@michaelksiezopolski
@michaelksiezopolski 6 жыл бұрын
I am curious, Why instead of using two condition you are using such complicated interrupt system? I would detect the ground point just like you did and then detect the top point which will simply be ignored up until another drop point where I would calculate time interval and then reset counter and restart the loop waiting for another drop. It will reset itself every second rotation and it would not use INT0 and make a code way more simple and obvious. Detect first drop, detect first up, detect second drop, make time calculation, display result, reset timer, restart...
@craighollinger9972
@craighollinger9972 6 жыл бұрын
I believe this is how I'm doing it. I was using the INT0 pin as an ordinary digital input, but with some relatively simple code changes, the interrupt could be used. In this very simple case, the interrupt wasn't necessary, polling worked.
@binness
@binness 7 жыл бұрын
Brilliant piece of work thank you for all your trouble and for putting the code out, I realise that you had a slip of the pen with the hex, but that was only whilst you were under the pressure of talking to camera, who as not made mistakes in hex counting or binary or decimal, speaking of which the long number that you had misplaced, which caused you to work it out again, ie 10 to power 7 was wrong, your software got it right but you wrote 11,718,750, my calculation made it 1,171,875 again just another slip of the fingers, but overhaul you were spot on, so I thank you for your effort. Bob
@craighollinger9972
@craighollinger9972 7 жыл бұрын
Thanks!
@ericthered9655
@ericthered9655 7 жыл бұрын
I've seen guys do this with a few lines of code for Arduino. Is all this necessary for a falling edge signal or are you just starting more from scratch with your equipment?
@craighollinger9972
@craighollinger9972 7 жыл бұрын
I just prefer to work outside of the Arduino world. Usually makes my code more compact and run faster.
@navdeepsingh1126
@navdeepsingh1126 9 жыл бұрын
Sir,i have to calculate the distance. so as if we are getting rpm on evry 2nd pulse,so it will create problem in calculating distance as while calculating RPM, we are neglecting the distance between 2 consecutive pulses
@craighollinger9972
@craighollinger9972 9 жыл бұрын
Navdeep Singh Thanks for watching the video and my apologies for taking so long to reply. The microcontroller is too slow to respond to the magnet passing by every revolution. So what I did was to use the microcontroller to measure the time the magnet took to go around one revolution. From that time, the revolutions per minute (RPM) can be calculated. Even if this measurement was done, for example every 10th revolution, the instantaneous RPM (at that time) can be calculated.
@sentkum
@sentkum 8 жыл бұрын
Hi Craig, Thanks for the video. I found a small error. At around 16mins you tell that Timer1 is 16 bit but mention only 8 bit count(0xFF = Decimal 256) . A 16 bit counter would count from 0 to 65535 (0xFFFF). Could you please correct that ?
@craighollinger9972
@craighollinger9972 8 жыл бұрын
It was just a slip up on my part. The maximum count in HEX would be FFFF. Sorry for any confusion this may have caused.
@florin3161
@florin3161 3 жыл бұрын
hi so from you coment i shoud understand that max rpm counted will be 65535...or i undestand bad...
@jmitsch44827
@jmitsch44827 7 жыл бұрын
Why not just use the out put of the HALL Effect to trigger an opto-isolator 5v and then to the Arduino or perhaps a ATTiny 85 and then to the LCD. very interesting video stimulates my imagination and makes me want to fire up my soldering iron.
@craighollinger9972
@craighollinger9972 7 жыл бұрын
This probably wouldn't work. The Hall sensor doesn't have much current output, so it wouldn't likely operate most common opto-isolators. Thanks for watching.
@craighollinger9972
@craighollinger9972 7 жыл бұрын
The input to the opto-coupler is an LED and needs a certain amount of current to drive it. Connecting the Hall sensor directly to an opto-coupler would probably not work as the Hall sensor cannot source or sink much current. Another problem is the output of the Hall sensor sits half-way between the power pin (Vcc) and ground when no magnet is nearby. This was 2.5V (half of 5V) in my example and if the Hall sensor could produce enough current to drive the opto-coupler, the coupler would always be on. I used the opamp to remove this 2.5V bias. An opto-coupler could be used, but some interface circuitry would have to be put between the Hall sensor and the coupler to make it all work. It would end up in being more complicated that the circuit I presented. Good thought though. Do get out your soldering iron and start building stuff - good way to learn. Thanks for watching.
@contcont8454
@contcont8454 8 жыл бұрын
Hi help me My tacho is dead when I try to start with third battery and the generator fuze 60 is cut then I replaced the fuse and the cluster. But unfortunately is dead again that cost my alot of mony lm bankrupt with dead tacho.. My truck is hyundai65 No mcu on it .. Is the convertor 12v for radio cause thes or ETACS....THNKS sorry for my bad English
@oualisadok1281
@oualisadok1281 3 жыл бұрын
I want to ask if we could use such a sensor to make a joulemeter ?
@craighollinger9972
@craighollinger9972 3 жыл бұрын
You can. The sensor measures current (I). If you measure voltage (V), then you can compute watts (= V * I). The units of joules is watt-seconds (W * sec), so just measure the watts over a period of time. For example: if your device consumes 1 Watt for 1 minute, it has consumed 60 joules (1W * 60 seconds). I hope this helps. Thanks for watching!
@oualisadok1281
@oualisadok1281 3 жыл бұрын
@@craighollinger9972 very nice thank you for your answer :)
@renatosilvadecarvalho7144
@renatosilvadecarvalho7144 8 жыл бұрын
Hi, I'm a student from Brazil, and I've been whatching your videos, I wanna thank you for sending this videos, the tachometer explanaition helped a lot, with a little project that I've been working on it. I would like to ask you if possible, can you send me the codes that you used in your tachometer. I'm trying understand the code, but I can't see it properly
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Renato Silva de Carvalho Thanks for watching. Unfortunately I don't have anything set up where I could post my code. I'm planning on doing it sometime, but haven't had the time. Stay tuned.
@Enigma758
@Enigma758 Жыл бұрын
Why not simply use a comparator? One input biased to 2.5v, other input to sensor output.
@KAFA2020
@KAFA2020 7 жыл бұрын
Please could you explain the code with Arduino Language?It will be very helpful for my project
@craighollinger9972
@craighollinger9972 7 жыл бұрын
I only use Arduino as convenient break-out boards for the ATMEGA, I don't normally use the 'Arduino Language' (which is just the C++ language). My code is written in the C language and would have to be 'massaged' somewhat to make it work under C++. You could try the following to port my example tach.c code over to Arduino. I haven't tried this, so I don't know what would happen. - copy from my code all the #define statements and all the variable declarations to your Arduino file above setup() - copy from my code the code between the variables and the while() to you Arduino file into setup() - copy from my code everything in the while() loop and put it into your Arduino file in loop() The LCD driver (hd44780c.c) is available on my GitHub site. You are welcome to try it. This is where you may have a problem though, as it is not written in C++. You may want to use another LCD driver for your project. Good luck.
@KAFA2020
@KAFA2020 7 жыл бұрын
Peace be upon youThanks a lot
@craighollinger9972
@craighollinger9972 7 жыл бұрын
You are welcome! Let me know how you make out.
@electronmath8609
@electronmath8609 3 жыл бұрын
👍❤️
@leninkumar6263
@leninkumar6263 9 жыл бұрын
great explanation. i'm working out with this type of projects. so can i have this embedded c code. if possible please inbox me this code. thanks in advance.
@craighollinger9972
@craighollinger9972 9 жыл бұрын
Lenin Kumar Thanks for watching. Sometime I'll set up a place where you can download the code. Don't know when yet, just gotta find the time...
@ospinafox
@ospinafox 8 жыл бұрын
the most easy is to use the A3212 sensor
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Diego Ospina Thanks for watching. The A3212 may work for very slow RPM. It is heavily filtered to reduce jitter, but is too slow for most applications that I had in mind.
@tuberworksjones
@tuberworksjones 4 жыл бұрын
one thing i dont understand is the flag register intf0 . if it is set by writing a one to it , how is it also cleared by writing a one to it . Though this does correspond to the data sheet , but im a bit of aloss what is meant by it . Cheers folks
@craighollinger9972
@craighollinger9972 4 жыл бұрын
The flag register isn't as simple as a memory location in RAM. The MCU has some logic associated with the register to make it work that way. You'll find that most or all modern MCUs implement flag registers this way. Thanks for watching!
@ujjwalroy5052
@ujjwalroy5052 8 жыл бұрын
Can I do this on Atmega324P?
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Ujjwal Roy I had a brief look at the ATMega324 data sheet, and it looks like it would work as well. It shares many features and peripherals of the ATMega328. Thanks for watching.
@ujjwalroy5052
@ujjwalroy5052 8 жыл бұрын
+Craig Hollinger At 16:00 , you said 16 bit in hexadecimal would be FF, but isnt it FFFF and the decimal value of 65535?
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Ujjwal Roy Just a slip up on my part. Someone caught it earlier as well. See the comments below.
@Z-Ack
@Z-Ack 3 жыл бұрын
Couldnt you use a magnetic reed switch and just put the i/o values in the algorithm with the constants of the rpm conversion equation? Simple math... that way the length of 0v, rise dont matter.. woukd just have to figure out a good update length for the lcd readout.. kind of like how the cheap tachs work where they have a wire that wraps around a spark plug wire using either as an ammeter or inductive pickup and set up the tach in a menu to tell it whether it fires 1,2,4 times per revolution...
@craighollinger9972
@craighollinger9972 3 жыл бұрын
The video was more about the Hall effect sensor. The tachometer was just a demo. Thanks for watching.
@zachwasil
@zachwasil 7 жыл бұрын
now wonder nerds lead secret lives a world destroying demi-gods! This simple speed tester requires the intellect of aliens...at least from my point of view ;] Thanks for the high quality video letting me see into a magic world of electronic programming ;]
@craighollinger9972
@craighollinger9972 7 жыл бұрын
You are welcome and thanks for watching.
@Luke2311
@Luke2311 7 жыл бұрын
i can't understand english well, but more or less i understood
@josephcote6120
@josephcote6120 8 жыл бұрын
I don't know the system, so I don't know if this idea would be feasible or convenient. What I thought of at first was having a loop that sets the counter to zero then starts a timer and waits for it to finish. Timer based on how often you want the display to update. An INT on the falling edge would reset the INT and increment the counter then wait, Plenty fast for anything you'd like to count. When the timer ended, you take the value of the counter and multiply by whatever it takes to make the number of seconds 60 (if the timer was for 10 seconds, multiply by 6) There's your RPM value. Move that to your display. Back to the top of the loop, reset the counter to zero and start the timer again.
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+Joseph Cote That would be another way to do it. You can connect the pulses from the Hall sensor directly to the increment input of one of the counters (not sure which one, I'd have to look it up). Use another counter as a timer, say one second, when it times out see what count has accumulated in the first counter. That would give rev/second, do some math to convert to RPM. This is how a frequency counter works. I did a video on that - check it out. Thanks for watching.
@kali223laron
@kali223laron 8 жыл бұрын
thank you i am now smarter
@MrManobago
@MrManobago 8 жыл бұрын
Hi please how can i get the RPM with comma? example 5,5 RPM
@buder5116
@buder5116 4 жыл бұрын
10:23 funny the CurA say 8.80ms when the rpm is 880 xD whatever that CurA is
@craighollinger9972
@craighollinger9972 4 жыл бұрын
CurA (cursor A) is 8.8ms left of the trigger point or -8.8ms from the trigger. CurB (cursor B) is 58.8ms right of the trigger point. The difference between the two is 67.6ms, so there is a pulse from the magnet on the motor shaft every 67.6ms or 14.8 times per second. That means the shaft is rotating 14.8 times per second or 14.8 X 60 = 888 times per minute (RPM). This is how I figured out the RPM of the motor. Thanks for watching.
@miguelsaidhaddadchavelas7272
@miguelsaidhaddadchavelas7272 9 жыл бұрын
the hardware explication was amazing but for the software please be more specific because I lost the interest in the middle of the video thanks you are so brave
@craighollinger9972
@craighollinger9972 9 жыл бұрын
Miguel Said Haddad Chavelas Thanks for watching the video and hanging in there as long as you did. Software explanations can be quite long (and tedious) depending on the depth of detail. I'm trying to keep my videos down to a reasonable length, less than 45 minutes, so I tend to gloss over some of the software details. At some point I will set up a repository on-line so viewers can download my code and go through it at their own pace. Stay tuned.
@Z-Ack
@Z-Ack 3 жыл бұрын
Dont cough in microphones... loud as hell...
@craighollinger9972
@craighollinger9972 3 жыл бұрын
Sorry...
@scorpiuswireless1
@scorpiuswireless1 Жыл бұрын
Did you try using motor magnets to be trigger hall? It’s very obvious
@craighollinger9972
@craighollinger9972 Жыл бұрын
The magnets in the particular motor I used were stationary, they didn't spin.
@hatuan291
@hatuan291 8 жыл бұрын
Thank you so much
@hatuan291
@hatuan291 8 жыл бұрын
Thank you so much
@craighollinger9972
@craighollinger9972 8 жыл бұрын
+hatuan291 You are welcome!
Using a Hall Effect Sensor to Measure Current
21:10
Craig Hollinger
Рет қаралды 35 М.
Linear HALL effect SENSOR 49E #hall #halleffect #hallsensor
9:20
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 13 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 10 МЛН
Lathe RPM Meter using magnet, hall effect sensor and LCD Screen
17:44
Arduino Uno Tachometer RPM using 3144 Hall Effect Sensor
13:59
Clockatronic
Рет қаралды 101 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 2,9 МЛН
Complete beginner's guide to using a breadboard
21:23
Moritz Klein
Рет қаралды 130 М.
Designing Power MOSFET Circuits - Circuit Tips and Tricks
20:10
MicroType Engineering
Рет қаралды 329 М.
How to Use a Hall Effect Sensor with Arduino (Lesson #31)
19:48
Science Buddies
Рет қаралды 12 М.
Electronics 101: The Hall Effect explained
11:08
RCModelReviews
Рет қаралды 272 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 4,1 МЛН
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
Simple maintenance. #leddisplay #ledscreen #ledwall #ledmodule #ledinstallation
0:19
LED Screen Factory-EagerLED
Рет қаралды 2,5 МЛН