hi guys
i am trying to make a function generator that display the frequency on an lcd
by using 555 time with arduino and measure the time HIGH and time LOW
- some calculation = frequency
and i came up with this schematic
the good thing that it worked on proteus 8
the bad thing that it didn't work in real life
so any help ??
and what the limit of frequency that the arduino can measure
The picture is lowres and very hard to read the pins on the 555 timer. Can you post it as an attachment instead?
A few things off the bat:
1.) Did you test the 555 timer circuit by itself? Does it output a clear pulsetrain?
2.) Are all the grounds connected?
3.) Where is your code?
4.) Do you have any pics of your physical circuit/Arduino?
i didn't test the 555 timer pulse shape (for noise ) (i don't have oscilloscope)
but i tested the circuit it self with an led it was working
2- the grounds is not connected together they are seperated circuits.
the code:
#include<LiquidCrystal.h>
LiquidCrystal lcd(4,5,6,7,8,9);
const int wave = 11;
float t1;
float t2;
float T;
float freq;
void setup() {
pinMode(wave,INPUT);
lcd.begin(16,2);
lcd.setCursor(2,0);
lcd.print("function-gen");
}
void loop() {
t1 = pulseIn(wave,HIGH);
t2 = pulseIn(wave,LOW);
T = t1 + t2;
T = T/1000000.;
freq = 1/T;
lcd.setCursor(3,1);
lcd.print(freq);
lcd.setCursor(11,1);
lcd.print("Hz");
delay(500);
}
The schematic doesn't even show labels or connections on the Arduino power pins. It is probably making an assumption that it's connected to ground and 5V power. You must put those wires in the real circuit for yourself.