5fb1f276c6e992405dd88a53b0c7b4dfb1902c8a
Chip-cn-dat/Espressif-dat/ESP32-dat/ESP32-HDK-dat/ESP32-I2S-dat/2024-12-26-19-06-13.png
... | ... | Binary files /dev/null and b/Chip-cn-dat/Espressif-dat/ESP32-dat/ESP32-HDK-dat/ESP32-I2S-dat/2024-12-26-19-06-13.png differ |
Chip-cn-dat/Espressif-dat/ESP32-dat/ESP32-HDK-dat/ESP32-I2S-dat/ESP32-I2S-dat.md
... | ... | @@ -1,7 +1,7 @@ |
1 | 1 | |
2 | 2 | # ESP32-I2S-dat |
3 | 3 | |
4 | -- [[ESP32_PCM5102.ino]] |
|
4 | +- [[ESP32_PCM5102.ino]] - [[I2S-dat]] |
|
5 | 5 | |
6 | 6 | |
7 | 7 | The ESP32-WROVER module supports I2S (Inter-IC Sound) communication, which is typically used for audio data transmission. The I2S peripheral allows the ESP32 to act as a transmitter (master or slave) or receiver of audio data. |
... | ... | @@ -16,4 +16,18 @@ The I2S pins can be assigned to almost any GPIO pin using the ESP32's **flexible |
16 | 16 | | I2S_WS (word select, also known as LRCK) | GPIO25 | |
17 | 17 | | I2S_BCK (bit clock) | GPIO26 | |
18 | 18 | | I2S_SD_OUT (serial data out, TX) | GPIO22 | |
19 | -| I2S_SD_IN (serial data in, RX) | GPIO35 | |
|
... | ... | \ No newline at end of file |
0 | +| I2S_SD_IN (serial data in, RX) | GPIO35 | |
|
1 | + |
|
2 | + |
|
3 | +## With I2S amplifier |
|
4 | + |
|
5 | +- [[MAX98357-dat]] |
|
6 | + |
|
7 | +![](2024-12-26-19-06-13.png) |
|
8 | + |
|
9 | +- [[arduino-lib-dat]] |
|
10 | + |
|
11 | + |
|
12 | +## ref |
|
13 | + |
|
14 | +- Espressif has their usual [excellent documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/i2s.html) for I2S on the ESP32, it can link you to more information. |
|
... | ... | \ No newline at end of file |
Chip-dat/Analog-dat/MAX98357-dat/MAX98357-code.ino
... | ... | @@ -0,0 +1,65 @@ |
1 | +/* |
|
2 | + ESP32 SD I2S Music Player |
|
3 | + esp32-i2s-sd-player.ino |
|
4 | + Plays MP3 file from microSD card |
|
5 | + Uses MAX98357 I2S Amplifier Module |
|
6 | + Uses ESP32-audioI2S Library - https://github.com/schreibfaul1/ESP32-audioI2S |
|
7 | + * |
|
8 | + DroneBot Workshop 2022 |
|
9 | + https://dronebotworkshop.com |
|
10 | +*/ |
|
11 | + |
|
12 | +// Include required libraries |
|
13 | +#include "Arduino.h" |
|
14 | +#include "Audio.h" |
|
15 | +#include "SD.h" |
|
16 | +#include "FS.h" |
|
17 | + |
|
18 | +// microSD Card Reader connections |
|
19 | +#define SD_CS 5 |
|
20 | +#define SPI_MOSI 23 |
|
21 | +#define SPI_MISO 19 |
|
22 | +#define SPI_SCK 18 |
|
23 | + |
|
24 | +// I2S Connections |
|
25 | +#define I2S_DOUT 22 |
|
26 | +#define I2S_BCLK 26 |
|
27 | +#define I2S_LRC 25 |
|
28 | + |
|
29 | + // Create Audio object |
|
30 | +Audio audio; |
|
31 | + |
|
32 | +void setup() { |
|
33 | + |
|
34 | + // Set microSD Card CS as OUTPUT and set HIGH |
|
35 | + pinMode(SD_CS, OUTPUT); |
|
36 | + digitalWrite(SD_CS, HIGH); |
|
37 | + |
|
38 | + // Initialize SPI bus for microSD Card |
|
39 | + SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI); |
|
40 | + |
|
41 | + // Start Serial Port |
|
42 | + Serial.begin(115200); |
|
43 | + |
|
44 | + // Start microSD Card |
|
45 | + if(!SD.begin(SD_CS)) |
|
46 | + { |
|
47 | + Serial.println("Error accessing microSD card!"); |
|
48 | + while(true); |
|
49 | + } |
|
50 | + |
|
51 | + // Setup I2S |
|
52 | + audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); |
|
53 | + |
|
54 | + // Set Volume |
|
55 | + audio.setVolume(5); |
|
56 | + |
|
57 | + // Open music file |
|
58 | + audio.connecttoFS(SD,"/MYMUSIC.mp3"); |
|
59 | + |
|
60 | +} |
|
61 | + |
|
62 | +void loop() |
|
63 | +{ |
|
64 | + audio.loop(); |
|
65 | +} |
|
... | ... | \ No newline at end of file |
Chip-dat/Analog-dat/MAX98357-dat/MAX98357-dat.md
... | ... | @@ -0,0 +1,12 @@ |
1 | + |
|
2 | +# MAX98357 |
|
3 | + |
|
4 | + |
|
5 | +## SCH |
|
6 | + |
|
7 | +![](2024-12-26-15-18-55.png) |
|
8 | + |
|
9 | + |
|
10 | +## code |
|
11 | + |
|
12 | +- [[MAX98357-code.ino]] |
|
... | ... | \ No newline at end of file |
Chip-dat/Analog-dat/MAX98357-dat/MAX98357.md
... | ... | @@ -1,7 +0,0 @@ |
1 | - |
|
2 | -# MAX98357 |
|
3 | - |
|
4 | - |
|
5 | -## SCH |
|
6 | - |
|
7 | -![](2024-12-26-15-18-55.png) |
|
... | ... | \ No newline at end of file |
Chip-dat/InvenSense-dat/INMP441-dat/INMP441-code2.ino
... | ... | @@ -0,0 +1,104 @@ |
1 | + |
|
2 | +/* |
|
3 | + ESP32 I2S Microphone Sample |
|
4 | + esp32-i2s-mic-sample.ino |
|
5 | + Sample sound from I2S microphone, display on Serial Plotter |
|
6 | + Requires INMP441 I2S microphone |
|
7 | + |
|
8 | + DroneBot Workshop 2022 |
|
9 | + https://dronebotworkshop.com |
|
10 | +*/ |
|
11 | + |
|
12 | +// Include I2S driver |
|
13 | +#include <driver/i2s.h> |
|
14 | + |
|
15 | +// Connections to INMP441 I2S microphone |
|
16 | +#define I2S_WS 25 |
|
17 | +#define I2S_SD 33 |
|
18 | +#define I2S_SCK 32 |
|
19 | + |
|
20 | +// Use I2S Processor 0 |
|
21 | +#define I2S_PORT I2S_NUM_0 |
|
22 | + |
|
23 | +// Define input buffer length |
|
24 | +#define bufferLen 64 |
|
25 | +int16_t sBuffer[bufferLen]; |
|
26 | + |
|
27 | +void i2s_install() { |
|
28 | + // Set up I2S Processor configuration |
|
29 | + const i2s_config_t i2s_config = { |
|
30 | + .mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX), |
|
31 | + .sample_rate = 44100, |
|
32 | + .bits_per_sample = i2s_bits_per_sample_t(16), |
|
33 | + .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, |
|
34 | + .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S), |
|
35 | + .intr_alloc_flags = 0, |
|
36 | + .dma_buf_count = 8, |
|
37 | + .dma_buf_len = bufferLen, |
|
38 | + .use_apll = false |
|
39 | + }; |
|
40 | + |
|
41 | + i2s_driver_install(I2S_PORT, &i2s_config, 0, NULL); |
|
42 | +} |
|
43 | + |
|
44 | +void i2s_setpin() { |
|
45 | + // Set I2S pin configuration |
|
46 | + const i2s_pin_config_t pin_config = { |
|
47 | + .bck_io_num = I2S_SCK, |
|
48 | + .ws_io_num = I2S_WS, |
|
49 | + .data_out_num = -1, |
|
50 | + .data_in_num = I2S_SD |
|
51 | + }; |
|
52 | + |
|
53 | + i2s_set_pin(I2S_PORT, &pin_config); |
|
54 | +} |
|
55 | + |
|
56 | +void setup() { |
|
57 | + |
|
58 | + // Set up Serial Monitor |
|
59 | + Serial.begin(115200); |
|
60 | + Serial.println(" "); |
|
61 | + |
|
62 | + delay(1000); |
|
63 | + |
|
64 | + // Set up I2S |
|
65 | + i2s_install(); |
|
66 | + i2s_setpin(); |
|
67 | + i2s_start(I2S_PORT); |
|
68 | + |
|
69 | + |
|
70 | + delay(500); |
|
71 | +} |
|
72 | + |
|
73 | +void loop() { |
|
74 | + |
|
75 | + // False print statements to "lock range" on serial plotter display |
|
76 | + // Change rangelimit value to adjust "sensitivity" |
|
77 | + int rangelimit = 3000; |
|
78 | + Serial.print(rangelimit * -1); |
|
79 | + Serial.print(" "); |
|
80 | + Serial.print(rangelimit); |
|
81 | + Serial.print(" "); |
|
82 | + |
|
83 | + // Get I2S data and place in data buffer |
|
84 | + size_t bytesIn = 0; |
|
85 | + esp_err_t result = i2s_read(I2S_PORT, &sBuffer, bufferLen, &bytesIn, portMAX_DELAY); |
|
86 | + |
|
87 | + if (result == ESP_OK) |
|
88 | + { |
|
89 | + // Read I2S data buffer |
|
90 | + int16_t samples_read = bytesIn / 8; |
|
91 | + if (samples_read > 0) { |
|
92 | + float mean = 0; |
|
93 | + for (int16_t i = 0; i < samples_read; ++i) { |
|
94 | + mean += (sBuffer[i]); |
|
95 | + } |
|
96 | + |
|
97 | + // Average the data reading |
|
98 | + mean /= samples_read; |
|
99 | + |
|
100 | + // Print to serial plotter |
|
101 | + Serial.println(mean); |
|
102 | + } |
|
103 | + } |
|
104 | +} |
|
... | ... | \ No newline at end of file |
Chip-dat/InvenSense-dat/INMP441-dat/INMP441-dat.md
... | ... | @@ -15,7 +15,7 @@ https://invensense.tdk.com/wp-content/uploads/2015/02/INMP441.pdf |
15 | 15 | |
16 | 16 | ## code |
17 | 17 | |
18 | -- [[INMP441-code.ino]] |
|
18 | +- [[INMP441-code.ino]] - [[INMP441-code2.ino]] |
|
19 | 19 | |
20 | 20 | |
21 | 21 |
FAQ-dat/board-buck-order-dat/18-48-15-17-08-2023.png
... | ... | Binary files /dev/null and b/FAQ-dat/board-buck-order-dat/18-48-15-17-08-2023.png differ |
FAQ-dat/board-buck-order-dat/Board-discount.md
... | ... | @@ -0,0 +1,14 @@ |
1 | + |
|
2 | +# Discount |
|
3 | + |
|
4 | +All board with flat rate discount: |
|
5 | + |
|
6 | +## Bulk order Discount |
|
7 | +- 10% for quantity over 30pcs order. |
|
8 | +- The boards you enquired are already included with this discount. |
|
9 | +- The discount will be automatically applied to the cart if you add this quantity into the cart. |
|
10 | + |
|
11 | +![](18-48-15-17-08-2023.png) |
|
12 | + |
|
13 | +## Distributor discount |
|
14 | +- 15% discount for distributors with orders over 500 USD |
|
... | ... | \ No newline at end of file |
FAQ-dat/board-buck-order-dat/Board-stock-out.md
... | ... | @@ -0,0 +1,27 @@ |
1 | + |
|
2 | +# stock out items |
|
3 | + |
|
4 | + |
|
5 | +- [[NWI1068-dat]] - [[NWI1235-dat]] - [[NWI1238-dat]] |
|
6 | + |
|
7 | +- [[SVC1019-dat]] |
|
8 | + |
|
9 | + |
|
10 | +## sales offer |
|
11 | + |
|
12 | +- [[OPM1112-dat]] - |
|
13 | + |
|
14 | +- [[NWI1186-dat]] - https://www.electrodragon.com/product/esp32-sense-kit-w-esp-prog/ |
|
15 | + |
|
16 | + |
|
17 | + |
|
18 | + |
|
19 | + |
|
20 | +## out of stock |
|
21 | + |
|
22 | +- [[SCM1030-dat]] - https://www.electrodragon.com/product/m5stack-esp32cam-camera-module-esp32-ov2640/ |
|
23 | + |
|
24 | + |
|
25 | +## regular |
|
26 | + |
|
27 | +- [[NWI1183-dat]] - ESP32-LyraTD-MSC, ESP32-WROVER - [[NWI1183]] |
|
... | ... | \ No newline at end of file |
SDK-dat/arduino-dat/Arduino-IDE-DAT/arduino-lib-dat/arduino-lib-dat.md
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | - [ESP8266](https://github.com/earlephilhower/ESP8266Audio) |
9 | 9 | - [XT_DAC_Audio 4_2_1](https://www.xtronical.com/the-dacaudio-library-download-and-installation/) |
10 | 10 | |
11 | - |
|
11 | +- [audioI2S](https://github.com/schreibfaul1/ESP32-audioI2S) |
|
12 | 12 | |
13 | 13 | ## Power Control |
14 | 14 |
app-dat/app-dat.md
... | ... | @@ -0,0 +1,4 @@ |
1 | + |
|
2 | +# app-dat |
|
3 | + |
|
4 | +- [[internet-radio-dat]] |
|
... | ... | \ No newline at end of file |
app-dat/internet-radio-dat/internet-radio-dat.ino
... | ... | @@ -0,0 +1,110 @@ |
1 | + |
|
2 | +/* |
|
3 | + Simple Internet Radio Demo |
|
4 | + esp32-i2s-simple-radio.ino |
|
5 | + Simple ESP32 I2S radio |
|
6 | + Uses MAX98357 I2S Amplifier Module |
|
7 | + Uses ESP32-audioI2S Library - https://github.com/schreibfaul1/ESP32-audioI2S |
|
8 | + |
|
9 | + DroneBot Workshop 2022 |
|
10 | + https://dronebotworkshop.com |
|
11 | +*/ |
|
12 | + |
|
13 | +// Include required libraries |
|
14 | +#include "Arduino.h" |
|
15 | +#include "WiFi.h" |
|
16 | +#include "Audio.h" |
|
17 | + |
|
18 | +// Define I2S connections |
|
19 | +#define I2S_DOUT 22 |
|
20 | +#define I2S_BCLK 26 |
|
21 | +#define I2S_LRC 25 |
|
22 | + |
|
23 | +// Create audio object |
|
24 | +Audio audio; |
|
25 | + |
|
26 | +// Wifi Credentials |
|
27 | +String ssid = "YOURSSID"; |
|
28 | +String password = "YOURPASSWORD"; |
|
29 | + |
|
30 | +void setup() { |
|
31 | + |
|
32 | + // Start Serial Monitor |
|
33 | + Serial.begin(115200); |
|
34 | + |
|
35 | + // Setup WiFi in Station mode |
|
36 | + WiFi.disconnect(); |
|
37 | + WiFi.mode(WIFI_STA); |
|
38 | + WiFi.begin(ssid.c_str(), password.c_str()); |
|
39 | + |
|
40 | + while (WiFi.status() != WL_CONNECTED) { |
|
41 | + delay(500); |
|
42 | + Serial.print("."); |
|
43 | + } |
|
44 | + |
|
45 | + // WiFi Connected, print IP to serial monitor |
|
46 | + Serial.println(""); |
|
47 | + Serial.println("WiFi connected"); |
|
48 | + Serial.println("IP address: "); |
|
49 | + Serial.println(WiFi.localIP()); |
|
50 | + Serial.println(""); |
|
51 | + |
|
52 | + // Connect MAX98357 I2S Amplifier Module |
|
53 | + audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); |
|
54 | + |
|
55 | + // Set thevolume (0-100) |
|
56 | + audio.setVolume(10); |
|
57 | + |
|
58 | + // Connect to an Internet radio station (select one as desired) |
|
59 | + //audio.connecttohost("http://vis.media-ice.musicradio.com/CapitalMP3"); |
|
60 | + //audio.connecttohost("mediaserv30.live-nect MAX98357 I2S Amplifier Module |
|
61 | + //audio.connecttohost("www.surfmusic.de/m3u/100-5-das-hitradio,4529.m3u"); |
|
62 | + //audio.connecttohost("stream.1a-webradio.de/deutsch/mp3-128/vtuner-1a"); |
|
63 | + //audio.connecttohost("www.antenne.de/webradio/antenne.m3u"); |
|
64 | + audio.connecttohost("0n-80s.radionetz.de:8000/0n-70s.mp3"); |
|
65 | + |
|
66 | +} |
|
67 | + |
|
68 | +void loop() |
|
69 | + |
|
70 | +{ |
|
71 | + // Run audio player |
|
72 | + audio.loop(); |
|
73 | + |
|
74 | +} |
|
75 | + |
|
76 | +// Audio status functions |
|
77 | + |
|
78 | +void audio_info(const char *info) { |
|
79 | + Serial.print("info "); Serial.println(info); |
|
80 | +} |
|
81 | +void audio_id3data(const char *info) { //id3 metadata |
|
82 | + Serial.print("id3data "); Serial.println(info); |
|
83 | +} |
|
84 | +void audio_eof_mp3(const char *info) { //end of file |
|
85 | + Serial.print("eof_mp3 "); Serial.println(info); |
|
86 | +} |
|
87 | +void audio_showstation(const char *info) { |
|
88 | + Serial.print("station "); Serial.println(info); |
|
89 | +} |
|
90 | +void audio_showstreaminfo(const char *info) { |
|
91 | + Serial.print("streaminfo "); Serial.println(info); |
|
92 | +} |
|
93 | +void audio_showstreamtitle(const char *info) { |
|
94 | + Serial.print("streamtitle "); Serial.println(info); |
|
95 | +} |
|
96 | +void audio_bitrate(const char *info) { |
|
97 | + Serial.print("bitrate "); Serial.println(info); |
|
98 | +} |
|
99 | +void audio_commercial(const char *info) { //duration in sec |
|
100 | + Serial.print("commercial "); Serial.println(info); |
|
101 | +} |
|
102 | +void audio_icyurl(const char *info) { //homepage |
|
103 | + Serial.print("icyurl "); Serial.println(info); |
|
104 | +} |
|
105 | +void audio_lasthost(const char *info) { //stream URL played |
|
106 | + Serial.print("lasthost "); Serial.println(info); |
|
107 | +} |
|
108 | +void audio_eof_speech(const char *info) { |
|
109 | + Serial.print("eof_speech "); Serial.println(info); |
|
110 | +} |
|
... | ... | \ No newline at end of file |
app-dat/internet-radio-dat/internet-radio-dat.md
... | ... | @@ -0,0 +1,4 @@ |
1 | + |
|
2 | +# internet-radio-dat |
|
3 | + |
|
4 | +- [[internet-radio-dat.ino]] |
|
... | ... | \ No newline at end of file |
board-buck-order-dat/18-48-15-17-08-2023.png
... | ... | Binary files a/board-buck-order-dat/18-48-15-17-08-2023.png and /dev/null differ |
board-buck-order-dat/Board-discount.md
... | ... | @@ -1,14 +0,0 @@ |
1 | - |
|
2 | -# Discount |
|
3 | - |
|
4 | -All board with flat rate discount: |
|
5 | - |
|
6 | -## Bulk order Discount |
|
7 | -- 10% for quantity over 30pcs order. |
|
8 | -- The boards you enquired are already included with this discount. |
|
9 | -- The discount will be automatically applied to the cart if you add this quantity into the cart. |
|
10 | - |
|
11 | -![](18-48-15-17-08-2023.png) |
|
12 | - |
|
13 | -## Distributor discount |
|
14 | -- 15% discount for distributors with orders over 500 USD |
|
... | ... | \ No newline at end of file |
board-buck-order-dat/Board-stock-out.md
... | ... | @@ -1,27 +0,0 @@ |
1 | - |
|
2 | -# stock out items |
|
3 | - |
|
4 | - |
|
5 | -- [[NWI1068-dat]] - [[NWI1235-dat]] - [[NWI1238-dat]] |
|
6 | - |
|
7 | -- [[SVC1019-dat]] |
|
8 | - |
|
9 | - |
|
10 | -## sales offer |
|
11 | - |
|
12 | -- [[OPM1112-dat]] - |
|
13 | - |
|
14 | -- [[NWI1186-dat]] - https://www.electrodragon.com/product/esp32-sense-kit-w-esp-prog/ |
|
15 | - |
|
16 | - |
|
17 | - |
|
18 | - |
|
19 | - |
|
20 | -## out of stock |
|
21 | - |
|
22 | -- [[SCM1030-dat]] - https://www.electrodragon.com/product/m5stack-esp32cam-camera-module-esp32-ov2640/ |
|
23 | - |
|
24 | - |
|
25 | -## regular |
|
26 | - |
|
27 | -- [[NWI1183-dat]] - ESP32-LyraTD-MSC, ESP32-WROVER - [[NWI1183]] |
|
... | ... | \ No newline at end of file |