Go Down

Topic: Receiving Phone Number from Serial ht9032d CallerID  (Read 6047 times) previous topic - next topic

willbeck

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

http://www.es.co.th/Schemetic/PDF/HT9032.PDF

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.

http://learn.linksprite.com/arduino/teach-you-how-to-use-call-id-module/#tab-1422715137030-4-9

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

Robin2

As usual, if you want help post YOUR code.

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

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

willbeck

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

http://learn.linksprite.com/arduino/teach-you-how-to-use-call-id-module/#tab-1422715137030-4-9


Code: [Select]
#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

PaulS

Code: [Select]
  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.
The art of getting good answers lies in asking good questions.

Robin2

@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
Two or three hours spent thinking and reading documentation solves most programming problems.

willbeck

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

Code: [Select]
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.

Code: [Select]
Serial.flush();

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





BokkieWokkie

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 :smiley-confuse:

With this code I can read serial monitor:


Code: [Select]
#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?


wildbill


BokkieWokkie

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.

6v6gt

Maybe this helps. It is based on the LinkSprite which uses the same HT9032 chip.
https://bigdanzblog.wordpress.com/2015/05/22/testing-linksprite-caller-id-module-based-on-ht9032-with-a-pc/

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: https://forum.arduino.cc/index.php?topic=490392.0. 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.

PaulS

Code: [Select]
  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.
The art of getting good answers lies in asking good questions.

UIshara

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

https://drive.google.com/open?id=1FSQ4cX0bOWzSsCNIzuYEDNcswOsuMhMd

Go Up