Difference between revisions of "Microduino NFC Unlocks Computer"

From Microduino Wiki
Jump to: navigation, search
 
Line 4: Line 4:
 
|
 
|
 
==Outline==
 
==Outline==
*Project:Microduino NFC Unlocks Computer
+
*Project: Microduino NFC Unlocks Computer
*Objective:Enter the password is very complicated in some time, so this tutorial will resolve this problem. Microduino use the NFC module and nRF24 wireless module to unlock the computer immediately via an electronic tags. If you want to control multiple computers, only need one Micreduino NRF to control multiple electronic tags.
+
*Objective: Enter the password is very complicated in some time, so this tutorial will resolve this problem. Microduino use the NFC module and nRF24 wireless module to unlock the computer immediately via an electronic tags. If you want to control multiple computers, only need one Microduino NRF to control multiple electronic tags.
*Difficulty:High
+
*Difficulty: High
*Time-consuming:6 hours
+
*Time-consuming: 6 hours
*Maker:Microduino Studio-YLB
+
*Maker: Microduino Studio-YLB
  
 
==Principle==
 
==Principle==
This system uses Microduino nRF24 module to set up network. The master system use the Miccroduino core module (Miccroduino-Core or Microduino Core+ or Microduino 32U4), Microduino nRF24, Microduino NFC, Microduino FT232R which build a gateway.
+
This system uses Microduino nRF24 module to set up network. The master system use the Microduino core module (Microduino-Core or Microduino Core+ or Microduino 32U4), Microduino nRF24, Microduino NFC, Microduino FT232R which build a gateway.
Using the Miccroduino-Core, Microduino nRF24 and AVR-USB-HID made by yourself to build a network point. Every electrionic tag has different ID, the gateway identifies different ID, then sends the command to it, otherwise waiting for electronic tag. After the network point received the command, trigger the AVR-USE-HID device to input the passward (actually simuate the keyboard to input the keyboard value), then unlock the computer immediately.
+
Using the Miccroduino-Core, Microduino nRF24 and AVR-USB-HID made by yourself to build a network point. Every electronic tag has different ID, the gateway identifies different ID, then sends the command to it, otherwise waiting for electronic tag. After the network point received the command, trigger the AVR-USE-HID device to input the passward (actually simulate the keyboard to input the keyboard value), then unlock the computer immediately.
 
                                                                                                                                
 
                                                                                                                                
 
[[File:Microduino_nfc—nrf.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc—nrf.jpg||600px|center|thumb]]
Line 39: Line 39:
 
|Microduino-Core||1||Core
 
|Microduino-Core||1||Core
 
|-
 
|-
|Microduino-FT232R ||1||Downlaod program
+
|Microduino-FT232R ||1||Download program
 
|-
 
|-
 
|Microduino-nRF24 ||1||Wireless
 
|Microduino-nRF24 ||1||Wireless
Line 57: Line 57:
 
Download UsbKeyboard library:https://github.com/suapapa/arduino_library_UsbKeyboard
 
Download UsbKeyboard library:https://github.com/suapapa/arduino_library_UsbKeyboard
  
Download RF24 library:https://github.com/maniacbug/RF24/
+
Download RF24 library: https://github.com/maniacbug/RF24/
  
Download NFC library:https://github.com/adafruit/Adafruit_NFCShield_I2C
+
Download NFC library: https://github.com/adafruit/Adafruit_NFCShield_I2C
  
Download test program:https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced_Tutorial/Microduino_nrf_NFC
+
Download test program: https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced_Tutorial/Microduino_nrf_NFC
  
 
==Debug==
 
==Debug==
*Step 1:Make AVR-USB-HID device
+
*Step 1: Make AVR-USB-HID device
The voltage of AVR-USB-HID device must be in 2.8v to 3.6V. We will introduce one method which changed the Microduino power supply to 3.3v. You can change the power selction registor 0 to 3.3v pin, then the voltage will match the requirement. If you don't want to change the Microduino, there is another method which uses an external Voltage regulator tube, detailed information, please refer to following link:
+
The voltage of AVR-USB-HID device must be in 2.8v to 3.6V. We will introduce one method which changed the Microduino power supply to 3.3v. You can change the power selection resistor 0 to 3.3v pin, then the voltage will match the requirement. If you don't want to change the Microduino, there is another method which uses an external Voltage regulator tube, detailed information, please refer to following link:
 
http://www.microduino.cc/wiki/index.php?title=Lesson_5--Microduino_Simulates_Computer_Keyboard
 
http://www.microduino.cc/wiki/index.php?title=Lesson_5--Microduino_Simulates_Computer_Keyboard
 
**Equipment
 
**Equipment
Line 81: Line 81:
 
[[File:Microduino_nfc_nrf1.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc_nrf1.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc_nrf2.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc_nrf2.jpg||600px|center|thumb]]
Principle introduction:
+
Principle introduction:
1.Two 68Ω registor play a current-limiting resistance and protection function, to prevent accidental damage the computer USB port or microcontroller port.
+
1.Two 68Ω resistor play a current-limiting resistance and protection function, to prevent accidental damage the computer USB port or microcontroller port.
2.The 2.2kΩ pull-up registor use to identify the bus state. If it connects to D+ and +5v, that means it is a high speed USB device, otherwise connecets to D- and +5v, will be used as slow speed USB device. In this experiment, the keyboard's speed is slow, so it will connect to D-.
+
2.The 2.2kΩ pull-up registor use to identify the bus state. If it connects to D+ and +5v, that means it is a high speed USB device, otherwise connects to D- and +5v, will be used as slow speed USB device. In this experiment, the keyboard's speed is slow, so it will connect to D-.
3.The 3.3V voltage chip use to power the systoem which leads to the Microduino core's I/O port voltage will be 3.3v, easy to identify the USB device.
+
3.The 3.3V voltage chip use to power the system which leads to the Microduino core's I/O port voltage will be 3.3v, easy to identify the USB device.
  
*Step two:Set up gateway
+
*Step two: Set up gateway
 
**Used module
 
**Used module
 
[[File:Microduino_nfc_nrf3.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc_nrf3.jpg||600px|center|thumb]]
Line 101: Line 101:
 
We set up two points, so will define two points in gateway program, uses the "x" to select the point. If the player want to add more points, only need add more cases and the value of "x" in program.
 
We set up two points, so will define two points in gateway program, uses the "x" to select the point. If the player want to add more points, only need add more cases and the value of "x" in program.
 
**Change the test program
 
**Change the test program
***Open the program "microduino_nrf_nfc_receive",point 1 will use "const uint16_t this_node = 1;" then x equal to 1, point 1 will use "const uint16_t this_node = 2;", x equal to 2. This will avoid the data conflict.
+
***Open the program "microduino_nrf_nfc_receive", point 1 will use "const uint16_t this_node = 1;" then x equal to 1, point 1 will use "const uint16_t this_node = 2;", x equal to 2. This will avoid the data conflict.
***Change the passward. Need to change the key value in key function. You can find the key value in file UsbKeyboard.h of library UsbKeyboard. It only contains a part value of keyboard, but it is enough to use. You can change to your passward, then compile the program.
+
***Change the password. Need to change the key value in key function. You can find the key value in file UsbKeyboard.h of library UsbKeyboard. It only contains a part value of keyboard, but it is enough to use. You can change to your password, then compile the program.
**After donwload, insert the AVR-USB-HID device to computer, if successed, you can find the HID Keyboard Device service keyboards of Device Manager. If can't find it, you need to check if there is welding error on AVR-USB-HID.
+
**After download, insert the AVR-USB-HID device to computer, if succeeded, you can find the HID Keyboard Device service keyboards of Device Manager. If can't find it, you need to check if there is welding error on AVR-USB-HID.
 
[[File:Microduino_nfc_nrf7.jpg||600px|center|thumb]]
 
[[File:Microduino_nfc_nrf7.jpg||600px|center|thumb]]
 
*Step 4:Use the notepad to test firstly
 
*Step 4:Use the notepad to test firstly
Power on the gateway, and point connects to computer by the AVR-USB-HID device, and then use the NRF to identify electronic tag, check the notepad's valude if match with the passward. If yes, then you start to control.
+
Power on the gateway, and point connects to computer by the AVR-USB-HID device, and then use the NRF to identify electronic tag, check the notepad's value if match with the password. If yes, then you start to control.
  
 
==Result==
 
==Result==
Set up the system, the gateway read the electronic tag 1, then the point 1 will input the passward automatically to unlock the computer. The same as point 2.
+
Set up the system, the gateway read the electronic tag 1, then the point 1 will input the password automatically to unlock the computer. The same as point 2.
  
 
==Difficulty==
 
==Difficulty==
Line 119: Line 119:
 
*Don't confuse the D+, D- when making AVR-USB-HID device;
 
*Don't confuse the D+, D- when making AVR-USB-HID device;
 
*Currently Microduino NFC can identify iso14443a type electronic tag;
 
*Currently Microduino NFC can identify iso14443a type electronic tag;
*Make sure the point and computer are matche, otherwise the passward is inverse.
+
*Make sure the point and computer are matched, otherwise the password is inverse.
  
 
==Video==
 
==Video==
  
 
|}
 
|}

Latest revision as of 09:28, 12 September 2016

Language: English  • 中文

Outline

  • Project: Microduino NFC Unlocks Computer
  • Objective: Enter the password is very complicated in some time, so this tutorial will resolve this problem. Microduino use the NFC module and nRF24 wireless module to unlock the computer immediately via an electronic tags. If you want to control multiple computers, only need one Microduino NRF to control multiple electronic tags.
  • Difficulty: High
  • Time-consuming: 6 hours
  • Maker: Microduino Studio-YLB

Principle

This system uses Microduino nRF24 module to set up network. The master system use the Microduino core module (Microduino-Core or Microduino Core+ or Microduino 32U4), Microduino nRF24, Microduino NFC, Microduino FT232R which build a gateway. Using the Miccroduino-Core, Microduino nRF24 and AVR-USB-HID made by yourself to build a network point. Every electronic tag has different ID, the gateway identifies different ID, then sends the command to it, otherwise waiting for electronic tag. After the network point received the command, trigger the AVR-USE-HID device to input the passward (actually simulate the keyboard to input the keyboard value), then unlock the computer immediately.

Microduino nfc—nrf.jpg

Bill of Materials

Microduino gateway

Module Number Function
Microduino-Core 1 Core
Microduino-FT232R 1 Download program
Microduino-nRF24 1 Set up network,Wireless network
Microduino-NFC 1 Read the electronic tag

Microduino network point

Module Number Function
Microduino-Core 1 Core
Microduino-FT232R 1 Download program
Microduino-nRF24 1 Wireless
AVR-USB-HID device 1 Simulate keyboard

Other equipment

Electronic tag 1 Similar to the computer ID
USB cable 3 Power supply

Document

Download UsbKeyboard library:https://github.com/suapapa/arduino_library_UsbKeyboard

Download RF24 library: https://github.com/maniacbug/RF24/

Download NFC library: https://github.com/adafruit/Adafruit_NFCShield_I2C

Download test program: https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced_Tutorial/Microduino_nrf_NFC

Debug

  • Step 1: Make AVR-USB-HID device

The voltage of AVR-USB-HID device must be in 2.8v to 3.6V. We will introduce one method which changed the Microduino power supply to 3.3v. You can change the power selection resistor 0 to 3.3v pin, then the voltage will match the requirement. If you don't want to change the Microduino, there is another method which uses an external Voltage regulator tube, detailed information, please refer to following link: http://www.microduino.cc/wiki/index.php?title=Lesson_5--Microduino_Simulates_Computer_Keyboard

    • Equipment
3.3V Voltage chip 1 Optional or use the 3.3v power
68Ω registor 2 50~100Ω registor works well
2.2kΩ registor 1 1.5k~2.2k resigtor works well
Wire 2 Jumper

Schematic

Microduino nfc nrf1.jpg
Microduino nfc nrf2.jpg

Principle introduction: 1.Two 68Ω resistor play a current-limiting resistance and protection function, to prevent accidental damage the computer USB port or microcontroller port. 2.The 2.2kΩ pull-up registor use to identify the bus state. If it connects to D+ and +5v, that means it is a high speed USB device, otherwise connects to D- and +5v, will be used as slow speed USB device. In this experiment, the keyboard's speed is slow, so it will connect to D-. 3.The 3.3V voltage chip use to power the system which leads to the Microduino core's I/O port voltage will be 3.3v, easy to identify the USB device.

  • Step two: Set up gateway
    • Used module
Microduino nfc nrf3.jpg
    • Stack all module
Microduino nfc nrf4.jpg
    • Download the used library, and copy to the libraries folder of Arduino IDE;
    • Download the test program, and open the "Microduino_nfc_nrf_send" program, compile it and then download.
  • Step 3: Set up network point
    • Used module
Microduino nfc nrf5.jpg
    • Stack all module (If the system use the exteranl 3.3v power, then no need FT232 module again)
Microduino nfc nrf6.jpg

We set up two points, so will define two points in gateway program, uses the "x" to select the point. If the player want to add more points, only need add more cases and the value of "x" in program.

    • Change the test program
      • Open the program "microduino_nrf_nfc_receive", point 1 will use "const uint16_t this_node = 1;" then x equal to 1, point 1 will use "const uint16_t this_node = 2;", x equal to 2. This will avoid the data conflict.
      • Change the password. Need to change the key value in key function. You can find the key value in file UsbKeyboard.h of library UsbKeyboard. It only contains a part value of keyboard, but it is enough to use. You can change to your password, then compile the program.
    • After download, insert the AVR-USB-HID device to computer, if succeeded, you can find the HID Keyboard Device service keyboards of Device Manager. If can't find it, you need to check if there is welding error on AVR-USB-HID.
Microduino nfc nrf7.jpg
  • Step 4:Use the notepad to test firstly

Power on the gateway, and point connects to computer by the AVR-USB-HID device, and then use the NRF to identify electronic tag, check the notepad's value if match with the password. If yes, then you start to control.

Result

Set up the system, the gateway read the electronic tag 1, then the point 1 will input the password automatically to unlock the computer. The same as point 2.

Difficulty

  • Make AVR-USB-HID device, need to make sure the voltage of USB in 2.8-3.6V;
  • Microduino NRF24 set up network, wireless communication;
  • Microduino NFC electronic tag identify。

Pay attention issue

  • Don't confuse the D+, D- when making AVR-USB-HID device;
  • Currently Microduino NFC can identify iso14443a type electronic tag;
  • Make sure the point and computer are matched, otherwise the password is inverse.

Video