 So, the other day I built a signal generator with moderate levels of incompetence, I was going to also build the matching frequency counter to go with it, but didn't have time, so let's do that now. This is a cheap $10 frequency counter from Banggood, produced by GeekCrite. It's a kit which I need to assemble, and I have not opened this before other than to take this cable out, so let's have a look and see what we get. We have a PIX 16F68A microcontroller with a socket and the display for the frequency. What this is, it will measure the frequency of an incoming signal and then display it here, which I need for work on the flux engine. Bag for the components, a box and the PCB. The box is, it looks like exactly the same laser cut acrylic that I had such a difficulty with for the signal generator, which I'm going to demonstrate, which is here. The box fastens together in a rather unobvious way. I had difficulty figuring it out and I ended up having to glue it together. Some instructions that are probably in mangled English, a yellow double-sided PCB. This is interesting, compared to the other one, well the other one was a red PCB but the manufacturing was different. The pads were smaller and the holes were bigger, so yeah, I don't know what that will, how much effect that will be on the construction. Smaller holes should mean more secure component mounting. The acrylic case is just as usual, it does not appear to have the weird cog pattern in the holes that the bolts were supposed to screw into. So probably the bolts just go straight through in a much more conventional fashion. What we have here, some bags of capacitors, a socket, some diodes, a couple of transistors, a clock crystal, always a good sign for a frequency counter because that means it might be right. A button and a switch for the button, nice switch, good and clicky. Okay, what have we got in terms of resistors? Are all these the same? These all look the same, these are different, this one is different again, so you have three types of resistor, some ceramic capacitors, no electrolytics. This is the mount for the input signal, this is interesting, so you've got a socket and we've got three jumpers, I wonder if that's supposed to go together. Okay, let's take a look at the manual frequency counter installation instructions. This looks diode black in the negative, that seems all reasonably well, reasonably clear and translated, five volt voltage regulator, that'll be one of these. Two transistors and a U1, here we go, U2 and U3 NPN transistors, yep, oh boy, the welding installation considerations, follow these steps. The components are welding the front board from low to high principles, namely the first low welding components, yeah this is the same instructions as the signal generator. The welding microcontroller header and then welding triode button and power outlet. The back with the diagonal cutting pliers to cut short the pins as far as possible. Using the step, before measuring signal please switch J1 jumper cap, blue terminals for the in before measuring crystal, please switch the J1 jumper cap. Ah right, you can switch this between measuring the frequency of an incoming signal or measuring a crystal, that's cool, we have a circuit diagram, a QR code and nothing on the back. Okay, so, let's rearrange things a bit, right, well we need to go from low to high principles. First low welding components, crystals, capacitors, resistors, diodes, round hole of seats, okay, so let's try the resistors. We have three, six, nine of these resistors, our six to our thirteen, one K resistor. Actually I'm going to go with the lone resistor first, just to be on the safe side, stick it in my component tester, hundred K resistor, there should be a single hundred K which is R1 and R1 goes there, that's pretty good, it's a nice tight fit so the component stays put, okay, soldering iron is hot, leaded solder, did not feel like a good joint, that's fine, good. The next step, let's go for these three, these are, these are probably the ten K resistors labels here, just be on the safe side, ten K, R2, R3, R5, R2 is here, so what this is is a PIC microcontroller based device, it will count pulses on the signal, there will be some analog electronics to actually couple it with the signal, it is a very small computer, I actually have a programmer, I'm not sure it will work on PIC, if I really wanted to I could probably reprogram this to do something else, which I probably don't want to. PIC assembly is kind of weird, I've done a little bit of programming in it, this is a PIC 16 I believe, yeah that's an interesting choice, I wonder why they didn't use a 12 which is smaller and cheaper, so the PIC instruction set is extremely peculiar, it's got a handful of bytes of memory mapped to registers so it doesn't really distinguish between IO devices and RAM, it's got depending on which version of the PIC you're using the instruction set varies from 11 bits, maybe 12 bits up, so the program held in flash uses a weird width of flash memory, I think it's 14 actually, so trying to actually copy programs into RAM which is 8 bits wide is very peculiar, R2, R3, where is R3, R3, R2, R5, I need R5 next, where is R5, R2, diode, R4, no that's a 1K, where is R5, bunch of resistors here, capacitor, capacitor, clock crystal, capacitor, jumper, jumper, capacitor, R4, now I want R5, there it is, right it's pretending to be a diode, a row of diodes with the resistor next to it, so now I want to put in all the 1K resistors which should be all the rest and again just double check, helps if you plug it in, 1K, 1003 ohms, I have no idea how accurate that thing is, I suspect not very but it is very good as a quick and easy sanity check to make sure I've done everything right, R4 is a 1K resistor, okay, all the other resistors go in this bank up here I believe, this is 3, 6 and 8, yep 8 of them, R6 to R13, so R6, R7, I'll get this one a bit straighter, R8, it doesn't matter which way around you put resistors but just for needless, let's have all the stripes lined up the same way, it's not very neat, R9, having all the stripes lined up the same way also makes it more obvious if the wrong resistor gets in the mix, put all the components in so that we can solder all the legs together in a group which is substantially simpler and easier and quicker. The last three is R11, R12, R13, R11, this is R12, so looking at the, ah yes, looking at the circuit diagram which is just off the top of the screen so you can't see it, these are the resistors for the 7-segment display LEDs, you notice that there are fewer resistors than there are segments, LEDs are not ohmic devices which means the current through them does not vary in proportion to the the resistance so you have to have a resistor in series with an LED to keep the current under control otherwise you blow the LED and you may notice that the there are eight resistors but the 7-segment display has a lot more than eight LEDs in it because each digit is made out of eight LEDs, seven for the digit itself and one for the dot and the way this works is that probably only one digit is displayed at a time and the pick will rapidly cycle through all the digits displaying each one in turn for a brief moment of time and persistence of vision means that you can't actually tell this it looks like a constant display but it means that because only eight LEDs are ever energized at one time you only need eight resistors and just as importantly far fewer connection to the module okay let's remove some of these wires that should be all the resistors component legs are worth keeping it's amazing how frequently a short piece of stiff wire comes in handy so that was all the resistors I think next I'll do the diodes as they are smaller than the other components and we do after all have to go from low to high principles so here are the diodes let's just sweep this away a bit diode are polarized they only go in one way around so now it says on the instructions d1 to d5 diode black in the negative so these are these diodes here and d1 there I assume that the stripe matches up there is a black stripe one end of the diode which is the negative side so we can actually using the trusty testing tool yes the arrow indicates the direction of current flows so the black is the negative side it'd be nice if the pcb actually had a plus or a minus on it but there is a stripe marked so diode and now we do the other four this bank here so the diodes for be these four here I can't tell off the top of my head they are connected to a transistor they're also connected to the lines for the led the internal resistors on picks are the internal transistors on picks are quite powerful so they use a lot for powering leds so I just wonder what this transistor is for the transistor is connected to the led bank so maybe that is to do with powering the led display anyway let's get these diodes mounted not very elegantly I have to say all the black stripes through the top so it's time to do the soldering that one moved slightly when I was as I was soldering it the joints seem to be all right so that would be the diodes what we've got next are oh yeah the unpolarized capacitors these little brown things and they're all different so the instructions I've got two point one micro farad capacitors labeled 104 one 102 22 p 22 pico farad so we've got a 104 a 102 22 that's probably the 22 p that's another 104 another 22 22 yeah there are four of these 22s right so let's do the 102 that's the old one that is c6 c6 is here it's even more or less upright yes that does say 102 and it is in c6 the 104s go in c1 and c7 so c1 is here and c7 r is next to it actually so right next to u1 here uh I'm not going to do those I'm going to work sideways let's go with c2 c2 is the 22 p I wonder what this 22 p is it is a not known yeah I don't know what that is and neither does the machine so 22 p in c2 yes that goes in here next to it is c3 that is another 22 p then we get to c7 which is a 104 and then we get u1 what is u1 it is a five voltage regulator five voltage regulator 7550-1 that would be one of these uh packages that's a so it's a 58050 right that's an npn transistor 58050 therefore they must be this one 7550-1 yep I assume it goes this way around judging by the shape of the silk screen it would go in like this wouldn't make any sense the other way around uh looking at the tracks I can see this is where the barrel connector goes I can see the ground is connected to this bottom pin our voltage to the middle pin and the output five volt is going to is from the top pin so that seems to make sense okay be nice so if there's a little bit more assistance on the board yeah there is I'm doing them in this order is so that I have space to work I don't have to solder components between two other components right c1 is the other 104 that's this one this c1 here is a smoothing capacitor between ground and the input voltage yeah yeah these are both smoothing capacitors c1 this one is smoothing before regulation and c7 is smoothing after regulation what they do is they soak up any spikes or glitches in the power supply voltage so that the voltage that the pic the processor sees is reasonably level k so there are only two more capacitors which are these 22s and these must be c4 and c5 which are here right again there are three components in a row so I will do them in that order now I happen to know from the the circuit these two capacitors are used by the clock which is this clock crystal the clock provides no the clock crystal provides the frequency reference that drives the pic and also is used to and is used to measure the frequency and you need a clock crystal and two capacitors so that's c4 and c5 here that's going to fall out if I turn the board over and clock crystals are fairly fragile so I actually need to be careful with this they are also unpolarized it doesn't matter which way around I put it he says just after he checks the circuit diagram which I should have done before I actually soldered the thing on but never mind the last capacitor and remove the wires I am not sure why these are sticking to the wire cutters because these wires are supposed to be copper and copper it's not magnetic maybe it's just that the wire cutters are slightly sticky these will not be the greatest components they'll be sourced from fairly low-end manufacturers but there's isn't that cutting huh they managed to solder two wires together interesting okay so we've got a lot of stuff what do we have left you've got two npn transistors and these are identical they are both 58050s they are what does the component test to think they are it's a diode um yeah transistors and diodes are pretty similar so I'm not surprised it gets that wrong and these would go into u2 and u3 I'm going to assume that the rounded side matches putting those up a little right solder what's next we have the input and output terminal which goes here uh but we also have j1 so let's put that on first j1 is three pin jumper cap that will be this I assume it's that yes this goes on here and immediately falls out now we can put on this this is the screw terminal for the input signal that goes in spoke too soon I need the tape again a crystal tester this is the socket here for attaching a crystal if we had the if this worked I could then demonstrate using the crystal that this uses but I wouldn't be able to because I wouldn't be able to test that crystal without removing the crystal and then it wouldn't work makes sense really I actually one think I might have a crystal somewhere that's worth a try rapidly running out of components which is what I like to see right that has not worked right the crystal has the socket has moved when I plugged the thing in so it's actually standing a bit proud of the board fixing this is going to be tricky because I need to melt all three connections simultaneously ow and then burn myself or you know that looks fine it'll do so here is the jumper it's one of the same jumpers with a tag on it for easy access the function generator used uh what is left well not much really we've got the barrel connector for the power big thick chunky pads that take a while to heat up okay that's reasonably level I think this board is noticeably better than the other one it the solder is wicking through the wires very nicely uh what do we have next well there's the socket for the processor uh we have the dimple indicating the top which matches the diagram the image on the sub screen so that will go on here and let's tape that down it'll work very well what do we have I can prop this up on that will do yeah just one solder spot is enough to hold it in place notice that one of the pads that one there is square that's another way to mark pin one on the chip all the pins that looks fine okay so we now I have the lcd module the lcd module is u4 led displays by screen printing layer now I would rather like it if there was a socket for this but there isn't so I'm just going to have to solder the thing directly to the board this means that if I get it wrong I will never get it off again at least intact also the pins are not quite going through the holes they don't quite line up with the pcb that is luckily tight enough that it fits right double check it's the right way around you see the dots on the lcd module are on the bottom which they are here and solder time should now be firmly soldered in place never to be moved again and there is only one more component which is the switch which is here the switch is this one s1 switch s1 regardless of the polarity so this goes on here whoops that stays in place reasonably well yeah this is working really well the solder is easily melting and flowing smoothly into the the holes the holes are plated on the inside just as with the other board because it's a double sided board so yeah that's good that's it that's all the components so all we need to do is attach the button insert the chip the right way around bend the legs together a bit not quite that far do not know why the legs of chips are always a bit splayed because it makes them hard to fit into the sockets the software for the chip has been pre-programmed i hope so now all we need to do is to plug it in and see how it works which i should just do all right so here we have the signal generator that i built yesterday and this is connected to my bench power supply at 9.4 volts because this needs nine volts to run and it's configured for a sine wave and with some random stuff this however is plugged into usb and producing five volts so we plug this in here and see what happens it's a number is that showing up on the screen no on the camera let's try that it says 0.144 so if i adjust one of these knobs very nice this is fine this is coarse we don't know what the scale is oh hang on i've missed mr step mr step i need to insert the cap uh this the jumper this needs to be here to say that i want to measure a signal zero uh does the button do nothing much intriguing so looking at looking at the instructions it does say uh before measuring signals switch j1 jumper cap blue terminals for the inf signal input yeah that's this one so why is that registering zero is the amplitude not enough for it to register it was working with with the jumper removed ah yes i forgot about this all these knobs are backwards so if we turn this clockwise the amplitude goes down so that wants to be there for maximum amplitude so if i turn this clockwise the frequency increases i assume this is megahertz it doesn't register anything 200 400 i think what's happening is as the frequency goes up the voltage goes down and eventually this stops measuring it so what about this one 30 kilohertz maybe this one these do seem to be powers of 10 oh yeah there is actually a label right 1 to 10 hertz it is measuring in kilohertz not megahertz so that is 0.3 kilohertz so if i stick this up to this one this is the 100 to 3 kilohertz range so that is 500 hertz yeah i don't really follow what this is doing it's showing a number which i hope is showing up on the screen is that better so it says 0.216 oh yeah i can do this too much better at least for me uh so this is going down the minimum rate the minimum level is 140 odds that must be 140 hertz so we turn the knob up and that's fine this one's course 200 300 400 and suddenly the number drops off interesting uh let me make a small adjustment so this is currently connected to the sine wave output for the signal generator so let's put it in this one this is the square wave output and if anyone actually watched the other day's video the square wave the amplitude is always about 10 volts so this is showing 6700 and that stops let's try it with the jumper in i don't know what the button does let's power cycle it see what happens that's better numbers quite small the knobs seem to have no effect on the reading that says 0.19 but it's changing this is the 10 to 100 hertz range so that is registering seven hertz if it's measuring kilohertz so one end of the range is seven and the other is 19 yeah i haven't i don't think this is doing anything particularly useful the numbers just seem to be randomly in under debugging steps check the ic weather against such as anti please timely correction who knows what that means after the check the electricity the fourth digital tube displays zero said the installation was successful so if i unplug this fourth display is registering zero well that was an adventure i do finally have it working as you can see by the 0.2 registered here and i'm going to explain what the problem was and why i need this extra board with the help of my trusty oscilloscope which should be appearing up there somewhere so currently it's showing a flat zero volts that just means noise this is what the signal generator is producing and you can see that there's a pretty hefty dc offset of about uh four and a half volts and it turns out that as i thought the frequency counter requires the signal to cross zero volts before it is counted so in order to remove the dc offset i need to decouple the signal to remove the dc offset which i do using a decoupling capacitor and a resistor to bias the output towards zero uh this is what the frequency counter is actually seeing and you can see that the dc offset has been mostly removed it's going from about plus five to about minus one volts uh you can change the amount of offset that is removed by changing the value of the resistor the smaller the resistor the closer the result will be to zero unfortunately the smaller the resistor the smaller the output signal so if the output signal gets too small the frequency counter just can't count it anymore this appears to be a reasonable compromise it's crossing zero enough it's going negative enough that it's actually managing to count i can adjust the amplitude so if i reduce the amplitude to here you can see that the counter just stops being able to count it and starts producing gibberish so let's crank that back up until about there that's the point where uh it starts to clip so that does seem to be working this is registering in kilohertz i found the manual the slow flashing decimal point indicates that the result is in kilohertz so we're seeing about a 200 hertz signal and i can wind that up you can see the frequency increase and it counts and if we go that's over a kilohertz it's two and a bit kilohertz we have the jumper here in the hundred hertz three kilohertz range so that's up the top of the range that's pretty good let's go up a step and adjust the oscilloscope to get more of a signal so the we still have the slow flashing dot it's still in kilohertz so we can continue to wind this up and eventually uh we get a fast flashing dot which according to the manual means something else but that is still reading in kilohertz interesting that goes up to 40 ish it says 65 on here what's the next range up to 72 right the the see that's now flashing even faster it's supposed to indicate the uh the unit it's measured in but i think the manual is wrong and all it's doing is registering which uh digit the ones digit is so the decimal point is always showing kilohertz that's 120 kilohertz oh wrong way uh that's showing on the oscilloscope a 10 about a 10 microsecond peak between two successive waves and this goes all the way up to this says a megahertz that says 650 kilohertz which i reckon is about right the as you wind the frequency up on this the amplitude goes down so it's only just going negative yeah so that was weird but uh now that i've sorted out what's happening that seems to be fairly plausible i believe that the dc offset on the signal generator is intentional you're supposed to use a capacitor to decouple it and you need quite a big capacitance and i believe the dc offset is there so that you can use one of these polarized electrolytic capacitors because you can guarantee that this side is a higher voltage than this side and because these things are polarized and have to go in the right way around this makes life easier if there wasn't dc offset you wouldn't be able to use an electrolytic and you'd have to use a much more expensive uh non polarized capacitor so yeah i believe that works so there's only one more bit to do which is to assemble the case i have taken all the brown tape off the uh perspex because that's really boring so let us unwire this and put it together and let's have a look and see what the result looks like not sure what i'm going to do about the need to decouple it i suppose ideally the uh the capacitor and the decoupling resistor would be adjustable and somewhere on this i might need to build a board i'm not really into pcb manufacture unfortunately it should be easy enough to make one so how does this go together this is clearly the bottom this is clearly the top because this goes over here so i believe that it just bolts onto the uh bolts onto the bottom sheet so that would probably be the small bolts to be honest the frequency counter seems rather more useful than the signal generator given the slight weirdness of the signal generator and i'm probably going to have to put the side pieces on this box before putting the board on let's just double check that this has the notch on it over here yeah this is got the notch for the output so that means that this one goes here and this one goes here okay right i can do that without needing to take the board off so let's do the rest of these bolts up these laser cut acrylic cases are primitive but effective the the lugs of the dc jack project more project further than the other uh pins so in fact the board they're touching the acrylic and the board is bending so i might need to be a bit clever how many bolts did they give us 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 right i know this is supposed to work hopefully i'll make a bit less of a dog's dinner of this than i did the the box for the frequency counter which is now held together by glue right the way i believe this works is that that these bolts go on here and these then form the stands that hold the pcb off the bottom of the case and now i'm looking at it i wonder if i'd be better off with the bolts on the top and the screws going up let's just try putting it together and seeing how big things are so you see then this goes on here and the more bolts hold the pcb on so it's actually going to stand on these uh yeah let's actually take this apart for the bolts on the other way up so it actually has to go assemble this way up this time and then the bolts that hold the top of the case on will go the other way and that will form four nice feet for the thing to stand on i hope the board then sits on like this okay that does go on i thought for a moment that the bolt wouldn't go round because of the the led unit next to it but in fact it does go on across i want these two tight all right so that seemed good and solid now we put these on at the side where the the connector here you have the side for the power jack is that going to go on there we go there we go the two blank sides this goes on top there we go there we go right so these bolts go through like this they seem to have given us more more nuts than were really required but not enough for two nuts in the spacer because if the board was supposed to come up another a row of nuts you'd need a four extra but in fact we only have two and looking at the way that the looking at the size of the case there's clearly no not enough room for an extra for nuts this is the right size okay that it's not moving smoothly so so we appear to just have three extra i suspect they just put a handful in the bag and didn't actually count them all right there we go in a fairly neat box we have the jumper for the i've got to be careful because this is actually the nine volt supply this is the five volt supply yes this is the jumper that selects between measuring this the frequency of a signal measuring the frequency of a crystal when the when this is in the bottom two holes it actually connects a pull-up resistor and bypasses the circuitry the oscillator circuitry for the crystal when you pull it out to disconnect the pull-up resistor and then when you put it in the top row it hooks up the oscillator i don't actually think i have a crystal spare to try i had a look uh the button is actually for the user interface which is well you press and hold it and you get this menu which allows you to do various things no psu i believe this turns it sets it to power saving mode so it doesn't it stops measuring if there's no signal add and sub allow you to do offsets for measuring differences in frequencies it's apparently useful for shortwave radio which i know nothing about zero uh yeah that undoes an add or a sub table is something to do with crystals and quit just goes back to uh frequency measurement mode i cannot imagine anything i want to do involving the user interface at all i just don't need any of those features it's interesting that they managed to actually get a complete menu into a single button it uses short and long presses to do things which is amazingly cheap but yeah that is the frequency generator there's actually appear to be no problems with this whatsoever all the trouble i had was due to the signal generator and its dc offset which i wasn't expecting i would probably recommend this i may not recommend this now i know more about it i mean it's perfectly functional it's just it's got some rather odd built-in assumptions was it worth ten dollars yeah i reckon so now it's put together and bolted it's a decent decently solid box it seemed to do the job i do actually have a high precision one kilohertz signal source which is part of the oscilloscope that i tried it on and it registered 1.000 yeah anyway now i have a frequency counter i hope you enjoyed this video let me know what you think in the comments