Step 1: Part of List
You will probably first want to prototype it. Here is the parts that you'll need for the control board.- 1 Arduino Nano
- 2 Joy Stick/Thumb Stick modules/Break-out boards,
- 1 OLED I2C display
- 1 NRF24L01
- 1 Battery packs 6V - 9V
- 1 Micro USB for the Nano
Step 2: NRF24L01
Lets begin assembling the NRF24L01 Module. Start with connecting the Vcc to the 3.3V supply. Do be extra careful on this step. You do not want to sort this pin to 5V or higher it will FRY your module. My best advice is to get the adapter board that this modules sits right on which regulates power up to 15V. This also takes care of the power problem with this module. Since the 3.3V rail on the Arduino does not supply enough power for optimum range. There are many libraries out there but the one that was used in my code is probably the best library. It offers optimum range and signal strength. Contact me if you have trouble installing this library.- Next connect the Ground Pin to the Ground.
- Connect CE pin to pin 7 on the Nano
- Connect CS pin to pin 8 on the Nano
- Connect CLK pin to pin 13 on the Nano
- Connect MOSI pin to pin 11 on the Nano
- Connect MISO pin to pin 12 on the Nano
- The last pin is not needed at the Moment.
After wiring the pin you are ready to test out.
On the Arduino IDE go to example and load an NRF24L01 example to the Nano Board 1, then do the same thing to the Nano Board 2. Make sure that one is a client and the other is a server. And then use Serial Monitor to validate the communication. You should be getting messages from one device to another.
Step 3: Joy Stick Modules
These are fairly straight forward. Each Joystick should have 5 pins, VCC, GND, X, Y, and SW.
- Connect VCC to 5V on the Nano
- Connect GND to ground
- Connect X axis to A3
- Connect Y axis to A2
- Connect SW to D2
Similarly on the other joystick connect X2 to A1, Y2 to A0 and SW to D3
Now upload my code to the Nano board and use Serial Monitor to test the Joy Sticks modules to see if you are reading correct output when you flip the Joy Sticks. You should be getting raw values from 0 to 1023 due to the output of the 10 bit built in ADC (analog to digital converters) which converts 5V Analog voltages to digital levels.
Step 4: OLED
You'll need a driver for this OLED which I suggest the SSD1306 from Adafruit. Just search for this library and install it in the arduino software (message me if you don't know what this means). Here is how you wire up the OLED display:
- Connect 5V to either 5V rail or 3.3V supply rail on the Nano
- Connect SDA and SCL pin to A4 and A5 (I2C pins)
- Connect GND to Ground
Run my code and you should see the OLED turns on. If it doesn't then you'll probably have a different address. The way I2C communication protocol works is that one of its first data package that the master (in this case your Arduino Nano) sends out contains the addressing byte to identify that slave. In this case would be your OLED. You might want to run a address scanner to identify what your address is for your OLED.
Step 5: Battery
Probably the easiest step. If you had a 9V smoke alarm battery you can connect the 9V supply to the Vin of your nano. GND to the GND of your nano and it would light up. Other wise you can by 4 1.5 AAA batteries and connect them in series which produce 6V total. That should also be enough for your Nano Board.
And there you have it. Your very own controller board.
No comments:
Post a Comment