Arduino MKR WiFi 1010
Force Sensors (4)
Push Button
LEDs (4)
We used the Arduino MKR WiFi 1010 because it is WiFi connected and can easily connect to the IoT Cloud. All of the tutorials I referenced for the circuit used the Arduino Uno Series, so I had to modify steps for the MKR Series.
Each key has a force sensor under it, so when the key is pressed, the color that is coded with that sensor appears on the LEDs. When the key is pressed harder, the LED becomes a brighter shade of that color.
In order to extend how far the force sensors can reach so they can fit in the keys, I soldered wires onto each of them. On the Arduino Project Hub, I referenced a wiring diagram for pressure sensors to wire the circuit for the sensors.
We put a button on the toy that switches the 'color pack' that can appear on the LEDs. After the button is pressed, the color each sensor is coded with changes. Each pin on the button had to be soldered for it to fit on the breadboard.
I referenced a tutorial for using a button with Arduino, specifically for the wiring of the circuit. This tutorial includes an LED in the circuit, but I did not use one here. After placing the push button on the breadboard, I connected a jumper wire from the 5-volt pin to one side of the push button. I then connected another jumper wire from pin 2 on the Arduino to the other side of the button. I put one end of a 10k resistor in the ground rail and connected the other end to the same side of the push button that pin 2 connects to.
We used RGB color-changing LEDs, so we can obtain infinite different colors from a single LED light. All of the LEDs are coded to change colors when a force sensor is pressed. There are 4 LEDs on our toy so it is easy to tell what color is being produced.
In order to extend the length of the LEDs to reach where we wanted them to on the toy, I soldered each of the 4 pins of 4 LEDs to longer wires. I referenced an Arduino RGB LED Circuit Diagram on the Arduino Project Hub for the specific wiring of an RGB LED. I connected the longest pin, the cathode, to the ground rail of the Arduino, and each of the other three pins to three pins on the Arduino through a 220 ohm resistor. Since this specific kind of LED is color changing, it is important that the connecting pins on the Arduino are PWM pins, which are identified with a ~ symbol. These allow the brightness to change, which can allows to obtain many other colors.