Difference between revisions of "Sensor-Joystick"

From Microduino Wiki
Jump to: navigation, search
(Specification)
Line 1: Line 1:
{{Language|Microduino-Joystick }}
+
{{Language|Sensor-Joystick }}
 
{| style="width: 800px;"
 
{| style="width: 800px;"
 
|-
 
|-
 
|
 
|
[[File: Microduino-Joystick.jpg|400px|thumb|right| Microduino-Joystick]]
+
[[File:Microduino-Joystick-v1.jpg|400px|thumb|right| Microduino-Joystick]]
 
 
Microduino-Joystick is a joystick sensor, which can detect horizontal displacement of a joystick.
 
It can return analog values of X-axis and Y-axis via the analog port, whose range is between 0-1,023.
 
  
 +
The product number of Sensor-Joystick is: '''MSDS71'''
  
 +
Sensor-Joystick is analog sensor, which is used as five-direction rocker button.
  
 +
==Introduction of Sensor Pin==
 +
{{Sensor_explain
 +
|nameA=[[Sensor-Joystick]]
 +
|modeA=Analog signal input
 +
|modeB=NC(null)
 +
}}
 +
==Features==
 +
*With small size which is easy to install.
 +
*Five-direction stick button, only occupying 1 analog port.
  
==Features==
+
==Specification==
*With X- and Y-axis directions.
+
*Sensor voltage
*Small and beautiful 
+
**3.3V~5V working voltage
  
==Specification ==
+
*Size of the sensor
*Electrical specification
+
**Size of the board: 23.5mm*13mm
**Operation voltage: 3.3V~5V
+
**1.27mm-spacing 4Pin interface connected with sensorhub
**Input device
+
**CAD drawing of the sensor: '''[[File:Sensor_CAD.zip]]'''
*Tech parameters
 
**Pin description: GND, VCC, signal 1 output and signal 2 output. Since the output signal is simulated, you can use analog port to detect (A0-A7) by connecting to the pins including A7/A6, A3/A2 and A1/A0 of Sensorhub.
 
**Analog input
 
*Size
 
**Size of the switch: 17mm*17mm
 
**Size of the board: 20mm*24mm
 
**1.27mm-pitch 4Pin interface connects with Sensorhub.  
 
  
[[file:mCookie-sensorhub_rule.JPG|thumb|800px|center]]
+
*Function description
[[File: Microduino-Joystick_rule1.jpg|600px|thumb|center]]
+
**It can detect the direction up, down, left, right and being pressed of the stick button.  
 +
*Connection
 +
**This sensor can be connected to the following interfaces of the core: '''A0~A7'''
  
 
==Document==
 
==Document==
  
*Schematic: '''[[File: Microduino_ Joystick.Zip]]'''
+
*Schematic diagram: '''[[File: Sensor_Joystick.pdf]]'''
 
+
*Main sensor: '''[[File: SKRHABE010-datasheet.pdf]]'''
  
 
==Development==
 
==Development==
===Preparation===
+
===Program Download===
*Make sure you build Microduino IDE or refer to: [[Microduino Getting started]]
+
*Download and unzip the program '''[[File: Sensor_Joystick_Test.zip]]'''
*Core selection
 
**1. Adopt [[Microduino-CoreUSB]] or [[mCookie-CoreUSB]] as the core.
 
**2. Adopt [[Microduino-Core]] or [[Microduino-Core+]] as the core plus [[Microduino-USBTTL]] as the program download module.
 
 
 
  
===Program===
+
===Programming===
<source lang="cpp">
+
{{Upload
 +
|nameA=[[Microduino-Core]], [[Microduino-USBTTL]]
 +
|nameB=[[Microduino-USBTTL]]
 +
|boardName=Microduino/mCookie-Core(328p), Atmega328P@16M,5V
 +
|fileName=Sensor_Joystick_Test.ino
 +
}}
  
void setup() {
+
===Hardware Setup===
  Serial.begin(9600);    //Serial port initializing
+
*Referring to the following diagram, connect the Sensor-Joystick to the analog port A0/A1 of '''[[Microduino-Sensorhub]]'''.
}
+
<br>
 +
[[file:Microduino-sensorhub_Joystick.JPG|thumb|400px|left]]
 +
<br style="clear: left"/>
  
void loop() {
+
===Result===
  int sensorValueX = analogRead(A0);      //X-axis input
+
*After download, open the serial monitor.
  int sensorValueY = analogRead(A1);      //Y-axis input
+
**When press the stick toward different direction, the serial port will print out different contents.  
  float voltageX = sensorValueX * (5.0 / 1023.0);
 
  float voltageY = sensorValueY * (5.0 / 1023.0);
 
  Serial.print(voltageX);
 
  Serial.print(",");
 
  Serial.println(voltageY);
 
  delay(50);
 
}
 
}
 
</source>
 
  
===Hardware Buildup===
 
*Stack all modules firstly, then connect Microduino-Joystick with Sensorhub to A0/A1 port with a wire. 
 
Please refer to: [[Microduino-Sensorhub]]
 
[[file:Microduino-sensorhub_Analog.PNG|thumb|400px|center]]
 
Please refer to: [[mCookie-Hub]]
 
[[file:mCookie-sensorhub_Analog.PNG|thumb|400px|center]]
 
*Connect the core, Sensorhub and LED to a computer with a USB cable.
 
*Select the right board and COM port, compile and download. You can refer to [[AVR Core:Getting started]]
 
[[file:upload.JPG|thumb|800px|center]]
 
*Choose the right port number from Tools→Serial Port in Arduino IDE after compiling and then download program. 
 
*Open the serial monitor after download and you'll see analog quantities on the direction of X-axis and Y-axis displayed on the console. When the joystick is in the middle, it displays around 2.5 on both X-axis and Y-axis. 
 
 
==Application==
 
==Application==
You can simulate mouse movement and other displacement sensors as human-computer interaction input.
+
*Rocker button input device
 
 
===Project===
 
* '''[[The Use of Joystick Sensor]]'''
 
  
==Purchase==
+
==Project==
  
 
==History==
 
==History==
  
==Pictures==
+
==Gallery==
 
+
{| border="0" cellpadding="10" width="100%"
*Front
+
|-
[[file: Microduino-Joystick-F.JPG|thumb|600px|center|Microduino-Joystick Front]]
+
|width="50%" valign="top" align="left"|
*Back
+
[[file: Microduino-Joystick-F.JPG|thumb|480px|center|mCookie-Joystick Front]]
[[file: Microduino-Joystick -b.JPG|thumb|600px|center|Microduino-Joystick Back]]
+
|width="50%" valign="top" align="left"|
 +
[[file: Microduino-Joystick-b.JPG|thumb|480px|center|mCookie-Joystick Back]]
 +
|}
 
|}
 
|}

Revision as of 05:02, 18 September 2016

Language: English  • 中文
Microduino-Joystick

The product number of Sensor-Joystick is: MSDS71

Sensor-Joystick is analog sensor, which is used as five-direction rocker button.

Introduction of Sensor Pin

Sensor backpin.png
  • Pins of the sensor:
    • PIN1: GND
    • PIN2: VCC
    • General signal pins:
      • PIN3(IO1): digital/analog signal
      • PIN4(IO2): NC(null)
    • Special signal pins:
      • If it is IIC: IO1/IO2 are respectively SDA/SCL.
      • If it is soft serial port: IO1/IO2 are respectively tx/rx.
  • Special to Sensor-Joystick sensor pins
    • PIN1: GND
    • PIN2: VCC
    • PIN3(IO1): Analog signal input
    • PIN4(IO2): NC(null)


Microduino sensor can communicate with core module through the connection with Microduino-Module Sensor Hub.

Features

  • With small size which is easy to install.
  • Five-direction stick button, only occupying 1 analog port.

Specification

  • Sensor voltage
    • 3.3V~5V working voltage
  • Size of the sensor
    • Size of the board: 23.5mm*13mm
    • 1.27mm-spacing 4Pin interface connected with sensorhub
    • CAD drawing of the sensor: File:Sensor CAD.zip
  • Function description
    • It can detect the direction up, down, left, right and being pressed of the stick button.
  • Connection
    • This sensor can be connected to the following interfaces of the core: A0~A7

Document

Development

Program Download

Programming

  • Follow the Software Getting Started Guide.
  • Select the Board, Processor and Port.
  • Click [File]->[Open], browse to the project program address, and click "Sensor_Joystick_Test.ino" to open the program.
  • After confirming all these items are correct, click "→" to download the program to the development board.

Hardware Setup

  • Referring to the following diagram, connect the Sensor-Joystick to the analog port A0/A1 of Microduino-Sensorhub.


Microduino-sensorhub Joystick.JPG


Result

  • After download, open the serial monitor.
    • When press the stick toward different direction, the serial port will print out different contents.

Application

  • Rocker button input device

Project

History

Gallery

File:Microduino-Joystick-F.JPG
mCookie-Joystick Front
File:Microduino-Joystick-b.JPG
mCookie-Joystick Back