![]() ![]() ![]() ![]() Connect the other pin to the ground of Arduino board.First, connect pin number 8 of Arduino board to one pin of the coil.V in is connected to Arduino 5V, and GND to GND.Īfter placing the relay on the breadboard, you can start identifying the two important parts on your relay: the coil part which commands the relay, and the switch part where we will attach the LED.Connect the SPI pins to Arduino board: MOSI, MISO, and CLK to pins 11, 12, and 13, respectively.Connect the IRQ pin of the CC3000 board to pin number 3 of the Arduino board.The hardware configuration for this project is very easy. Procedureįollow the circuit diagram and make the connections as shown in the image given below. We are also going to use the aREST library to send commands to the relay via WiFi. Components Requiredįor this project, you just need the usual Arduino IDE, the Adafruit’s CC3000 library, and the CC3000 MDNS library. A built-in TCP/IP stack with a "BSD socket" interface supports TCP and UDP in both the client and the server mode. It supports 802.11b/g, open/WEP/WPA/WPA2 security, TKIP & AES. It has a proper interrupt system with IRQ pin so you can have asynchronous connections. ![]() It uses SPI for communication (not UART!) so you can push data as fast as you want or as slow as you want. So here the first parameter contains the addresses information, the second parameter points which data will be send, and the third parameter is the size of the data.The CC3000 WiFi module from Texas Instruments is a small silver package, which finally brings easy-to-use, affordable WiFi functionality to your Arduino projects. At the end, using the write() function we send the data to the other node. Then we create a network header where we assign the address of the node where the data is going. Then we read the value of the potentiometer and convert it into a value from 0 to 180 which is suitable for the servo control. In the loop section we constantly need to call the update() function through which all action in the network happens. In the setup section we need to initialize the network, by setting the channel and the address of this node. Here we need define the addresses of the nodes in octal format, or 00 for this node, and 01 for the other node at the servo side. Then we need to create the RF24 object, and include it into the RF24Network object. write(header, &angleValue, sizeof(angleValue)) // Send the dataįirst we need to include both libraries RF24 and RF24Network, as well as the SPI library. Unsigned long potValue = analogRead(A0) // Read the potentiometer value unsigned long angleValue = map(potValue, 0, 1023, 0, 180) // Convert the value to 0-180 RF24NetworkHeader header (node01) // (Address where the data is going) bool ok = network. begin( 90, this_node) //(channel, node address) */ # include # include # include RF24 radio ( 10, 9) // nRF24L01 (CE,CSN) RF24Network network (radio) // Include the radio in the network const uint16_t this_node = 00 // Address of this node in Octal format ( 04,031, etc) const uint16_t node01 = 01 = Example 01 - Servo Control / Node 00 - Potentiometer = Arduino Wireless Network - Multiple NRF24L01 Tutorial ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |