WIZNET-IOT-SPEAKER
W5300 칩을 사용하여 네트웍으로 사운드 데이터를 실시간으로 전달해서 스피커로 출력을 하고 IoT 제어를 위한 기능을 포함한 시스템이다.
Overview
- WIZnet's W5300 chip is a hardware TCP/IP chip that supports a 16-bit bus and can transmit and receive data at high speed. Therefore, the WIZ-IOT-SPEAKER project takes full advantage of these features and uses the W5300 chip to transmit audio data as streaming on a PC for playback.
Project Goals
- This is what you get at the end of the project so you can at least move on.
- A system that uses the W5300 chip to transmit sound data to the network in real time and output it to the speaker.
- Design and build boards using the W5300 and MCUs
- Write circuit designs, artwork, firmware, and complete PC programs
Requirements
- Organize the requirements to achieve the goal and define and schedule detailed tasks based on them.
- Utilize the high-speed characteristics of the W5300 chip.
- Be able to deliver audio data in real time.
- It should be able to output data from the network to the speaker.
- It should be possible to check necessary information such as IP using an information display device such as an LCD.
- Build own board and share the data.
- Audio data can be sent from a PC or to the same board.
- The development environment must be multiplatform. (Windows/Mac/Linux)
- W5300 Control reads datasheets and uses registers to build libraries by hand.
Considerations
- As you progress through the project, feel free to draw out and reflect on things to consider.
- I make my own boards and enjoy the process.
- Create additional I/O on the board beyond the basic functions so that it can be utilized as a development board.
- How do you want to send audio data from the PC?
- If you're creating a PC program, should it be a GUI?
- Do I need a microphone sensor, and if so, should I mount it on the board?
- Can we send video data as well?
- Could you send motion data to control a remote robot?
Development Environments
Hardware
- Schematic and Artwork Online with EasyEDA
- SMT directly through JLCPCB
Firmware
- Build Environments
- CMake, GCC, Make
- Editing Tools
- Visual Studio Code
- Libraries
- STM32CubeH7
- MCU library provided by ST
- LittleFS
- File system for embedded with failsafe features
- LVGL
- Free GUI library for embedded use
- WIZnet ioLibrary_Driver
- dhcp, sntp, socket
- STM32CubeH7
- MCU code generator
- STM32CubeMX
Software
- PySide6
- A Python version of Qt6
- MinGW GCC
- For creating PC programs to update firmware
Basic Specifications
Specifications
Item | Item name | Specification | Remarks |
---|---|---|---|
MCU | STM32H723ZGT6 | FLASH : 1MB, SRAM : 564KB | External SRAM bus 16-bit |
Ext. FLASH | W25Q128JVSIQTR | 16MBytes | For firmware updates, data storage |
Network | W5300 | 16bit bus | |
Audio H/W #1 | MAX98357A | I2S Codec/AMP | Connect to Speakers |
Audio H/W #2 | ES8156 | I2S Codec | Connect to AMP |
Buzzer | |||
LCD | 1.3인치 IPS | 240x240 | https://ko.aliexpress.com/item/33021695448.html |
Block Diagram
Progress Calendar
- Derive action items
- Task scheduling
Hardware Results
- The board consists of two boards, the main board contains the MCU including the W5300 chip and the audio output function, and the extended IO connector implements functions such as LCD and rotary encoder.
Build Board
- Main Board
- Designing on four levels to reduce board size and increase artwork convenience
- Circuit design and artwork
- I/O Board
- Circuit design and artwork
Assembling the Board
- Main Board + I/O Board
- Assembling a 3D Cube
Firmware Results
- Memory Map
- Separate the bootloader and firmware areas and securely update the firmware via external memory.
- Apply the LittleFS PySystem to external memory to manage parameter storage.
- Communication Packet Structure
- When communicating with a PC, communication packets are defined for data exchange, and commands and data are delivered through them.
- Bootloader Commands
- Audio Streaming Commands
- Safe Firmware Update Structure
- The firmware update is designed to utilize additional memory to ensure that it can be recovered or not affected if something goes wrong in the middle.
- Update Process
- Download the firmware from the PC to the external memory.
- The bootloader updates the firmware by copying the firmware from the external flash memory to the internal flash memory.
- Run the updated firmware.
- Firmware Update over UDP
- The communication driver structure allows the firmware to be updated equally over UART and UDP.
- UDP Update Log
- The progress of the update is displayed on the LCD.
- Audio Output Structure
- Use a double buffering structure and DMA to ensure uninterrupted audio output.
- Streaming Audio
- Receives audio data blocks from the PC and buffers them before outputting the audio.
Software Results
- Downloader Program
- A PC program written in C++ that allows firmware updates over UART or UDP and tests audio streaming.
- Audio Streaming GUI
- It is a GUI program using PySide6 and transmits audio data to the WIZ-IOT-SPEAKER board in real time through socket communication.
Demo Video
Show audio spectrum
Update UDP Firmware
Audio streaming and OSD volume control
Configuring a GIT repository
- Firmware
- STM32CubeMX Project
- Bootloader
- Firmware
- Hardware
- Schematic, Gerber files, BOM
- Software
- PC Download Program
- GUI Program
Youtube videos
- Creating an IoT-Speaker #1 - Project Planning is Hard
- Creating an IoT-Speaker #2 - Staying Up All Night with Artwork
- Creating an IoT-Speaker #3 - I have an idea for an expansion board
- Creating an IoT-Speaker #4 - Datasheets are fun to read
- Building the IoT-Speaker #5 - The Board Finally Arrives
- Creating an IoT-Speaker #6 - The flower of debugging is shoveling
- Creating an IoT-Speaker #7 - Using QSPI FLASH
- Creating an IoT-Speaker #8 - Outputting Sound
- Creating an IoT-Speaker #9 - Use a Cube
- Creating an IoT-Speaker #10 - Firmware Updates Are Important
- Creating an IoT Speaker #11 - Display the Audio Spectrum
- Building an IoT Speaker #12 - It's All About the Heart
- Building an IoT Speaker #13 - Putting the Final Pieces Together
Blog posts
- [WIZnet - W5300] 프로젝트 기획하기
- [WIZnet - W5300] 보드 구성 검토
- [WIZnet - W5300] 보드 구성 고민중..
- [WIZnet - W5300] 회로 설계 및 배치
- [WIZnet - W5300] 아트웍 완료 및 SMT 주문
- [WIZnet - W5300] I/O 보드 고민중..
- [WIZnet - W5300] I/O 보드 PCB 주문 완료
- [WIZnet - W5300] I/O 보드 PCB 도착
- [WIZnet - W5300] W5300 데이터쉬트 살펴보기
- [WIZnet - W5300] 진행사항 (23/5/1)
- [WIZnet - W5300] 펌웨어 프로젝트 생성
- [WIZnet - W5300] 메인보드 도착
- [WIZnet - W5300] 메모리 버스 확인
- [WIZnet - W5300] STM32 FMC 주의사항
- [WIZnet - W5300] Endian 처리 방법
- [WIZnet - W5300] UDP 속도 측정
- [WIZnet - W5300] I/O 보드 수정
- [WIZnet - W5300] 수정된 I/O 보드 도착
- [WIZnet - W5300] QSPI FLASH 적용
- [WIZnet - W5300] LittleFS 적용
- [WIZnet - W5300] 디버깅 UART 구현
- [WIZnet - W5300] DXL 제어 추가
- [WIZnet - W5300] SD카드, FatFs
- [WIZnet - W5300] I2C
- [WIZnet - W5300] I2S 오디오 출력 - MAX98357A
- [WIZnet - W5300] SAI 오디오 출력 - ES8156
- [WIZnet - W5300] 확장 I/O 보드 조립
- [WIZnet - W5300] 로터리 엔코더
- [WIZnet - W5300] LCD 구현
- [WIZnet - W5300] PWM 및 NVS
- [WIZnet - W5300] 스피커 배치
- [WIZnet - W5300] 부트로더 & 네트웍 업데이트 검토
- [WIZnet - W5300] 오디오 Mixer 추가
- [WIZnet - W5300] USB CDC/MSC 구현
- [WIZnet - W5300] RTC, RESET
- [WIZnet - W5300] 아트웍 프로젝트 공유
- [WIZnet - W5300] 오디오 스펙트럼 표시
- [WIZnet - W5300] 부트로더 & 다운로더 구현
- [WIZnet - W5300] UDP 펌웨어 업데이트
- [WIZnet - W5300] 업데이트 상태 LCD 표시
- [WIZnet - W5300] ioLibrary_Driver 포팅
- [WIZnet - W5300] DHCP 추가
- [WIZnet - W5300] DHCP LCD 표시
- [WIZnet - W5300] SNTP 추가
- [WIZnet - W5300] Broadcast 활용
- [WIZnet - W5300] 오디오 스트리밍 구현
- [WIZnet - W5300] 오디오 스트리밍 개선
- [WIZnet - W5300] 윈도우에서 시험
- [WIZnet - W5300] 스피커 교체 시험
- [WIZnet - W5300] OSD 볼륨 조절
- [WIZnet - W5300] 오디오 스트림 버퍼 추가
- [WIZnet - W5300] WIZ-IOT-GUI 구현
- [WIZnet - W5300] WIZ-IOT-GUI 완료
In closing...
For the past three months, I've been working on artwork all night, and it was not easy to proceed from project planning to hardware, firmware, and software, but by working together, I was able to implement the interconnected parts faster than I thought, and I think I experienced a lot of things, such as socket communication using Wiznet's W5300.
The project ends here, but we will continue to add features with this hardware. For reference, I think there are many things that can be done, such as updating the firmware with the GUI or interlocking with Home Assistant using MQTT.
Finally, I would like to thank everyone who has been interested in the project and provided feedback.
-
wiznet-iot-speaker-boot
wiznet-iot-speaker 보드의 부트로더 펌웨어
-
wiznet-iot-speaker-fw
wiznet-iot-speaker 보드의 메인 펌웨어
-
wiznet-iot-loader
펌웨어 다운로드 및 테스트를 위한 PC 프로그램
-
wiznet-iot-speaker
PC용 GUI 프로그램
-
MAIN B/D
MAIN B/D 회로도
-
IO B/D
IO B/D 회로도