Inspiration
Simon says game is a classical game that we play with our friends during parties. There are many different formats of this game, some of them are related to body motions and some of them are related to pressing buttons in sequences. Unfortuantely, due to covid 19, people can not party any more so we come up with this idea that we will have a Simon Says game device on each user's end and we use cloud services to connect two or more devices together so this game can be played anywhere as long as there is internet connection. Now with the help of these devices, people can still party and enjoy the fun of simon says game remotely.
What it does
In this game, there will be two player. Player one will act as an runner, and Player two will act as a finder. When the game start, Player one will use the joystick to control where he want to goes. He can move five steps in total. For each move, the corresponding LED, which indicate where user 1 is at, will be light up, both on the local keypad and on the cloud. When Player one finished all his moves, his places he stepped through will be upload to the cloud. Then, player two will show up. Player two need to find player one by pressing the exact same path that player one have walk through. The player's two sequence of input matched player one's moves, he/she will win the game. Otherwise, player one will win the game.
How it works
BRAIN STORM AND HARDWARE SEARCH
The joystick will be the input to user and the keyboard will do output task to the user. The user will move the joystick to a certain direction and the other user's keyboard will show the direction of the joystick being moved.
MCU including Wifi (SAMW25) , ADAFRUIT NEOTRELLIS RGB DRIVER (3954) ADAFRUIT Mini 2-Axis Analog Thumbstick (2765)
SCHEMATIC DESIGN BY ALTIUM DESIGNER
The RGB driver is connected to MCU with I2C
The joystick is connected to MCU with analog input
The board takes a 5V input from wall plug thru barrel jack and provides 2 voltage rail 3.3V and 5V from the input.The 5V is taken from the barrel jack directly and the 3.3V is from TPS62827DMQR which is a buck converter that steps down 5V to 3.3V
PCB LAYOUT DESIGN BY ALTIUM DESIGNER AND PARTS SELECTION(BOM)
Board Size: 80mm * 80mm (we put the joystick onto the board so it takes up a lot of space)
4 Layer Board: Top Layer, Power Plane, Ground Plane, Bottom Plane
We build our own footprint for the joystick
Extra I2C and analog connector are available on the board for future development
The orientation of components on board is nicely arranged
Digikey is our main supplier
BOOTLOADER AND OTAFU
The Bootloader is stored at 0x0000 in the NVM, while the main firmware for the stored at 0x12000 in NVM.
The bootloader program is able to read the binary file in SD-card, erase the precious firmware starting at 0x12000, and write new firmware to the NVM.
Cyclic redundancy check (CRC) will be perform during the NVM write process to ensure the integrity of the updated firmware.
Over-The-Air Firmware Update (OTAFU) is available. It will be achieved by using the wifi chip to download the firmware from the UPenn server, restart the system, then using the bootloader to load the new firmware
NODE-RED DASHBOARD
Node-Red Deployed on IBM Cloud
Using HiveMQ as the MQTT broker to achieved data exchange
Player status and inputs will be reflected on the Node-Red dashboard in real-time
Game administrators can use the node-red dashboard to reset the game or start another game.
CLI AND FIRMWARE IMPLEMENTATION
Using FreeRTOS for the embedded system to achieve concurrency
Developing sensors' driver for the SAMD21 module
Challenges we ran into
There is no existing footprint for the joystick and no measurement in data sheet when we are doing PCB design so we have to dig deep into internet to find the measurement and create our own footprint for the joystick
Altium only shows the connection of electrical components but does not show the right order of the connection so we have to pay extra attention on placing the jumpers, pull up and pull down resistors
We failed to read the signature of the prototype initially. J-link cannot read the signature of our prototype devices properly. We resolved this by using the multimeter test out the connection steps by steps. In the end, we found out that the barrel jack was shorted. Thus, we did not use the barrel jack. Instead we provided power to the board directly. By doing so, it can work properly.
The subscribed MQTT topics can only be received once on the MCU. For the MQTT topics, if we set the QOS to 2, the message will be retained in the server for some reasons. After discussing these issues with peers, we found out that this can be addressed by setting QoS to 0 for all the subscribed topics.
What we learned with the prototype
We currently have an issue with the barrel jack power input port so in the next version, we will at least replace the current barrel jack with a correct version or upgrade the power input port to USB C
The y-axis reading of the joystick is not very stable. In some of the cases, it is very hard to detect the activity on the y-axis. The next step for the joystick will be to design a better circuit and develop a better algorithm so that the activity on the y-axis will be easier to be detected.
What we learned
PCB design including footprint, schematic and board layout design with Altium 21
Power consumption and voltage rail planning
Hardware searching and selection that meet our project function demand, budget and power consumption
Using the WIFI chip to connect an embedded device to the cloud and achieve the concept of IoT.
Porting drivers for the sensors using the manufactures' drivers.
What's next for Where did Simon go?
Add a speaker to the board so the use can play this game with sound guidances and there is no need for them to open Node Red dashboard when they play the game. In the end the board can announce the winner
Build a 3D-Print housing for this device so it can be easily carried around
Add another I2C sensor like gyroscope or accelerometer using extra I2C ports designed on the PCB board so the board can detect user’s motion and put these motions into games
Have another external battery solution so the devices can be completely portable.
Log in or sign up for Devpost to join the conversation.