433 Nunchuk Receive Motor Control
by paulware in Circuits > Arduino
672 Views, 8 Favorites, 0 Comments
433 Nunchuk Receive Motor Control
This project will allow you to create a remote control vehicle.
The components will reside on the actual vehicle, while the transmission portion is covered by this instructable: https://www.instructables.com/id/Remote-Control-Vehicle-Transmitter-With-Arduino-Bl/
The components are from https://sites.google.com/site/arduinoblockly/components:
- 433 transmit receive module pair
- Arduino Nano with breadboard
- L298 H-Bridge
Note: Your power supply should be 7.2 V or greater to insure the L298 H-Bridge can convert it to 5V for the Arduino Nano.
Setup:
- Download Arduino IDE from https://www.Arduino.cc
- Download the ch340 usb driver from http://www.arduined.eu/ch340-windows-8-driver-download/
- Download the RoboticsLibrary from https://www.github.com/Paulware/RoboticsLibrary
- Place the RoboticsLibrary directory in your Arduino libraries directory
- Place the Blockly directory on your C drive.
Create the Blockly Diagram
The text stream object will be connected to the 433 receiver via a digital pin (pin 11).
When the Text Stream is Ready:
If the text stream == "w':
Move H-Bridge forward
Else if the text stream is "s":
Move H-Bridge down
Else if the text stream is "a":
Move H-Bridge left
Else if the text stream is "d":
Move H-Bridge right
Else
Stop the H-Bridge for both motors
Create a diagram based on the above pseudocode which matches the above diagram
Then, in blockly, press Arduino Copy to Clipboard
Paste the Arduino Code Into the IDE
Open the Arduino IDE and select File New to create a new sketch.
Press Cntl-A to select all the current text and then Cntl-V to paste the clipboard contents into the sketch . You should see something like the image above. Select Sketch compile to see if the sketch compiles correctly. If it does not compile, this is usually because the RoboticsLibrary has not been placed in the Arduino libraries directory.
To find out the location of your Arduino libraries directory, select File, Preferences in the Arduino IDE and note the sketch location. This directory should contain your sketches as well as the libraries directory .The Robotics Library fromhttps://www.github.com/Paulware/RoboticsLibrary should be located there. Once the sketch compiles, connect the Nano and in Tools select the port for the nano. Then from Tools select Board=>Nano. Then press upload. This will load the sketch on the nano.
Wire Up the Project (using Male Headers)
To wire the project. Connect the H-Bridge 5,6,9,10 pin to the Arduino Nano. Connect the motor1 wires to the first motor and motor2 wires to the second motor. Then connect your battery + to the + and the battery - to the minus of the H-Bridge. The H-Bridge will also provide power for the nano so connect the 5V output of the H-Bridge to the 5V of the Nano, and the Gnd of the H-Bridge to the GND of the Nano. Connect the receiver output to pin 11 of the Arduino Nano.
Now select tools, Serial Monitor and the sketch should show "Ready". When the rc receiver gets commands from the rc transmitter (covered in instructable:https://www.instructables.com/id/Remote-Control-Vehicle-Transmitter-With-Arduino-Bl/) you should see the rc motor move.