Receiving Phone Number from Serial ht9032d CallerID

Hello this time I'm having this personal challenge. I have the HT9032d Calling Line Identification Receiver CMOS and it Works Perfect.

The data in Serial Monitor is constant a lot of garbage and a lot of UUUUUUUU when the call is coming

P(ÀP(À¡À-€…€T À…À¡%P…€PP(ÀP(À¡À-€…€T À…À¡%P…€P -
P(ÀP(À¡À-€…€T À…À¡%P…€P -ÀTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUÿ€11242013 04125449783`
À

À
@À@-ÀÀ€-A%À*

As we can see.

month 11
day 24
hour 20
min 13
Phone Number 04125449783

I can't find a way to clean the data only show the Number in my Serial monitor.

I'm using this very good tutorial but without LCD Display.

I really have enough knowledge and I have tried several days descrifar example but I understand that the code is made to show the number on the LCD . When I use full in my case I get is the following:

412A41FFFFFF95FFFFFFD0FFFFFFA15441FFFFFF95FFFFFFD0FFFFFFA55741FFFFFF8550FFFFFFA51541FFFFFF85FFFFFFD0FFFFFFA556FFFFFFC1AFFFFFFC16BFFFFFFC1FFFFFF95FFFFFFD0FFFFFFE758412A71

some help I will appreciate. Thanks

As usual, if you want help post YOUR code.

And please use the code button </> so your code looks like this and is easy to copy to a text editor

...R

Sorry but I only have this. and the example of the link:

#include <SoftwareSerial.h>

char SBUF0 = 0;
 
void setup()
{
Serial.begin(1200);
}
 
void loop()
{
  Ht9032_get();
}
 
 
void Ht9032_get()
{
  while (Serial.available() > 0)  
  {
  Serial.flush();
  SBUF0 = Serial.read();  
  Serial.print(SBUF0);
  }
}

With this I always been receiving garbage data. I dont know how I can catch only the important data.
Excuse me my lack of information in the first post.

Thanks

  Serial.flush();

Do you know what this function does? If so, please explain why you need to call it. If not, please explain why you are calling it.

Using Serial to talk to the PC and to some other device is probably confusing the hell out of the other device. It's best that you don't do that.

Since you are not saving the data, it is NOT going to be possible to do anything other than display all the data, important or not. If you were to store the data, you could display, or not, the stored data depending on whether it was important or not.

@willbeck, it looks as if you have your callerID device connected to the same serial that is used to communicate with the Serial Monitor.

Try creating a SofwareSerial port on two different I/O pins and connect your device to those pins.

The very poorly named Serial.flush() function is only used when sending data. It ensures that all the data in the output buffer is sent. It has nothing whatever to do with receiving data.

The examples in Serial Input Basics are simple reliable ways to receive data. They receive all the data before they try to show any of it.

...R

@Robin2 thank you very much my friend!! You help me to open my mind. I finally add a different Serial Port.

SoftwareSerial mySerial(10, 11); // RX, TX

and I use one of your examples to finally catch the important received data. Really for me learning the serial communication is very hard to understand. you too help me a days ago with Serial Data from PC to Arduino and EEPROM.. thank you very much

Thanks @PaulS for explain me about that.

Serial.flush();

I'm really Happy ;D now. I'm receiving the CallerID perfectly.

I have the same problem and this topic helps me a lot but unfortunaly it does't describe the solution. I also have problems to extract the phone number from the serial port. I have tried the examples but I cant get it work :confused:

With this code I can read serial monitor:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8); // RX, TX
char SBUF0 = 0;
 
void setup()
{
  Serial.begin(9600);
  mySerial.begin(1200);
}
 
void loop()
{
  Ht9032_get();
  
}
 
 
void Ht9032_get()
{
  while (mySerial.available() > 0) 
  
  {
  //Serial.flush();
  SBUF0 = mySerial.read(); 
  
  Serial.print(SBUF0);
  }
}

I get the some sort of output as the topicstarter.

Which start and stopbit do I have to use?

Are you sure that 1200 baud is correct?

Thanx for your answer. Yeah, I'm sure baudrate is correct. The serial buffer always give the same correct data.First a lot of thrash and then the correct date time and phone number. The problem is now to extract these number out of the trash.

Maybe this helps. It is based on the LinkSprite which uses the same HT9032 chip.

You may find something here also. I made my own telephone caller id system based on an Arduino Nano without using a specialist signal processing chip: Arduino telephone caller ID system - Exhibition / Gallery - Arduino Forum. In the meantime I have also built an ESP8266 version which includes an anti-spam filter and posts all call attempts to a web server. I'll be documenting it here as soon as I get some free time.

  while (mySerial.available() > 0)
 
  {
  //Serial.flush();
  SBUF0 = mySerial.read();
 
  Serial.print(SBUF0);
  }

The phrase "in one ear and out the other" comes to mind. You can not use data that you don't store. If you actually stored the data, then using the stored data would be trivial.

We had the same problem. but we found something working actually. this code actually filter whatever the data and print to console.

find code in below link