1. Brief
Guitar needs maintenance and adjustment when strings are getting loose and out of tune.
Guitar Out of tune Notifier is put near the Guitar , keep trace of the changes in tune. When the Guitar is out of tune. Notification shall be sent over Serial to Ethernet port to trigger web-service API, send SMS or refresh the web content to notify maintenance technicians.
2. Hardware
- Arduino 101 Board
- WIZ750SR module
- ISD1802 Microphone module
3. Software
3.1 Arduino 1.8.5 with Arduino FFT libary
3.2 Keil MDK 5.22 for WIZ75000P package supported
3.3 WIZconfig 0.5.1
3.4 Hecules 3.28 for TCP client service
4. Program Blocks
4.1 The first thing I got the WIZ750SR kits is trying every tools until I spoil the kit and can not find the boards. Therefore I have to start from beginning,
Step 1, Use WIZnetMACTool to reset the MAC address as follows,
The switch shall be as follows before Wirte MAC
Step 2, Reflash the S2E program for booting and S2E communication, using W7500 ISP Tool, that is one of goodthing than no need of SWD tools for fast ROM flashing. In the following chapter, MDK can generate customized bin file and flash into the ROM with ISP tool
Then Firmware writing until succeed .
Step 3, The debugg port return with right feedback,
double x = FFT.MajorPeak(vReal, samples, SAMPLINGFREQUENCY);
Using Configuration tool to setup parameters, in this case, set as TCP server
4.2 Now, it is OK to run the S2E, and use HErcules TCP client to connect WIZ750SR baord
The serial port in Putty can communication with the TCP server well, If you put "welcome to WIZ7500SR", it shows what you input in TCP client and vise verse.
5. Products
5.1 Using Arduino 101 board and Arduino 1.8.5 to fetch sound from ISD1802,
void adcTune(double *vReal,double *vImag ,int *readings)
{
// read from the sensor AND advance to the next position in the array:
for (int readIndex= 0; readIndex < numReadings; readIndex++){
delay(CYCLETIME); // delay fpr cycle
readings[readIndex] = analogRead(inputPin);
}
for (int i = 0; i < numReadings; i++) {
vReal[i] = readings[i] ;/* Build data with positive and negative values*/
vImag[i] = 0.0;
}
}
then the ADC sample in pace (64 each cycle), the arduinoFFT can transform the data and find the peak frequency matching the sound.
void fftTune(double *vReal,double *vImag, uint16_t samples)
{
FFT.Windowing(vReal, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD); /* Weigh data */
FFT.Compute(vReal, vImag, samples, FFT_FORWARD); /* Compute FFT */
FFT.ComplexToMagnitude(vReal, vImag, samples); /* Compute magnitudes */
Serial.println("Computed magnitudes:");
PrintVector(vReal, (samples >> 1), SCL_FREQUENCY);
/****** Maximum Frequency*************/
Serial.print("Major Peak:");
Serial.println(x, 6);
mySerial.println("Major Peak:");
mySerial.println(x, 6);
}
Then output the serial both Serial port for arduino and customized port D7 and D8
#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8); // RX, TX
mySerial.begin(115200);
... ...
mySerial.println("Major Peak:");
mySerial.println(x, 6);
... ...
5.2 Wiring and pictures
The ISD1802 is wiring A0 for ADC input,
int inputPin = A0;
Herei is the scheme diagram,simply conntected daughter board of WIZ750SR do not work, since the mode selection shall be gounded to make it in proper stat
6 Next to do
6.1 I have take research on firmware file WIZ750SR-1.2.2-2, the hareware driven ETHERNET protocol make programmer do neccessary modification to the need.
The main part of code in seg.c is,
void do_seg(uint8_t sock)
and
void proc_SEG_tcp_client(uint8_t sock)
I shall make some change on serial output for better user Interface experience. While the deadline for submission is closing, the work have to be done later.
This can support TCP client only, connecting http Server only once. I would like to embedded it into http Client, connect http server and keep alive until timeout offline. That would be interesting.
Comments