# Unable to receive RPM to display on LCD from NE555 pulse generator board using arduino

**URL:** <https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229>\
**Category:** Displays\
**Created:** [May 15, 2024, 11:21am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229 "2024-05-15T11:21:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaishnavi\_gunjal](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@vaishnavi\_gunjal](https://forum.arduino.cc/u/vaishnavi_gunjal)\
**Post date:** [May 15, 2024, 11:21am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/1 "2024-05-15T11:21:59Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/8/b/48b42a0d41c8d57109cc9e4fb1237fec32d9d7df.jpeg)  
using this module with arduino  
and also using the same code([https://www.youtube.com/watch?v=hhBe1gnvCC4](https://www.youtube.com/watch?v=hhBe1gnvCC4)) but on my LCD it only display 0 rather than to displayRPM

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 15, 2024, 11:23am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/2 "2024-05-15T11:23:23Z")

</div>

Welcome to the forum

Without seeing your code any schematic it is impossible to provide any help

Please post both

---

<div class="post-metadata">

**Author:** ![vaishnavi\_gunjal](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@vaishnavi\_gunjal](https://forum.arduino.cc/u/vaishnavi_gunjal)\
**Post date:** [May 15, 2024, 11:46am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/3 "2024-05-15T11:46:15Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/c/d/b/cdbaf8004d033d43b046f8f7a570118aa807a324.jpeg)  
this is schematic

---

<div class="post-metadata">

**Author:** ![vaishnavi\_gunjal](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@vaishnavi\_gunjal](https://forum.arduino.cc/u/vaishnavi_gunjal)\
**Post date:** [May 15, 2024, 11:48am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/5 "2024-05-15T11:48:20Z")

</div>

only difference is that rather than speed sensor i use ne555 module

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 15, 2024, 11:48am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/6 "2024-05-15T11:48:45Z")

</div>

I see that you decided to ignore the advice on posting code on the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use **code tags** (the \< CODE/ \> icon above the compose window)&nbsp;to make it easier to read and copy for examination   
  
[https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum)

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help

---

<div class="post-metadata">

**Author:** ![vaishnavi\_gunjal](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@vaishnavi\_gunjal](https://forum.arduino.cc/u/vaishnavi_gunjal)\
**Post date:** [May 15, 2024, 11:51am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/7 "2024-05-15T11:51:27Z")

</div>

```arduino
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd (0x27, 16, 2);

const byte PulsesPerRevolution = 1;
const unsigned long ZeroTimeout = 10000;
const byte numReadings = 1;

volatile unsigned long LastTimeWeMeasured;
volatile unsigned long PeriodBetweenPulses = ZeroTimeout + 100;
volatile unsigned long PeriodAverage = ZeroTimeout + 1000;
unsigned long FrequencyRaw;
unsigned long FrequencyReal;
unsigned long RPM;
unsigned int PulseCounter = 1;
unsigned long PeriodSum;

unsigned long LastTimeCycleMeasure = LastTimeWeMeasured;
unsigned long CurrentMicros = micros();
unsigned int AmountOfReadings = 1;
unsigned int ZeroDebouncingExtra;
unsigned long readings[numReadings];
unsigned long readIndex;  
unsigned long total; 
unsigned long average;
void setup() {
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
  attachInterrupt(digitalPinToInterrupt(2), Pulse_Event, RISING);
  delay(1000);

}
void loop() {
  LastTimeCycleMeasure = LastTimeWeMeasured;
  CurrentMicros = micros();
  if (CurrentMicros < LastTimeCycleMeasure) {
    LastTimeCycleMeasure = CurrentMicros;
  }
  FrequencyRaw = 10000000000 / PeriodAverage;
  if (PeriodBetweenPulses > ZeroTimeout - ZeroDebouncingExtra || CurrentMicros - LastTimeCycleMeasure > ZeroTimeout - ZeroDebouncingExtra) {
    FrequencyRaw = 0; // Set frequency as 0.
    ZeroDebouncingExtra = 2000;
  } else {
    ZeroDebouncingExtra = RPM;
  }
  FrequencyReal = FrequencyRaw / 10000;

  RPM = FrequencyRaw / PulsesPerRevolution * 60;
  RPM = RPM / 100000;
  total = total - readings[readIndex];
  readings[readIndex] = RPM;
  total = total + readings[readIndex];
  readIndex = readIndex + 1;

  if (readIndex >= numReadings) {
    readIndex = 0;
  }
  average = total / numReadings;

  Serial.print("Period: ");
  Serial.print(PeriodBetweenPulses);
  Serial.print("\tReadings: ");
  Serial.print(AmountOfReadings);
  Serial.print("\tFrequency: ");
  Serial.print(FrequencyReal);
  Serial.print("\tRPM: ");
  Serial.print(RPM);
  Serial.print("\tTachometer: ");
  Serial.println(average);
  lcd.setCursor(0, 0);
  lcd.print("RPM : ");
  delay(500);
  lcd.print(RPM);
  lcd.print(" ");

}

void Pulse_Event() {
  PeriodBetweenPulses = micros() - LastTimeWeMeasured;
  LastTimeWeMeasured = micros();
  if (PulseCounter >= AmountOfReadings) {
    PeriodAverage = PeriodSum / AmountOfReadings;
    PulseCounter = 1;
    PeriodSum = PeriodBetweenPulses;

    int RemapedAmountOfReadings = map(PeriodBetweenPulses, 4000, 5000, 1, 10);
    RemapedAmountOfReadings = constrain(RemapedAmountOfReadings, 1, 10);
    AmountOfReadings = RemapedAmountOfReadings;
  } else {
    PulseCounter++;
    PeriodSum = PeriodSum + PeriodBetweenPulses;
  }
}

```

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [May 15, 2024, 11:52am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/8 "2024-05-15T11:52:17Z")

</div>

Thank you  
Please remember to use code tags in future

---

<div class="post-metadata">

**Author:** ![vaishnavi\_gunjal](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@vaishnavi\_gunjal](https://forum.arduino.cc/u/vaishnavi_gunjal)\
**Post date:** [May 15, 2024, 11:52am UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/9 "2024-05-15T11:52:36Z")

</div>

yes afcource

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [May 15, 2024, 12:12pm UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/10 "2024-05-15T12:12:36Z")

</div>

Try adding

```arduino
pinMode(2, INPUT_PULLUP);

```

at the beginning of setup().

What do you see on Serial Monitor?

The code you copied was written by someone who is only a little more advanced than a beginner, it may need so many corrections that it might be better to delete it and write new code.

What will your final project be used for?

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [May 15, 2024, 12:32pm UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/11 "2024-05-15T12:32:38Z")

</div>

Which jumper frequency do you have on the 555 module?

---

<div class="post-metadata">

**Author:** ![photoncatcher](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/photoncatcher/32/221050_2.png) [@photoncatcher](https://forum.arduino.cc/u/photoncatcher)\
**Post date:** [May 16, 2024, 12:25pm UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/12 "2024-05-16T12:25:07Z")

</div>

Hi vaishnavi\_gunjal,

It might be interesting to consult the sketches here:

> **[Mendocino Motor and Arduino Nano: determining rotation speed](https://thesolaruniverse.wordpress.com/2023/02/04/mendocino-motor-and-arduino-nano-determining-rotation-speed/)**
>
> by Floris Wouterlood – February 4, 2023 — Summary — A Mendocino motor is a solar-powered, magnetically suspended electric motor. The first of its kind was constructed by a member of the…

Success, photoncatcher

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 12, 2024, 12:25pm UTC](https://forum.arduino.cc/t/unable-to-receive-rpm-to-display-on-lcd-from-ne555-pulse-generator-board-using-arduino/1260229/13 "2024-11-12T12:25:46Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
