Пікірлер
@inside.rama_adis
@inside.rama_adis 2 ай бұрын
From a hundred code i found, only from you that can work. Thanks a lot 🙏🙏🙏🙏
@Xavi-Tenis
@Xavi-Tenis 3 ай бұрын
Really a good code , you just got on the spot, Can i asq for help, im trying to made the same but for two readers rpm, but my code not work, if any can clear my mind, im lost. Or if you want you can tellme a price and if i can iwill pay you.? Ñ float revolutions=0; int rpm=0; // max value 32,767 16 bit long startTime=0; long elapsedTime; float revolutions2=0; int rpm2=0; // max value 32,767 16 bit long startTime2=0; long elapsedTime2; void setup() { Serial.begin(9600); pinMode(2, INPUT_PULLUP); // set pin to input pinMode(3, INPUT_PULLUP); // set pin to input } void loop() { revolutions=0; rpm=0; startTime=millis(); attachInterrupt(digitalPinToInterrupt(2),interruptFunction,RISING); delay(1000); detachInterrupt(2); revolutions2=0; rpm2=0; startTime2=millis(); attachInterrupt(digitalPinToInterrupt(3),interruptFunction,RISING); delay(1000); detachInterrupt(3); //now let's see how many counts we've had from the hall effect sensor and calc the RPM elapsedTime=millis()-startTime; //finds the time, should be very close to 1 sec //now let's see how many counts we've had from the hall effect sensor and calc the RPM elapsedTime2=millis()-startTime2; //finds the time, should be very close to 1 sec if(revolutions>0) { rpm=(max(1, revolutions) * 60000) / elapsedTime; //calculates rpm } if(revolutions2>0) { rpm2=(max(1, revolutions2) * 60000) / elapsedTime2; //calculates rpm } String outMsg = String("RPM :") + rpm; Serial.println(outMsg); } String outMsg = String("RPM2 :") + rpm2; Serial.println(outMsg); } void interruptFunction() //interrupt service routine { revolutions++; } void interruptFunction() //interrupt service routine { revolutions2++; }
@AusMarineRobotics
@AusMarineRobotics 3 ай бұрын
Thanks for this - needed exactly this to test the RPMs on a bunch of brushless motors and this is simpler and more stable than an IR sensor👍
@Xavi-Tenis
@Xavi-Tenis 3 ай бұрын
thanks!
@eonreeves4324
@eonreeves4324 3 ай бұрын
you could make ignition timing systems with this
@doliwsef
@doliwsef 4 ай бұрын
As someone who doesn't know much about electronics, I understood the function. However, I have a further problem. I need a 0 to 10V signal to control a diesel engine. No speed 0V 4000 revolutions 10V. Can you tell me how I can make this happen?
@AvrCdavr
@AvrCdavr 4 ай бұрын
This was very useful. Ive been trying to find out a way to convert one complete rotation of my stationary bikes wheel into 1 mouse click and this seems like a great way to do it.
@michaelshakib7777
@michaelshakib7777 5 ай бұрын
I want to try and use this to detect if my generator has started. Using AC out isn't suitable for my situation so this just might work!
@SlotSpoilsSlotCarTracksi-hb5ml
@SlotSpoilsSlotCarTracksi-hb5ml 5 ай бұрын
Hello, thanks for the vid, would the sensor work if placed near a spinning 12v small motor ? thanks in advance
@madjidgacem5474
@madjidgacem5474 6 ай бұрын
Excellent video, do you think such a component can stand a car engine temperature, in case i place it inside a car distributor ?
@kennypaul100
@kennypaul100 7 ай бұрын
Great video. Have you tried soldering with this? I bought one of these to solder microphone leads and I can't get it to melt the solder on the contacts. It seems hot enough when I touch the solder wire on to the iron but it seems that it hasn't enough power to keep hot enough when trying to solder to the contacts. Can you recommend a good soldering iron without breaking the bank?
@clockatronic
@clockatronic 6 ай бұрын
Hi Kenny, I did use it for a week or two but I found exactly the same as you - plenty of heat but not much melting power. I'm guessing the issue's down to the trashy tips. The iron I have now is an Antex XS25, which I find to be great. We used posh temperature controlled Weller irons at work for years and these were good, but the XS25 seems pretty much as good except for more chunky solder joints that need a bit more power.
@dapilot9408
@dapilot9408 7 ай бұрын
Is it possible to use an esp32 instead of arduino uno? If yes can you post a sketch?
@MintyLoveDMT
@MintyLoveDMT 7 ай бұрын
Yes, I imagine an ESP-32 would have a much higher measurable range than an arduino, what with having a much higher clock speed. When I next get one of my ESP32s out I'll knock up a sketch and publish it. Right now this utube channel is somewhat mothballed as I have another and online presence that is taking up all my time. But one day....
@wdwhitmer
@wdwhitmer 7 ай бұрын
One of the most useful, interesting, and straightforward video. A hidden gem 💎
@clockatronic
@clockatronic 7 ай бұрын
Thanks mate, appreciated!
@rickyrac77
@rickyrac77 7 ай бұрын
Good day! My QC 15 R side speaker isn’t working , is there a way to find out whether the replacement will work or it’s a circuit board issue ?
@clockatronic
@clockatronic 7 ай бұрын
Hi Ricky, that's a good point actually. I think the chances of the problem being the headphone speaker are probably higher than the board, unless you have any reason to think otherwise. The speakers do seem to go faulty after a while seemingly owing to fatigue of the internal wires feeding the cone. I now have a pair of QC-35s and I'm expecting the same trouble with those too at some stage. When my QC15 fault occurred, it was fairly obvious the problem was in fact the speaker. When I removed the dust cover on the inside of the earcup and gently pressed on the speaker cone, the sound would come back to life (probably re-joining the broken wire contact). In fact I actually used the headphones for a while with a piece of folded paper inserted between the cone and the plastic cone protector cone. Of course this is, at best, only a temporary fix. Good luck if you do choose to go for a replacement.
@tonyfremont
@tonyfremont 8 ай бұрын
You really did a good job on this video. If you'd like, I can give you some code that uses the input capture feature of the Arduino. This ability, takes snapshots of the timer register, every time the pin gets a pulse. In the ISR, it only copies the timer value to a circular queue, after calculating the difference from the last pulse value. This means the queue contains period timings, in microseconds usually, but you can get to about 125nS resolution, iirc. At main level, you just pull entries from the queue at your leisure (reasonably, the queue is only so big). The mathematical inverse of the period time is revs per second, just multiply by 60 to get RPM. These measurements are sub microsecond and perfectly measured by hardware, even if you're in the middle of another ISR, it still takes the snapshot right when the pulse edge occurs. Its a great feature of the atmega chips (and others), but the Arduino framework doesn't use it, because it precludes the use of a couple of PWM pins. If you can live with that, its the absolute best way to take precision measurements of pulse timings. Input Capture is the way to fast RPM updates and precision accuracy. Theres a little more to it, like it uses pin 9 for the input pulse pin, you cant change that. Timer overflows occur every 32mS, so that's handled by another ISR for really long pulses. The capture ISR factors in the rollovers when it's calculating the time interval since the last pulse interrupt. I wrote the code about 15 years ago, so ill have to dig up a copy. Its not much, just some register manipulation in setup() and some in the interrupt handlers, but its really small code and lets you capture pulses as short as 15-20uS, yes microseconds, not millis. delay() and millis() are okay for many things, but precision isn't one of them. Edit: I'd really like to see this method documented in a KZbin video, but I'm not gonna make one. 😊 I did it for some guy on the Arduino forum wayyy back. People rarely suggest it, though it's the most accurate way, and very little coverage of using it on Arduino exists on KZbin, that I know of anyway. I first did this with a pic chip about 20 years ago, to time mechanical clocks and watches. I wanted serious accuracy, and this is how you get that. I would be more than willing to talk to you about it further, if you're interested. For all I know you already know all this, but wanted to keep it simple, and I'm making a complete fool of myself. ;-)
@clockatronic
@clockatronic 8 ай бұрын
@tonyfremont Thanks Toni, much appreciated. In fact this is the first I've heard of this input capture thing, so if you have some example code I can look at I'd certainly be interested. Maybe a link to a shared drive, or you can send me a mail on [email protected] if it's more convenient. As regards a video about input capture, well no promises but if it fills a gap in the usual utube arduino references then this is something that might well induce me to launch another. As you can see, I've mothballed the Clockatronic channel at the moment, most of my time goes into another channel unrelated to electronics, but it'd be good to put out a video here every now and then. So yes, thanks again and loom forward to hearing more.
@tonyfremont
@tonyfremont 8 ай бұрын
​@@clockatronicI tried posting a link to it, but KZbin removed the comment. So I sent you an email. :-)
@tonyfremont
@tonyfremont 8 ай бұрын
​@@clockatronic #include "Arduino.h" volatile unsigned t1captured = 0; volatile unsigned t1capval = 0; volatile unsigned t1ovfcnt = 0; volatile unsigned long t1time; volatile unsigned long t1last = 0; #define BUFFER_SIZE 32 volatile unsigned long int buffer[BUFFER_SIZE]; volatile byte head = 0; volatile byte tail = 0; void setup() { Serial.begin(9600); TCCR1A = 0x0; // put timer1 in normal mode TCCR1B = 0x2; // change prescaler to divide clock by 8 // clear any pending capture or overflow interrupts TIFR1 = (1<<ICF1) | (1<<TOV1); // Enable input capture and overflow interrupts TIMSK1 |= (1<<ICIE1) | (1<<TOIE1); pinMode(8, INPUT); // Feed the signal in here } void loop() { byte newhead; if(head != tail) { newhead = (head + 1) % BUFFER_SIZE; Serial.println(buffer[newhead]); head = newhead; } } ISR(TIMER1_OVF_vect) { t1ovfcnt++; // keep track of overflows } ISR(TIMER1_CAPT_vect) { unsigned long t1temp; // combine overflow count with capture value to create 32 bit count // calculate how long it has been since the last capture // stick the result in the global variable t1time in 1uS precision t1capval = ICR1; t1temp = ((unsigned long)t1ovfcnt << 16) | t1capval; t1time = (t1temp - t1last) >> 1; t1last = t1temp; tail = (tail + 1) % BUFFER_SIZE; buffer[tail] = t1time; }
@Robertoayon
@Robertoayon 9 ай бұрын
2 notes: - One of the screws is longer than the other 3. - Be mindful of the screws when handling them, otherwise the speaker magnet will eat them up and it’s a pain to rescue them.
@clockatronic
@clockatronic 9 ай бұрын
Thanks! Good points to note
@EliSpizzichino
@EliSpizzichino 10 ай бұрын
I'm sure you did all this to show your wife what real work really is to make a salad! On the serious side I'm wondering if the delay(1000) impacts the performance by not slowing the reading speed
@dlouhyjohnny6810
@dlouhyjohnny6810 Жыл бұрын
Hi this is perfect, however i have one issue with it. Since it only takes measurement every second it doesnt rly represent perfectly the actual real time spinning speed. And if i take a measurement every 0,5s then it wouldnt be accurate. So i was thinking, do you have an idea on How we could use this maybe with another hall sensor on the opposite side of the wheel so that we can take measurements more often ? And How would the code have to be changed if we added the second sensor. Thanks for replies !
@dlouhyjohnny6810
@dlouhyjohnny6810 Жыл бұрын
We could probably Just measure it the same way we are doing now and add both halls together But then devide by two so lets Say it measures 4000 magnet passes every minute so we would devide that by two to get 2000rpm. The benefit of this would be that we could count more often which would help quite a lot on a big wheel like a 20inch or more. Especially with 2,3,4 or even more hall sensors (But maybe theres an even better way i havent thought of so feel free to reply)
@clockatronic
@clockatronic Жыл бұрын
@dlouhyjohnny6810 Well sounds like you're thinking and coming up with some interesting ideas, so good work on that - and thanks for sharing your ideas. I wonder if instead an extra hall sensor, an additional magnet on the wheel which might simplify any software changes. I think the limiting factor will be the ability of the arduino to keep up with the twice-per-revolution interrupt calls, so perhaps a faster board (like the ESP-32 which can also be programmed with the Arduino IDE) might be better suited. But you're absolutely correct of course, the emphasis on this tacho is simplicity and in truth it could be improved in many ways to suit individual applications. Thanks again!
@rolandberendonck3900
@rolandberendonck3900 Жыл бұрын
What a lovely video. I subscribed and looked for any other video's because you are really entertaining and creative. And then I noticed you only uploaded three video's. I am sure people, including me, would really like to see more of your type of content. Cheers mate 👍
@clockatronic
@clockatronic Жыл бұрын
Thanks @rolandberendonck3900 , I appreciate the encouragemen to think again about more videos. In fact I have uploaded more, but they're embarrassingly bad, attracted almost zero views so I've made them unlisted. But for sure, this tacho video has done unexpectedly well so publishing more videos is certainly a very tempting option in the future at some point - and I do have a few ideas. But right now my time is devoted to my psychedelic healing online presence (utube channel - www.youtube.com/@MintyLoveDMT/videos ) and Discord. However, it as I say, it certainly remains an option to resurrect the Clockatronic thing, and potentially a lot less hassles involved! All the best!
@rolandberendonck3900
@rolandberendonck3900 Жыл бұрын
@@clockatronic Thank you for your answer and I will have a look at your other channel too than. I myself am trying to get more acquainted with PID controlling. That's why I had so much fun when you used a simple lettuce centrifuge for your project 😂
@BETA3605
@BETA3605 Жыл бұрын
Wonderful video. We'll done. Great application of HALL sensor
@fn22739
@fn22739 Жыл бұрын
Hey man, I was going to ask if I could use the code in your video for a arduino mph speedometer im working on and upload a video on it using your code for the rpm? Thanks.
@clockatronic
@clockatronic Жыл бұрын
Hi mate, I don't think you need my permission, but in any case I have no objections at all, just pleased that it's being put to good use. Good luck with the video!
@FPChris
@FPChris Жыл бұрын
Awesome video. A great help
@XenonJohnD
@XenonJohnD Жыл бұрын
Thanks. Just used this in combination with a switec micro-stepper motor wired directly to 4 of the other pins so the same Arduino Nano now also drives a dial pointer on an antique RPM gauge for a hot rod. Whole assembly contained inside the original gauge housing, just plug in a USB lead for power from a phone power bank and can also use it for debugging. Really neat.
@clockatronic
@clockatronic Жыл бұрын
Great idea, thanks for sharing!
@oswaldocunha9455
@oswaldocunha9455 Жыл бұрын
Hi ! Very creative demonstration congratulations. I am trying do use an inductor combined with 3144 to create an output when much than expected current flows trough this bobin . Initial tests (with a powerful magnet ,shows that minimum lag is 1,20 mseg wich is to long for my application ,Would you have some solution to minimize this time ?
@Nordic_Goon
@Nordic_Goon Жыл бұрын
Awesome explanation of this particular hall effect sensor. This should get me up and running on a lathe I'm converting to CNC. ***EDIT*** It worked perfectly. I have one of these sending 1 pulse per revolution on my lathes spindle to LinuxCNC as my index phase since my encoder is mounted 3:1 gear ratio with pullies due to size constraints and not being able to fit another pulley the size of the spindle inside the cover. This resulted in the index pulse being sent 3 times per rev, which can't be corrected in the LinuxCNC HAL file. This worked out so perfect. Thanks for the clear details on everything.
@clockatronic
@clockatronic Жыл бұрын
Great stuff Master, thanks for sharing. Delighted it's found a use in your workshop!
@RahulSingh-fl6bf
@RahulSingh-fl6bf Жыл бұрын
Great video! Does anyone know what strength/type of magnet I should use? I plan to drill a magnet into a skateboard wheel to measure rpm
@arduinomaquinas
@arduinomaquinas Жыл бұрын
Nice, very cool❤🇧🇷😉👍 "@arduinomaquinas" thanks you 👏👏👏👏👏👏👏 subscribed
@MarcoPono
@MarcoPono Жыл бұрын
Thank you so much!
@wsip82
@wsip82 Жыл бұрын
Cool! Well done!
@clockatronic
@clockatronic Жыл бұрын
Thanks!
@melodicachan
@melodicachan Жыл бұрын
la mejor explicacion que encontre, ademas fue entretenido y con ejemplos reales
@ezyhobby4889
@ezyhobby4889 Жыл бұрын
nice video.. but i need more of it. lets say I want to maintain the RPM value of the engine. so if the RPM drop below 600 the arduino will command a servo to pull up the throttle. and release the servo if RPM reach above 600. can you help me to program that? thanks in advance
@clockatronic
@clockatronic Жыл бұрын
Well it certainly sounds doable, although in practical terms it might not be a trivial exercise getting it so responds quickly enough but still doesn't overshoot/undershoot, and also maintains a fairly constant RPM without continually "hunting". Apologies, but at the moment I'm afraid I don't really have time for one-to-one assistance. I've done it before from this channel and it can be very interesting, but also extremely time consuming. Maybe one day that will change but for now I'm devoting my time to another different channel. However, I wish you luck!
@Edmorbus
@Edmorbus Жыл бұрын
thanks for sharing
@clockatronic
@clockatronic Жыл бұрын
My pleasure
@striper8400
@striper8400 Жыл бұрын
Thanks for the tutorial, helped with my application, I was a little concerned when you fired off the mower with you foot partially under it though.
@clockatronic
@clockatronic Жыл бұрын
Haha, thanks mate. Yes, I didn't even realise I'd done that til afterwards!
@3216ben1
@3216ben1 Жыл бұрын
What if I want a faster refresh as 1 second isn't that great, also what if I use more than one magnet (exactly on the other side of rotating thing) What do I need to change in code for that to happen? I plan on using 4 magnets and 150 delay seems pretty smooth, not sure about the mathematics on how to correctly change numbers
@akikhan45
@akikhan45 Жыл бұрын
Thank you for helping me understand, i am working on arduino with some sensors. But i got stuck in codes logic, your explanation help me understand everything. Lol Now i feel that have information sensor in my mind that illuminate with your video.
@clockatronic
@clockatronic Жыл бұрын
Glad it helped
@chartreuse.o..3
@chartreuse.o..3 Жыл бұрын
Thank you for your work ! However I have some questions because I did not manage to make my system work : I need to calculate the speed of a RC car so i have to measure the rpm of one wheel.... I took your codes with a Arduino uno, and a ST022 Hall effect module, I followed the cable connections. The program is charged in the card. I put a magnet on the wheel, made it spinning while placing the sensor close to it. But nothing it coming out of it : the serial monitor returns me " RPM : 0 ". I've tried both sides of the sensor but nothing changed. I hope you can help me
@clockatronic
@clockatronic Жыл бұрын
Hi Anton, sorry to hear that. I'm not familiar with that hall effect module - would you be able to post a link to it? Or if the comment containing the link gets removed by utube, perhaps a fuller description so I can take a look.
@chartreuse.o..3
@chartreuse.o..3 Жыл бұрын
@@clockatronic thanks for your answer, I finally tested the sensor with a multimeter connected to its ground and the output and it seems that this is the sensor itself that is not working... Have a nice day
@clockatronic
@clockatronic Жыл бұрын
Good work!
@charlesgunzelman3323
@charlesgunzelman3323 Жыл бұрын
Thanks a ton for this video. The LED indicator trick helped me determine 2 of the 3 Hall sensors in my 13kw PMAC motor's Encoder circuit were bad.
@clockatronic
@clockatronic Жыл бұрын
Thanks Charles, much appreciated that you took time out to share that. Always gives me a buzz to hear how the videos might be of help to anyone.
@TOMTOM-nh3nl
@TOMTOM-nh3nl 2 жыл бұрын
Thank You, for the tutorial. Is it possible to measure the presence of 220 volts using the hall effect sensor?
@clockatronic
@clockatronic Жыл бұрын
Not that I know of Tom Tom. As I understand it, non-switching hall effect sensors can be used to measure DC current as on some clamp multimeters, I'm not familiar with whether this same thing can be achieved with AC.
@Slimey3DPrinting
@Slimey3DPrinting 2 жыл бұрын
Hi, i have a question, which parameter should I change in order to put the sensor output on a different pin? (For example 9)
@clockatronic
@clockatronic 2 жыл бұрын
Good question. Unfortunately we're restricted to connecting the hall effect sensor to the Arduino's interrupt pins, and on the Uno this means either digital pins 2 or 3. If you wanted to change to 2 from 3 then as well as the wiring change just update the following lines so that 2 is replaced with 3 pinMode(2, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(2),interruptFunction,RISING); detachInterrupt(2); I tend to use the Arduino Mega 2560 Pro for most of my projects these days, not only does it have a lot more memory, it has interrupts available on pis 2, 3, 18, 19, and when not used for I2C communication pins 20 & 21. So just a whole lot more versatile. Best wishes!
@Slimey3DPrinting
@Slimey3DPrinting 2 жыл бұрын
@@clockatronic Thank you so much, I've got a Pro Micro, and i couldn't understand why only those two pins worked. I asked because pins 2 and 3 are the I2C communication pins, and i wanted the sensor on a different pin so that i could use an LCD or an OLES display. I guess I'll just go with an Arduino Uno. Thanks for the info man, keep up the good work 💪
@jlucasound
@jlucasound 2 жыл бұрын
I like your dedicated bread board LED with built in resistor and jumper lead extensions. I have not seen that yet. I will definitely be making one. Thank You. You get a Thumbs Up and a Sub for that!! 😁
@zyroxiot9417
@zyroxiot9417 2 жыл бұрын
👍🏼🇧🇷
@guillermotierhs6245
@guillermotierhs6245 2 жыл бұрын
The Best!
@conversationwithgod272
@conversationwithgod272 2 жыл бұрын
Nice explanation...great effort..you are great.Thanks
@occrc3333
@occrc3333 2 жыл бұрын
I want to use a similar setup for a Arduino based RC car. Great video
@DavidLee-it7zl
@DavidLee-it7zl 2 жыл бұрын
Great info. Love your work. I had to add this to the code to get it to work but got it uploaded. Thought id paste it in case you or anyone else needed help. #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif pasted just above the if statement with the max function. Mine wouldn’t compile but the above fixed it. Keep up the great videos. You were super easy to understand and I immediately subscribed. Now let's see if this works.
@clockatronic
@clockatronic 2 жыл бұрын
Thanks fella, curious that you needed to define the max function, but thanks for sharing your innovative solution. Maybe if you tried #include <math.h> it might help to get the max() back working who knows. Appreciate the kind words, although I've kinda mothballed this channel in favour of my psychedelics channel at the moment kzbin.info . One day I might start making content for this one again as I still have much interest in the subject. Best wishes and thanks again.
@pb6198
@pb6198 2 жыл бұрын
Hmm, very useful, but how would you do this without delays. I need to read multiple hall effect senors at a high rate
@geoffkelland5606
@geoffkelland5606 2 жыл бұрын
Nice!!
@clockatronic
@clockatronic 2 жыл бұрын
Thank you! Cheers!
@gerardogama6045
@gerardogama6045 2 жыл бұрын
Does that apply with the ss41 sensors?
@ctrmint
@ctrmint 2 жыл бұрын
Any idea of the maximum switching frequency of the sensor? Thanks
@clockatronic
@clockatronic 2 жыл бұрын
Good question. Based upon the rise/fall times as specified on the 3144 datasheet www.digchip.com/datasheets/parts/datasheet/029/3144-pdf.php they should be good for upwards of 100kHz, which would theoretically work out at > 6 million rpm I guess the practical limitation of the setup as covered in the video would be the Arduino, and TBH I'd be surprised it actually read the mower correctly. In fact I still have that mower and have since seen a little sticker on it stating the engine as fixed speed 3000rpm. If there was much interest I could build a simple divide by 10/100/1000 counter to extend the range of this circuit to handle regular motor vehicle and even model car motors etc. Best wishes!
@jmemusic
@jmemusic 2 жыл бұрын
Nice video, thanks for sharing. I was looking how those sensors are used to detect speed and your video showed it nicely. In the future, I would like to modify some organ pedals I have and somehow measure the speed that the person operating them uses to touch the pedals. This is translated as the volume of the note.
@clockatronic
@clockatronic 2 жыл бұрын
Sounds like an interesting project.