Working on FSK audio decoding this week.
Making another FSKsampler_v1 board since my previous one got stepped on over thanksgiving
running this just on regular arduino for now to test the android part
#include
#include
#define rxPin 8
#define txPin 3
#define sensor1 7
#define sensor2 6
#define FSKpin 0
SoftModem modem;
SoftwareSerial mySerial(rxPin, txPin); //rx, tx
// the Tx and Rx pins are 5 and 10 on the ATtiny which in Arduino map to pin 8 and pin 3 of arduino
// the setup routine runs once when you press reset:
void setup() {
pinMode(sensor1, INPUT);
pinMode(sensor2, INPUT);
pinMode(txPin, OUTPUT);
pinMode(rxPin, INPUT);
pinMode(FSKpin, OUTPUT);
mySerial.begin(9600);
modem.begin();
}
// the loop routine runs over and over again forever:
void loop() {
//int a = analogRead(sensor1);
//mySerial.println(a); // leave either the serial or the modem commented because they seem to interfere
modem.write(1);
delay(1000);
}
The clock was off by 4x when I used the actual arduino, i.e., the pulses are coming 4x slower than they should. The arduino is a 16 MHz clock speed
To get data in from the microphone, can use:
MediaRecorder.AudioSource.MIC -- it was already set that way though
Setting it to use MusicLength rather than MusicLength/500 as the source for the graph. This will probably take a lot longer to plot but I should be sure it would be possible to see the FSK pulses. That's the entire 10 seconds.
Not much direct transmission from arduino into audio jack without the interface circuitry.
Currently the phone is listening to the external mic, not the headphone jack.
Maybe I need this: http://www.startech.com/Cables/Audio-Video/Audio-Cables/35mm-4-Position-to-2x-3-Position-35mm-Headset-Splitter-Adapter-Male-to-Female~MUYHSMFF
See the .gif for the correct pattern
Looks like my 3 terminal connector does work for the computer's dedicated mic input but not for the android or iphone bi-directional jack
Simplest thing to do here is just to modify AndroinoTerm to the minimum extent consistent with working as a sampler and then go from there.
Just going to do this trivially with an arduino, speaker and potentiometer, and the microphone input of the android -- for the final I will work out the bi-directional communication through the audio jack itself.
I also aim to plot out the decoded values using the graphview library.
Starting with just modifying the arduino side of the AndroinoTerm setup to be a sampler, too.
Got arduino to output character representation of sampled analog integers as FSK. Code: