USB Module Usage
Sound Localization Module Usage Tutorial
- Hardware preparation:
- Solder the sound localization module according to the instruction manual
The effect is shown in the following figure:


- Line connection: Connect RDK-X5 physical pin numbers 11, 13, 15, 29, 31, 37 to the sound localization module's 0°, 60°, 120°, 180°, 240°, 300° in order. Connect the module's VCC and GND to RDK-X5's 5V and GND respectively.
RDK-X5 40pin pinout diagram:

Wiring diagram:

Software operation:
Run the sound_localization.py file on RDK-X5: python ./sound_localization.py
At this time, the sound sources identified at different angles will be read and printed in the terminal. The terminal operation effect is as follows:

#!/usr/bin/env python3
import sys
import signal
import Hobot.GPIO as GPIO
import time
# Pin numbers using BOARD encoding
pins = [11, 13, 15, 29, 31, 37]
angles = [0, 60, 120, 180, 240, 300]
def signal_handler(sig, frame):
sys.exit(0)
def main():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
for pin in pins:
GPIO.setup(pin, GPIO.IN)
print("Sound localization started, press CTRL+C to exit")
try:
while True:
for pin, angle in zip(pins, angles):
if GPIO.input(pin) == GPIO.HIGH:
print("({} degrees sound source detected)".format(angle))
time.sleep(0.1)
finally:
GPIO.cleanup()
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal_handler)
main()