Arduino Projects: Difference between revisions

 
(4 intermediate revisions by the same user not shown)
Line 472:
 
<pre style="width: 75%; height: 10pc; overflow-y: scroll;">const int motor1Pin1 = 10;
const int motor1Pin1 = 10;
const int motor1Pin2 = 11;
const int motor2Pin1 = 6;
Line 786 ⟶ 785:
= Obstacle Avoiding Robot =
 
{{UC}}
<pre style="width: 75%; height: 10pc; overflow-y: scroll;">
 
</pre>
<br />
 
= Bluetooth Controlled RGB LED Strip =
Line 1,045 ⟶ 1,041:
= LED Matrix Clock =
https://123led.wordpress.com/mini-led-clock/
{{UC}}
 
= RF 433 MHz Module =
 
Source: [https://randomnerdtutorials.com/rf-433mhz-transmitter-receiver-module-with-arduino/ randomnerdtutorials.com]
 
*Download the Library file:
https://lastminuteengineers.com/libraries/RadioHead-1.84.zip
 
*Connect the circuit as below:
Arduino Tx Module
5v VCC
GND GND
12 Data
 
Arduino Rx Module
5v VCC
GND GND
11 Data
 
*Transmitter Side Code
<pre>
#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
 
RH_ASK driver;
 
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
 
void loop()
{
const char *msg = "Hello World!";
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(1000);
}
</pre>
 
 
*Receiver Side Code
<pre>
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
 
RH_ASK driver;
 
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
 
void loop()
{
uint8_t buf[12];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) // Non-blocking
{
int i;
// Message with a good checksum received, dump it.
Serial.print("Message: ");
Serial.println((char*)buf);
}
}
</pre>
 
= Motor Shield =
 
Source: [https://lastminuteengineers.com/l293d-motor-driver-shield-arduino-tutorial/ lastminuteengineers.com]
 
*Single DC power supply for both Arduino and motors:
Plug Voltage < 12V into the DC jack on the Arduino or the 2-pin EXT_PWR block on the shield.
Jumper ON
*(Recommended) Arduino via USB and motors via DC power supply:
Arduino plug in the USB cable.
Then connect the motor supply to the EXT_PWR block on the shield.
Jumper OFF
 
*Arduino Jack and motors via DC power supply:
Plug in the supply for the Arduino into the DC jack.
Connect the motor supply to the EXT_PWR block.
Jumper OFF
 
Warning:
DO NOT supply power to the EXT_PWR input when jumper is in place.
It may damage the motor shield and also your Arduino!
 
The shield offers below features:
The shield comes with a pulldown resistor array to keep motors switched off during power-up.
The on-board LED indicates the motor power supply is Okay. If it is not lit, the motors will not run.
The RESET is nothing but Arduino’s reset button. It just brought up top for convenience.
 
<br />