arduino frequency counter
You could do right. What could you make that’s kind of cool with just a couple parts like this? Well, what if you made an incredibly tiny frequency counter, it’s a lot easier than you may think so, let’s zoom in and we’ll put it together. Let’S start by taking five volts from our Arduino to the five volt rail and the same thing with ground from the ground rail to the ground, pin on the Arduino now let’s hook up our OLED VCC to our five volt rail and ground to our ground. Real SCL to a 5 and SDA to a four, so there we have almost all of our connections made in less than a minute couple. More connections let’s take another round from the bottom here, because we’re gon na need something to attach our signal to and we’re gon na read the signal on: pin Digital five so I’m just going to poke that in there so that we can put some alligator clips On it, that’s it that’s the whole thing: let’s go check out the code, then we’ll come back and play here’s. The code for Arduino macro frequency counter now here are the notes. Signal needs to be logic, level. High five volts low, zero volts input can only be on d5 and you will not be able to use analog right on three nine, ten or eleven. Now, this library, that we’re, using here frequent creek count dot, h, there’s a link here where you can find it by this guy, whose parents gave him a fantastic first name to install said library.
You need to go to sketch, include library, managed library, the wait for the thing to finish its duty duty and type in here, hello, I’m typing. Thank you, and there you’ll see it here. A freaking account now there’s also a freak major, which is, if you’re, looking at signals below a killers. So your choice. Alright, so we have three includes wire, which we need because we’re using I squared C for our lid, the Adafruit SSD 1306, which is a driver for our OLED and frequent freak count, which we just talked about, that OLED driver requires an OLED reset it’s on pin 4, which is the default blah blah blah, then we’re gon na create an instance of the Adafruit SSD 1306 library called display using the argument. Oled reset then we’re down into our setup, where we’re going to begin. The display with the command display began SSD 13’s, which six switch cap VCC, which is some black magic that lady ADA did here’s the key if you’re not using an Adafruit OLED. This is probably going to be your hex address. Oh x3, see if you’ve got a new OLED that you bought from far off lands and it’s, not working. Try adding that little bit to your setup, then display display will show the Adafruit logo Baskin. What is Lady ADA’s glory enough basking will clear the display, and we will begin our counter now down here in the main loop of the program.
We just simply say if frequency count is available, do all this. Well, what does all this first we’re going to create a float called count and it will be populated with what’s in the frequency read. That will be your count now, we’re going to create a float called period period, which is the inverse of count, and then we always clear the display we’re going to set our text size to 1, because we’re displaying a lot of crap here display sec text color To white, because it’s, the only color available cursor to the upper left will print our header skip a line then will print the the header for the line, which is frequency and some spaces, so everything lines up nice and Purdy and then display print count, which is Our frequency right after that will print the frequency in Hertz. So if we’re at 50, kilohertz you’re gon na see fifty thousand Hertz, if we’re at five make your you see, five million Hertz display print okay on our Hertz is a print line. So we dropped down a line. Then we do display print period, which is our next calculation and we print the period times 1000, which turns it into milliseconds. We display the milliseconds and then we show everything in the buffer and that’s it let’s go play with it. Alright I’ve got my function, generator all nice and set up and it’s running. You can see. We are outputting a 10 kilohertz square wave of 5 volts, so let’s grab some connectors and hook this up to our Arduino.
Sorry about that might have been a bit of a rough trip there, alright first of all, let’s power up the Arduino, since the code is already uploaded there. We have our Adafruit Industries splash and our frequency counter. Now this flickering, you see, is created entirely by the camera. When you look at this in real life, there is no flickering, so I attach our ground lead there and our frequency pin here and there you see we have 10000 Hertz frequency and 0.1 millisecond period. So if I adjust up, there is 80000 whoops hold on wrong channel. Try this again there’s 80000 and we just down all works very nice. Now what I’ve done is. I have synched this to to zoom out there won’t. We, when I got switched over to channel 2 it’s a hand on there. We go so there’s channel 2 on the scope show in our signal and if we bring up the major window we can see we have our period and our frequency and everything jives very nicely with what we’ve got here. So how about that? A very, very simple! Arduino frequency counter super small, I mean if we take a look at the size of this thing. The whole thing from one end to another is two and three quarter inches or what’s 7 centimeters battery power. This thing put it in a small plastic case and you’ve got the world’s smallest portable frequency counter. I like it, I think it’s pretty cool.
arduino frequency counter Video
arduino frequency counter news
Posted on Thursday September 12, 2019Frequency Counting A Different Way Hackaday … Continue Reading »
Posted on Wednesday January 02, 2019Frequency counter and crystal tester kit: 1 Hz – 50 MHz Elektor … Continue Reading »
Posted on Thursday May 23, 2019Improving A Cheap Frequency Counter With GPS Hackaday … Continue Reading »
arduino frequency counter Social
🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr