Arduino-Based Multi-Switch and Sensor Control System with Joystick Integration
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various switches, potentiometers, a joystick module, and multiple microcontrollers (Arduino Leonardo, Arduino Micro, and AS5600 magnetic encoder). The circuit is designed to read inputs from these components and process them using the microcontrollers. The microcontrollers are programmed to handle the inputs and provide outputs accordingly.
Component List
AS5600 Magnetic Encoder
- Pins: DIR, SCL, SDA, GP0, VCC, OUT, GND
- Description: Magnetic encoder for precise angle measurement.
Rotary Potentiometer
- Pins: leg1, wiper, leg2
- Description: Adjustable resistor for varying resistance.
- Properties: Resistance: 10,000 Ohms
Potentiometer
- Pins: GND, Output, VCC
- Description: Adjustable resistor for varying resistance.
Micro Switch
- Pins: COM, NO, NC
- Description: Small switch for detecting mechanical movements.
Toggle Switch
- Pins: Vcc, Sig, Gnd
- Description: Switch for toggling between two states.
Toggle Switch SPST
- Pins: L1, COM
- Description: Single-pole single-throw switch.
2Pin Push Switch
- Pins: Input +, Output +
- Description: Push-button switch for momentary contact.
Arduino Micro (Rev3)
- Pins: MISO, 5V, SCK, MOSI, RESET, GND, RXLED/SS, D1/TX, D0/RX, D2/SDA, D3/SCL, D4 PWM/A6, D5 PWM, D6 PWM/A7, D7, D8 PWM/A8, D9 PWM/A9, D10 PWM/A10, D11 PWM, D12 PWM/A11, VIN, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13 PWM
- Description: Microcontroller board for various applications.
Arduino Leonardo (Rev3b)
- Pins: D0/RX, D1/TX, D2/SDA, D3 PWM/SCL, D4/A6, D5 PWM, D6 PWM/A7, D7, n.c., IOREF, RESET, 3V3, 5V, GND, VIN, A0, A1, A2, A3, A4, A5, D8/A8, D9 PWM/A9, D10 PWM/A10, D11 PWM, D12/A11, D13 PWM, AREF, SDA, SCL
- Description: Microcontroller board for various applications.
Joystick Module V2
- Pins: Signal, Ground, VCC, DATA
- Description: Joystick module for directional input.
Tactile Switch Buttons - 12mm Square
- Pins: 3, 1, 4, 2
- Description: Small push-button switch for user input.
Arduino Micro Pro
- Pins: RAW, RST, VCC, A3, A2, A1, A0, 15, 14, 16, 10, 9, 8, 7, 6, 5, 4, 3, 2, GND, RX, TX
- Description: Compact microcontroller board for various applications.
Wiring Details
AS5600 Magnetic Encoder
- SCL connected to SCL of Arduino Leonardo
- SDA connected to SDA of Arduino Leonardo
- VCC connected to 5V of Arduino Leonardo
- GND connected to GND of Arduino Leonardo
Rotary Potentiometer
- leg1 connected to 5V of Arduino Leonardo
- wiper connected to A1 of Arduino Leonardo
- leg2 connected to GND of Arduino Leonardo
Potentiometer
- GND connected to GND of Arduino Leonardo
- Output connected to A0 of Arduino Leonardo
- VCC connected to 5V of Arduino Leonardo
Micro Switch
- COM connected to D2/SDA of Arduino Leonardo
- NO connected to GND of Arduino Leonardo
Toggle Switch
- Vcc connected to 5V of Arduino Leonardo
- Sig connected to A4 of Arduino Leonardo
- Gnd connected to GND of Arduino Leonardo
Toggle Switch SPST
- L1 connected to GND of Arduino Leonardo
- COM connected to D4/A6 of Arduino Leonardo
2Pin Push Switch
- Input + connected to A2 of Arduino Leonardo
- Output + connected to GND of Arduino Leonardo
Arduino Micro (Rev3)
- 5V connected to 5V of Arduino Leonardo
- GND connected to GND of Arduino Leonardo
- A0 connected to Input + of 2Pin Push Switch
- A1 connected to Output + of 2Pin Push Switch
- A2 connected to Input + of 2Pin Push Switch
- A3 connected to Output of Potentiometer
- A4 connected to DATA of Joystick Module V2
- A5 connected to Signal of Joystick Module V2
- D2/SDA connected to 4 of Tactile Switch Buttons
- D3/SCL connected to 4 of Tactile Switch Buttons
- D4 PWM/A6 connected to 4 of Tactile Switch Buttons
- D5 PWM connected to 4 of Tactile Switch Buttons
- D6 PWM/A7 connected to 4 of Tactile Switch Buttons
- D10 PWM/A10 connected to Signal of Joystick Module V2
- D11 PWM connected to Sig of Toggle Switch
- D12 PWM/A11 connected to Sig of Toggle Switch
- D13 PWM connected to Output of Potentiometer
Arduino Leonardo (Rev3b)
- SCL connected to SCL of AS5600 Magnetic Encoder
- SDA connected to SDA of AS5600 Magnetic Encoder
- 5V connected to Vcc of Toggle Switch
- GND connected to GND of Toggle Switch
- D2/SDA connected to COM of Micro Switch
- D3 PWM/SCL connected to COM of Micro Switch
- D4/A6 connected to COM of Toggle Switch SPST
- D5 PWM connected to COM of Toggle Switch SPST
- D6 PWM/A7 connected to COM of Toggle Switch SPST
- D7 connected to COM of Toggle Switch SPST
- A0 connected to Output of Potentiometer
- A1 connected to wiper of Rotary Potentiometer
- A2 connected to Input + of 2Pin Push Switch
- A3 connected to COM of Toggle Switch SPST
- A4 connected to Sig of Toggle Switch
- A5 connected to Input + of 2Pin Push Switch
- D8/A8 connected to Sig of Toggle Switch
- D9 PWM/A9 connected to Sig of Toggle Switch
- D10 PWM/A10 connected to Sig of Toggle Switch
- D11 PWM connected to Sig of Toggle Switch
- D12/A11 connected to Sig of Toggle Switch
- D13 PWM connected to Input + of 2Pin Push Switch
Joystick Module V2
- Signal connected to A5 of Arduino Micro
- Ground connected to GND of Arduino Micro
- VCC connected to 5V of Arduino Micro
- DATA connected to A4 of Arduino Micro
Tactile Switch Buttons - 12mm Square
- 2 connected to 2 of Tactile Switch Buttons
- 4 connected to D2/SDA of Arduino Micro
- 4 connected to D3/SCL of Arduino Micro
- 4 connected to D4 PWM/A6 of Arduino Micro
- 4 connected to D5 PWM of Arduino Micro
- 4 connected to D6 PWM/A7 of Arduino Micro
Code Documentation
AS5600 Magnetic Encoder Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}