https://github.com/kerogs/ks_tea5767
TEA5767 FM radio module via I2C, including frequency setting, PLL status, RSSI value retrieval and signal stereo mode detection.
https://github.com/kerogs/ks_tea5767
arduino library sourcekit tea5767
Last synced: 8 months ago
JSON representation
TEA5767 FM radio module via I2C, including frequency setting, PLL status, RSSI value retrieval and signal stereo mode detection.
- Host: GitHub
- URL: https://github.com/kerogs/ks_tea5767
- Owner: kerogs
- License: mit
- Created: 2024-06-21T22:01:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-22T18:07:33.000Z (over 1 year ago)
- Last Synced: 2024-12-25T02:21:56.348Z (about 1 year ago)
- Topics: arduino, library, sourcekit, tea5767
- Language: C++
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The KS_TEA5767 library facilitates easy integration and control of the TEA5767 FM radio module via I2C communication. It includes functions for setting the frequency, retrieving RSSI values, detecting stereo mode, and checking PLL status, offering comprehensive capabilities for managing FM radio functionality in embedded systems.
[](https://github.com/kerogs/KS_TEA5767/releases/latest)


## Installation
1. Download the library as a ZIP file from the [latest releases](https://github.com/kerogs/KS_TEA5767/releases/latest).
2. Open the Arduino IDE.
3. Go to `Sketch` > `Include Library` > `Add .ZIP Library...`.
4. Select the downloaded ZIP file.
## List of functions
| Function Name | Input Parameter | Returned Parameter | Description |
| -------------- | -------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------- |
| `getPLL` | None | `bool` | Checks if the PLL is locked (`true` for locked, `false` for unlocked). |
| `getRSSI` | None | `int` | Returns the Received Signal Strength Indication (RSSI) value. |
| `getRSSIdBm` | `int rssi` | `int` | Converts the RSSI value to dBm scale and returns it. |
| `getStereo` | None | `bool` | Checks if the radio is in stereo mode (`true` for stereo, `false` for mono). |
| `getHex` | None | `String` | Returns the status bytes received from TEA5767 in hexadecimal format. |
| `getASCII` | None | `String` | Converts the status bytes received from TEA5767 to ASCII characters. Non-printable characters are replaced with ".". |
| `setFrequency` | `float frequencyMHz` | None | Sets the frequency of the TEA5767 module to the specified value in MHz. |
### List of codes
|name|description|
|-|-|
|``example.ino``|A simple code that initializes the TEA5767 radio module, tunes to (default: 104.5 MHz), and periodically outputs signal quality information (PLL lock status, RSSI, RSSI in dBm, stereo status, and decoded information) every second.|
|``frequency_info.ino``|A code that initializes the TEA5767 radio module, tunes to a defined frequency (default: 104.5 MHz), and displays a structured report of the signal parameters (PLL lock, RSSI, RSSI in dBm, stereo mode, hex and ASCII status) every 3 seconds.|
|``frequency_scan.ino``|A code that scans the FM band from 87.5 MHz to 108.0 MHz, detecting stations based on RSSI threshold and PLL lock, and logging each station's frequency, signal strength, stereo/mono mode, and signal level in dBm, before providing a final summary.|
|``frequency_plotter.ino``|A minimalist code that sets the TEA5767 module to 104.5 MHz and outputs the signal strength (RSSI in dBm) every second, intended for real-time plotting or signal monitoring.|
|``frequency_plotter_multiple.ino``|A code that cycles through a predefined list of frequencies, measures the RSSI at each one, and outputs the results in sequence, allowing simultaneous signal monitoring across multiple FM channels.|
## Use the library
```c++
#include
#include
KS_TEA5767 radio;
void setup() {
Serial.begin(9600);
radio.begin(); // KS_TEA5767 library initialization
radio.setFrequency(104.5); // Set frequency to 104.5 MHz
}
void loop() {
}
```
### Schematic for using the TEA5767 with Arduino UNO (I²C)
