Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Samira Peiris
Published © GPL3+

Mesh Connected Rovers with Particle

Two robots that navigate through a maze while using Particle's 3rd generation IoT hardware to send information to the cloud.

IntermediateFull instructions provided20 hours1,424
Mesh Connected Rovers with Particle

Things used in this project

Hardware components

Argon
Particle Argon
×2
Pololu QTR-8RC Array
×2
12V Gear Motor 210 RPM
×4
VNH2SP30 Dual Motor Controller
×1
Dual MC33926 Motor Driver Carrier
×1
Arduino Mega 2560
Arduino Mega 2560
×2
LM2596 Buck Converter
×2
XT60 Connector
×2
3S Lipo 1500mAh
×2

Software apps and online services

Arduino IDE
Arduino IDE
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Laser cutter (generic)
Laser cutter (generic)

Story

Read more

Custom parts and enclosures

Frame DXF

3mm or more acrylic plastic - Laser Cut

Battery Holder for 3S 1500mAh Lipo

Print at 20% infill - PLA

Code

Rover 1 - Arduino Code

Arduino
For Rover 1, I have used motors with encoders, and two IR sensors with comparators (digital output for white or black) for the leftmost and rightmost senors.
No preview (download only).

Rover 2 - Arduino Code

Arduino
For Rover 2 - I have used motors without encoders (distances are traveled using delays) and QTRC panels for leftmost and rightmost sensors
No preview (download only).

Rover 2 - Particle Board Code

Arduino
Upload to rover 2 particle board using particle IDE
#include <Wire.h>
int node = -1;
int prev_node = -1;

byte started = 0;


void setup() {
    Wire.begin(9); 
    Wire.onReceive(receiveEvent); // Attach a function to trigger when something is received.
}

void receiveEvent(int bytes) {
    node = Wire.read();    // read one character from the I2C
}


void loop() {
    
    
    if (node!=prev_node){
        int g = analogRead(A5);
	    
	    Particle.publish("node2", String(node) , 60, PRIVATE);
        Particle.publish("gas", String(g), 60, PRIVATE);
	
	    prev_node = node;
	
    }
    

}

Rover 1 - Particle Board Code

Arduino
Upload to rover 2 particle board using particle IDE
#include <Wire.h>
int node = -1;
int prev_node = -1;

#include "Adafruit_DHT.h"
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22		// DHT 22 (AM2302)


DHT dht(DHTPIN, DHTTYPE);

void setup() {
    Wire.begin(9); 
    Wire.onReceive(receiveEvent); // Attach a function to trigger when something is received.
	dht.begin();
	
	
}

void receiveEvent(int bytes) {
    node = Wire.read();    // read one character from the I2C
}

void loop() {
    
    if (node!=prev_node){
      t = dht.getTempCelcius();
	    
	    Particle.publish("node1", String(node) , 60, PUBLIC);
	    char eventData[10];
      sprintf(eventData, "%.2f", t);
      Particle.publish("temperature", eventData, 60, PUBLIC);
	
	    prev_node = node;
	
    }
    

}

Credits

Samira Peiris
13 projects • 65 followers
Electrical and electronic engineer from Sri Lanka. I'm interested in AI, computer vision and embedded systems.

Comments