Skip to content

19. Final project requirements

For a more detailed and organised explanation you can view my final project page.

Questions

What does it do?

Octo is an controllable tentacle that moves with help of 4 servos.

What did you design?

I designed everything myself exept Quintin Bolsees beehive axes.

What materials and components were used?

Most of it is 3d printed with PLA.
I used some cable glans that I ordered online.
I used 4 servos mg966r.
I used some tubing that I had laying around. I used some plywood for the vertabrea.
Esp32 wroom module

Where did they come from?

All I ordered on Amazone

How much did they cost?

I think everthing cost between 50 - 75 euro’s

What parts and systems were made?

The vertabrea
The housing
The pulleys The pcb

What processes were used?

Lasercutting Pcb milling 3d printing Casting and moulding

What questions were answered?

The arm can be controlled with an app that’s commercially available.

What worked? What didn’t?

I wanted to use a controller that I had made. But unfortunately I couldn’t get it to work with a wireless protocol. Time was running out… I eventually controlled it with the app Dabble that worked fine.

What are the implications?

Having so many individual parts that I wanted to intergrate in Octo I did not finish one particularly part perfectly. But! I made such I nice beginning for an Octo that can do a lot of stuff!

Prepare a summary slide and a one minute video showing its conception, construction, and operation. Your project should incorporate 2D and 3D design, additive and subtractive fabrication processes, electronics design and production, embedded microcontroller interfacing and programming, system integration and packaging.

Where possible, you should make rather than buy the parts of your project. Projects can be separate or joint, but need to show individual mastery of the skills, and be independently operable. Present your final project.

Plan

I did a lot of stuff the past few weeks but now it’s time to make the an ectual final project that I can present. There were a lot of fall backs that I didn’t expected so I need to cut some ideas off and make the best of it.

I had a lot of trouble with the xiao esp32-c3 boards. I managed to control 4 servos via the analog pins (See my previous documentation in week 17)

Esp32-wroom Wrover module

Step 1: How to Connect Your ESP32 to a MacBook
Install the driver in order to communicate UART through USB.
Go to Preferences/Security & Privacy and allow the driver to run, and restart the Mac.
Connect your Micro USB to your ESP32 Board.
Run $ ls /dev/cu.* and you should now see /dev/cu.SLAB_USBtoUART.
Before starting the next step, make sure you have the latest version of the Arduino IDE installed in your computer. It can be found by the following link.

Thisi is the driver I installed.

CP210x Macintosh OS VCP Driver v6 Release Notes

plan

This is what I’ll try when the esp32 wrooms arrive.

This is the code that kind of works.

#include <Servo.h>

Servo myservo = Servo();

const int servoPin1 = D0;
const int servoPin2 = D1;
///const int servoPin3 = D2;
//const int servoPin4 = D3;

const int joyX1 = D2;
const int joyY1 = D3;

int joyVal; 

void setup() {
}

void loop() {

    joyVal = analogRead(joyX1);
    joyVal = map (joyVal, 0, 254, 0, 180);
    myservo.write(servoPin1, joyVal);        // set the servo position (degrees)
    joyVal = analogRead(joyY1);
    joyVal = map (joyVal, 0, 254, 0, 180);
    myservo.write(servoPin2, joyVal);

}

receiver code

58:CF:79:EA:DE:5C write as 0x58, 0xCF, 0x79, 0xEA, 0xDE, 0x5C

Notes and Tryouts

ESPNOW

Thanks to this tutorial I set up an MAC communication protocol.

sender code

// SENDER RANDOM NERD

#include <esp_now.h>
#include <WiFi.h>

// REPLACE WITH YOUR RECEIVER MAC Address
uint8_t broadcastAddress[] = {0x58, 0xCF, 0x79, 0xF1, 0x39, 0xC0};

// Structure example to send data
// Must match the receiver structure
typedef struct struct_message {
  char a[32];
  int b;
  float c;
  bool d;
} struct_message;

// Create a struct_message called myData
struct_message myData;

esp_now_peer_info_t peerInfo;

// callback when data is sent
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
  Serial.print("\r\nLast Packet Send Status:\t");
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}

void setup() {
  // Init Serial Monitor
  Serial.begin(115200);

  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Once ESPNow is successfully Init, we will register for Send CB to
  // get the status of Trasnmitted packet
  esp_now_register_send_cb(OnDataSent);

  // Register peer
  memcpy(peerInfo.peer_addr, broadcastAddress, 6);
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;

  // Add peer        
  if (esp_now_add_peer(&peerInfo) != ESP_OK){
    Serial.println("Failed to add peer");
    return;
  }
}

void loop() {
  // Set values to send
  strcpy(myData.a, "THIS IS A CHAR");
  myData.b = random(1,20);
  myData.c = 1.2;
  myData.d = false;

  // Send message via ESP-NOW
  esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));

  if (result == ESP_OK) {
    Serial.println("Sent with success");
  }
  else {
    Serial.println("Error sending the data");
  }
  delay(2000);
}

receiver code

//  RECEIVER RANDOM NERD 

#include <esp_now.h>
#include <WiFi.h>

// Structure example to receive data
// Must match the sender structure
typedef struct struct_message {
    char a[32];
    int b;
    float c;
    bool d;
} struct_message;

// Create a struct_message called myData
struct_message myData;

// callback function that will be executed when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
  memcpy(&myData, incomingData, sizeof(myData));
  Serial.print("Bytes received: ");
  Serial.println(len);
  Serial.print("Char: ");
  Serial.println(myData.a);
  Serial.print("Int: ");
  Serial.println(myData.b);
  Serial.print("Float: ");
  Serial.println(myData.c);
  Serial.print("Bool: ");
  Serial.println(myData.d);
  Serial.println();
}

void setup() {
  // Initialize Serial Monitor
  Serial.begin(115200);

  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Once ESPNow is successfully Init, we will register for recv CB to
  // get recv packer info
  esp_now_register_recv_cb(OnDataRecv);
}

void loop() {

}

I couldn’t get this to work.

Blynk

Blynk link

// Chage These Credentials with your Blynk Template credentials
// Chage These Credentials with your Blynk Template credentials 
#define BLYNK_TEMPLATE_ID "TMPL4VOoTrAE7"
#define BLYNK_TEMPLATE_NAME "Multi Servo Control with New Blynk2"
#define BLYNK_AUTH_TOKEN "FA8IwZQ8Awr3HLy4NpzdPIoom6CKqQ2R"

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

#include<Servo.h>
Servo servo1, servo2, servo3, servo4, servo5;

char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "TELE2-2F4221_2.4G"; // Change your Wifi/ Hotspot Name
char pass[] = "3532A96F3EA7"; // Change your Wifi/ Hotspot Password

BLYNK_WRITE(V0)x
{
  int s0 = param.asInt(); 
  servo1.write(s0);
  Blynk.virtualWrite(V5, s0);
}
BLYNK_WRITE(V1)
{
  int s1 = param.asInt(); 
  servo2.write(s1);
  Blynk.virtualWrite(V6, s1);
}
BLYNK_WRITE(V2)
{
  int s2 = param.asInt(); 
  servo3.write(s2);
  Blynk.virtualWrite(V7, s2);
}
BLYNK_WRITE(V3)
{
  int s3 = param.asInt(); 
  servo4.write(s3);
  Blynk.virtualWrite(V8, s3);
}
BLYNK_WRITE(V4)
{
  int s4 = param.asInt(); 
  servo5.write(s4);
  Blynk.virtualWrite(V9, s4);
}

void setup()
{
  Serial.begin(9600);
  servo1.attach(D2);
  servo2.attach(D3);
  servo3.attach(D5);
  servo4.attach(D6);
  servo5.attach(D7);
  Blynk.begin(auth, ssid, pass);//Splash screen delay
  delay(2000); 
}

void loop() 
{
  Blynk.run();
}

It was kind of working but not smooth enough

Troubleshoot

When this is happening A fatal error occurred: Unable to verify flash chip connection (No serial data received.). Failed uploading: uploading error: exit status 2 reboot the esp32 by holding the B button.

If you need to reset, you are asked to do so. You can first try to reset the board by clicking the RESET BUTTON once while the board is connected to your PC. If that does not work, hold the BOOT BUTTON , connect the board to your PC while holding the BOOT button, and then release it to enter bootloader mode.

Huh?? It worked with one but the other one is still defect.

servos

rainmaker

This works link can you import your xiao servo and joystick code.

try to upload existiging codes from the 2 tutorials on esp8266

robot arm 4 servos

stepper

link link


Last update: June 22, 2023