# My next project :frequency counter \[SOLVED\]

**URL:** <https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169>\
**Category:** Arduino\
**Created:** [13 January 2021 03:11 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169 "2021-01-13T03:11:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [13 January 2021 03:11 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/1 "2021-01-13T03:11:35Z")

</div>

have this hardware : i just found this at core :  
1: [https://core-electronics.com.au/uno-r3.html](https://core-electronics.com.au/uno-r3.html)

which has Arduino ATMEGA328P on it and` i am looking for an l.c.d panel` to build it with  
.

this is the project circuit project details:page here of what i want to build …

> **[Arduino Frequency Meter Using 16x2 Display | Homemade Circuit Projects](https://www.homemade-circuits.com/frequency-meter-circuit-using-arduino/)**
>
> In this article we are going to construct a digital frequency meter using Arduino whose readings will be showcased on a 16x2 LCD display and will have a measuring range \[…\]

I have a few Arduino books for the programming side of things but mot of all need the L.C.D…the local suppliers dont have a good match that i can find maybe core holds my answers…???

 ![IMG20210126055118](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/7/7027058dadc16b283e6438dc080f38c464dd7a8d.jpeg) ![IMG20210126064319](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/439fccca40fd7380806bc9dd988229fae203fa7d.jpeg) ![IMG20210126064310](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/44fb8d6d7d0cca83b2b96f8a7498e995146f0de6.jpeg)

so i did remove the lcd from its original board… also the code that was explained in the text is the one i flashed into it… so the code and library are fine…i used arduino-ide to flash it with…

:: my next step to clean it up and make it neat  
picking up one of these type boards this week it will simplify my project,and fit the uno much easier …the need for a new housing is increasing …now…looking around to nite just may order a new rpi-4 plus whatever i need … a nanosond case only 20 od will suit me fine i may only get a 2 gig board this time and stick an high speed thumb drive into it or a wd-black ssd nvme to sata bridge still throwing ideas around but want both a new board housing …but still get this meter finished etc…etc…etc…

ok so i need to buy some header pins to populate my prototype Arduino board that i found then mount and fit the lcd using some spacers and do some wiring,as you can see i have two pots one does the text brightness and the other does the back lighting. both pots are 10 k linear the back-light voltage i used was the spare 3.3 volt rail and i have to pick up an 7404 to make the filter cct… as well no biggy i will implement this into the bread board… clean it up mount an …B.N.C female socket on it an provide proper capacitive de-coupling if the need be…  
also the readout only measures Hz ,if some body could pls help me modd that part of the code it would ber great … i have seen it up to 10 digits long well into Mhz range…  
i put a 555 timer cct i had laying around onto it and just fed it with a square wave varied the pot for higher frequency and up it came 10 digits long… maybe it will go further not shore exactly… ::  
i would like it to read Khz…and adjust for mhz when it changes frequency as the range differs … simply it does have a decimal point in the code but might need adjusting as well…i will add a drawn schem later…ok…but basically pin 15-16 16 is negative led and 15 is positive led…for the back light i just wired it via a 10 k pot did not use a divide cct just because i wanted to get it running…will prolly modd that before i draw a schem of what i have done…should have 10 turn 10 k pots around here somewhere…

 ![IMG20210126141615](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9df2466427495f3a3f1cfeedc4c1af0ac63efd7a.jpeg) ![IMG20210126141534](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/1/1fa3e9b785c4a145e9b0c902ea60de40fc9963c0.jpeg) ![IMG20210126141606](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/f/fca2eeb2473f94d9eab6030ecf22b66e32f5ea8e.jpeg)

:i will try modd the code my self … time permitting… but it does work and for now that is the main thing …  
still work to do…

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [13 January 2021 03:26 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/2 "2021-01-13T03:26:20Z")

</div>

Hey Brian,

Looks like they’re using a DFRobot LCD - DFR0009. Here’s our product listing for that one:

> **[LCD Keypad Shield For Arduino](https://core-electronics.com.au/lcd-keypad-shield-for-arduino.html)**
>
> This is a very popular LCD Keypad shield for Arduino or Freeduino board. It includes a 2x16 LCD display and 6 momentary push buttons. Pins 4, 5, 6, 7, 8, 9 and 10 are used to interface with the LCD. Analog Pin 0 is used to read the pushbuttons. The...

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [13 January 2021 03:34 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/3 "2021-01-13T03:34:19Z")

</div>

yes that is the replacement the one that they are using is much less complex …thx…looking into it though

maybe i could code the buttons to switch between fan tacho outputs.yellow wire i have 3 fans on my rpi-4

yes Oliver i like that one simple is best…

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [13 January 2021 03:36 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/4 "2021-01-13T03:36:43Z")

</div>

Here’s a simpler 16x2:

> **[Assembled Standard LCD 16x2 + extras - White on Blue](https://core-electronics.com.au/assembled-standard-lcd-16x2-extras-white-on-blue.html)**
>
> Standard HD44780 LCDs are useful for creating standalone projects. This product is similar to Adafruit's Standard LCD 16x2 display but comes with the header soldered on! .. read more

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [13 January 2021 03:43 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/5 "2021-01-13T03:43:31Z")

</div>

Hey Brian,

Here’s another suitable display you could use in your project if you’d like to learn how to use I2C to communicate with various devices.

> **[Gravity: I2C 16x2 Arduino LCD with RGB Font Display (Black)](https://core-electronics.com.au/gravity-i2c-16x2-arduino-lcd-with-rgb-font-display-black.html)**
>
> Accustomed to the same LCD screen, do you want to have a different experience? DFRobot LCD1602 will bring you a new visual feeling, It is not the same as the previous .. read more

As for getting to know all the tricks and script styles I’d check out the workshop below. There are also some specific tutorials on the site if you want to know more about PWM, I2C, SPI, etc.

> **[Arduino Workshop for Beginners - Tutorial](https://core-electronics.com.au/tutorials/arduino/arduino-workshop-for-beginners.html)**
>
> Welcome to the Arduino Workshop, where you'll be able to follow our guided course which covers everything you'll need to know in order to create your own Arduino projects and become a leveled up maker. My name is Sam and along with being a maker...

Please let us know if you need any help with it!

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [13 January 2021 03:51 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/6 "2021-01-13T03:51:05Z")

</div>

i like this case to go with it

> **[Slim Case for Arduino Uno](https://core-electronics.com.au/slim-case-for-arduino-uno-r3.html)**
>
> This is a slim and sleek case for your Arduino Uno R3. The Slim for Arduino Uno offers protection from short circuits while still allowing full access to the pins. Made by us, in Newcastle.

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [13 January 2021 03:53 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/7 "2021-01-13T03:53:09Z")

</div>

after thoughts i think i may go with this display having the switches coded into the sketch program  
lots of options here … but simple steps first …code is not my specialty

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [14 January 2021 02:37 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/8 "2021-01-14T02:37:23Z")

</div>

Sounds good Brian!

Make sure to let us know if you have any questions. 👍

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [14 January 2021 07:05 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/9 "2021-01-14T07:05:48Z")

</div>

thx most likely code i would say i have a sample sketch that was written for it  
but i would like to be able to make use of the switches on the lcd panel .  
to switch between the fans if i have several of them going… like often i do run at least 2 when i`m cpu o/clocking…etc

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [18 January 2021 09:19 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/10 "2021-01-18T09:19:59Z")

</div>

i went with the dfr0009 seems the one used is not a stocked product and the replacement from core but i cannot seem to match the correct cables to the lettering of the connectors to the l.c.d. the sketcth program verified and ran and uploaded ok but i just dont know how to wire it to the uno any help would be appreciated

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [18 January 2021 21:01 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/11 "2021-01-18T21:01:16Z")

</div>

ok i read the manuals for the said hardware…it sort of helped me …i think i need to get some jump wires as it does not seem to be easy 4 me …you just cannot plug the l.c.d into the Arduino board and expect it to function and just program the uno and expect it to work unless the code i flashed needs to be modified…it will take me quite some time to decipher and work the code out on my own …so i need some help below is the code i flashed into the Arduino the code size is approx 5000m from mem or 5 k…  
so i do indeed need some help here…also in the notes if you read my project the code is there…so also it has a trimpot in one cct and this does what the onboard trim pot does so some wiring or should i say some reconfiguration of it needs to be done …a fair bit of work to modd not that it is a huge amount rather just the know how…maybe i may have to contact core via phone…i`ll hold back for a while and see if somebody has any suggestions for me.. i have some bread bords around i have to dig them out..i`ll mount the lcd onto it if the need be…thx

i think this part of the code needs modding …from what i have read but not exactly shore

```
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

```

Program:

```
//-----Program Developed by R.Girish-----//
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int X;
int Y;
float Time;
float frequency;
const int input = A0;
const int test = 9;
void setup()
{
pinMode(input,INPUT);
pinMode(test, OUTPUT);
lcd.begin(16, 2);
analogWrite(test,127);
}
void loop()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Frequency Meter");
X=pulseIn(input,HIGH);
Y=pulseIn(input,LOW);
Time = X+Y;
frequency=1000000/Time;
if(frequency<=0)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Frequency Meter");
lcd.setCursor(0,1);
lcd.print("0.00 Hz");
}
else
{
lcd.setCursor(0,1);
lcd.print(frequency);
lcd.print(" Hz");
}
delay(1000);
}
//-----Program Developed by R.Girish-----//
```

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [19 January 2021 00:56 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/12 "2021-01-19T00:56:25Z")

</div>

Hi Brian,

Why do you think that this section of the code would need modification? The pinout should still be the same on that LCD module as when it was first designed, and the LCD library shouldn’t be causing any issues either. Do you get any error messages when attempting to upload this to your board?

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [19 January 2021 01:01 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/13 "2021-01-19T01:01:44Z")

</div>

no it seems to flash ok …no issues there,um the green and orange lights are solid on after the code is flashed  
thinking next week i will just buy one of these…

> **[Assembled Standard LCD 16x2 + extras - White on Blue](https://core-electronics.com.au/assembled-standard-lcd-16x2-extras-white-on-blue.html)**
>
> Standard HD44780 LCDs are useful for creating standalone projects. This product is similar to Adafruit's Standard LCD 16x2 display but comes with the header soldered on! .. read more

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [19 January 2021 01:09 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/14 "2021-01-19T01:09:55Z")

</div>

Hm,

Can you please try running a different script (even just blink or a script that outputs to the terminal) to ensure that the board is running correctly.

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [19 January 2021 01:12 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/15 "2021-01-19T01:12:34Z")

</div>

i can run blink ok i flashed it to the onboard yellow led…

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [19 January 2021 01:20 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/16 "2021-01-19T01:20:31Z")

</div>

Okay that’s good,

I’m not sure what else we’re able to do here. The LCD should be running straight away with that script flashed properly and with the appropriate libraries installed. Other than adjusting the pot on the board to make the LCD more visible, there’s nothing else that should need to be done to that script. Let us know how you go with the other one, it’s quite unlikely that the LCD/Arduino that was originally received was faulty, but I’m not sure what’s causing the issue in this case.

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [19 January 2021 01:22 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/17 "2021-01-19T01:22:56Z")

</div>

i`m in a lot of pain today …i have a snapped L-5 so i dosed on meds today…going to start fresh 2 morrow  
i tried the pot but it makes no difference only brightness on the display  
but i do get a top row of blank squares…so i dont know …i tried just hooking the pins to the ardiono but that did not work either

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [20 January 2021 05:17 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/18 "2021-01-20T05:17:23Z")

</div>

> **[TFTGraph](https://www.arduino.cc/en/Tutorial/LibraryExamples/TFTGraph/)**
>
> Open-source electronic prototyping platform enabling users to create interactive electronic objects.

i have done this before but without bread board.  
it uses the spi bus basically …adusst the the pot and the display changes…it may not be the exact same flash as i used it was a few yeras ago …have toi pick up somr jump wires next week…will be pretty shure there is nothing wrong with my uno…as for the screen i brought with it i am un shure exactly as yet…

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [21 January 2021 19:18 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/19 "2021-01-21T19:18:46Z")

</div>

Present findings i think the photo is self explanatory…

 ![IMG20210122060048](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/913aed8277c959bbf7764b04e9ad8c06d8760ced.jpeg)

can you tell me about my next hurdle the l.c.d screen that came with my order…please…  
i`ll try re-flashing the code and take a pic of it …sorry 4 the delay…

---

<div class="post-metadata">

**Author:** ![brian86770](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@brian86770](https://forum.core-electronics.com.au/u/brian86770)\
**Post date:** [24 January 2021 12:52 UTC](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169/20 "2021-01-24T12:52:07Z")

</div>

i forgot to bookmark the pages i found that the l.c.d screen that i got from you guys or my project… and needs to be modded code wise…my notes i got told were sent to your r@d dept…i was chatting on your help pop up …i was told my code was not matching the lcd i brought

if somebody from core could pls post the web links i gave to i think Oliver or Owen not shore exactly whom i was chatting to…it contained test code links…  
to web sites for the direct l.c.d its self  
from mem i discovered that the lcd was an Hitachi i discovered…it was about last Friday or thursday thanks…sozz for this .interruption…i will attempt to modify the coding…

[Next page](https://forum.core-electronics.com.au/t/my-next-project-frequency-counter-solved/9169.md?page=2)
