Description
I designed this joystick position transmission system as a requirement for one of my electronics courses and to practice with simple serial data communication interfaces.
The joystick data transmitter is an embedded system that gathers (x, y) position data (also called biaxial offset) from a KY-023 joystick sensor module, and transmits either the x-channel or y-channel via UART protocol. It was implemented on the ATMega328-P microcontroller using bare metal C programming and the avr-libc library. I also re-designed the system with SPI and I2C protocols.
The device contains an ATMEGA328 microcontroller, a 16x2 LCD display, a KY023 joystick sensor and a 5V power supply module. It samples the xy-joystick vector at a rate of 10Hz and communicates on a single channel in 8N1 format, although the active channel can be toggled.
Visit my GitHub repository to read the project datasheet, cost analysis and firmware files.
Circuit Design
Other Info
When the joystick is in its resting position, its biaxial offset is 511 (full-scale 0-1023) or in hexadecimal, 0x01FF. The low byte is transmitted before the high byte and width of 2 frames (2 bytes + 2 stop bits) was found to be 481us, meaning the system has a measured baud rate of 37422 bps. The image below shows the waveform on a logic analyzer for the transmitted joystick position at rest.