Shop OBEX P1 Docs P2 Docs Learn Events
How to connect a microphone to the SX I/O pin — Parallax Forums

How to connect a microphone to the SX I/O pin

Hello,
I'm starting a new project where I need to continuously represent sound levels in a digital format. I'm interested in working with SX and SXBasic, but I'm unsure about how to connect a microphone to the SX I/O pin. Does anyone have any ideas on how to achieve this?

Comments

  • JonnyMacJonnyMac Posts: 9,510
    edited 2025-11-05 20:23

    Ages ago I created a circuit with the SX for a "Hollywood" prop builder that would animate LEDs on a mask based on the speaking level of the actor. It was fast enough to quiver the LEDs when the actor had vibrato in his voice. That was easily 15-20 years ago so I don't know if I will be able to find the files, but I will look. The code is SX/B because I helped with Terry Hitt with SX/B when I worked for Parallax.

    TLDR: It's doable.

  • JonnyMacJonnyMac Posts: 9,510

    I found about 2000 SXB files on backup drives, but couldn't find the specific project.

    Going from memory....

    • I used an interface circuit from "Physical Computing" by Dan O'Sullivan and Tom Igoe (see image)
    • Probably used an ADC0831 based on the number of projects I found that used it
    • Could have been based on the attached file

    In this project we fabricated a "smile PCB with 15 LEDs that used Port C outputs from the SX28. The interface to the ADC worked perfectly as in includes a pot which let us set things so that the LEDs responded to normal and loud speech without going too far. Bits 1..7 were mirrored so we had a symmetrical smile. Since the stacked 100K resistors put the "quiet" signal at ~127, I think I took the ADC reading, shifted it right by 7 bits, then used a table to create a bar graph with the LEDs.

    I'm a little bummed that I can't find that code -- but now that I have all of my SXB back-ups in one place, I'll keep looking.

    Just curious... how are you going to compile the SXB program?

    1512 x 2016 - 738K
    310 x 140 - 340K
Sign In or Register to comment.