Peter MaShin Ae Hong
Published © GPL3+

3D Magnetic S2E Robot Arm Remote

Use an Infineon 3D magnetic sensor to remotely control a robotic arm over WIZnet Serial to Ethernet (S2E).

IntermediateFull instructions provided5 hours4,110

Things used in this project

Hardware components

WIZ750SR-TTL-EVB Kit
WIZnet WIZ750SR-TTL-EVB Kit
×1
WIZ750SR
WIZnet WIZ750SR
×1
3D Magnetic Sensor 2Go
Infineon 3D Magnetic Sensor 2Go
×1
Dobot Magician
×1

Software apps and online services

Windows 10
Microsoft Windows 10
Arduino IDE
Arduino IDE

Story

Read more

Schematics

Infineon 3DGo and WIZ750SR Wiring

The wiring diagram for Infineon 3DGo and WIZ750SR, which runs through RX TX serial port. connected directly to S2E

Code

3DGo Arduino S2E code.

Arduino
Code used on Infineon 3DGo to be send into WIZNet S2E
#include <Tle493d_w2b6.h>
Tle493d_w2b6 Tle493dMagnetic3DSensor = Tle493d_w2b6();
//for firing
float norm = 0;
float azimuth = 0;
bool x = false;
int frame = 0;

void setup() {
 Serial.begin(115200);
 while (!Serial);
 pinMode(14, OUTPUT);
 Tle493dMagnetic3DSensor.begin();
 Tle493dMagnetic3DSensor.begin();
 Tle493dMagnetic3DSensor.setWakeUpThreshold(1,-1,1,-1,1,-1);
 Tle493dMagnetic3DSensor.disableTemp();
 norm = Tle493dMagnetic3DSensor.getNorm();

}
void loop() {
   Tle493dMagnetic3DSensor.updateData();
   //Serial.print(Tle493dMagnetic3DSensor.getNorm());
   //Serial.print(" ; ");
   //Serial.println(Tle493dMagnetic3DSensor.getAzimuth());
   //It doubles when press down, and halves when releases
   if(Tle493dMagnetic3DSensor.getNorm() > 100)
   {
      Serial.println("front");
      digitalWrite(14, HIGH);
   }
   else if(Tle493dMagnetic3DSensor.getNorm() < 39)
   {
      Serial.println("back");
      digitalWrite(14, HIGH);    
   }
   else if((int)(Tle493dMagnetic3DSensor.getAzimuth()*10) > (int)(azimuth * 10))
   {
      Serial.println("left");
   }
   else if((int)(Tle493dMagnetic3DSensor.getAzimuth()*10) < (int)(azimuth * 10))
   {
      Serial.println("right");
   }
   else
   {
      Serial.println("stop");
      digitalWrite(14, LOW);
   }
   azimuth = Tle493dMagnetic3DSensor.getAzimuth();
   norm = Tle493dMagnetic3DSensor.getNorm();

   delay(100);
}

Robotic Arm Receiver code

C#
C# Code for Robotic Arm Receiver
       public TcpClient tcpClient;
       private Thread receiveThread;
       private string left;
       private string right;
       private string front;
       private string back;
       private string stop;
    
       private void StartClient()
       {
           IPAddress ipAddress = IPAddress.Parse("192.168.1.200");
           tcpClient = new TcpClient();
           tcpClient.Connect(ipAddress, 5000);
           receiveThread = new Thread(receiverMessages);
           receiveThread.Start();
       }
       private void receiverMessages()
       {
           while (true)
           {
               NetworkStream ns = null;
               try
               {
                   ns = this.tcpClient.GetStream();
               }
               catch (InvalidOperationException ex)
               {
                   MessageBox.Show(ex.Message);
               }
               if (ns != null)
               {
                   StreamReader sr = new StreamReader(ns);
                   if (sr != null)
                   {
                       try
                       {
                           string message = sr.ReadLine();
                           receiveEvent(message);
                       }
                       catch (IOException e)
                       {
                           MessageBox.Show(e.ToString());
                       }
                   }
               }
           }
       }
       private void receiveEvent(string message)
       {
           Console.WriteLine(message);
           if (!isConnectted)
               return;

           if (message.Contains(left))
           {
               active = true;
               currentCmd.isJoint = isJoint;
               currentCmd.cmd = (byte)JogCmdType.JogBNPressed;
               DobotDll.SetJOGCmd(ref currentCmd, false, ref cmdIndex);
           }
           else if (message.Contains(right))
           {
               active = true;
               currentCmd.isJoint = isJoint;
               currentCmd.cmd = (byte)JogCmdType.JogBNPressed;
               DobotDll.SetJOGCmd(ref currentCmd, false, ref cmdIndex);
           }
           else if (message.Contains(front))
           {
               active = true;
               currentCmd.isJoint = isJoint;
               currentCmd.cmd = (byte)JogCmdType.JogANPressed;
               DobotDll.SetJOGCmd(ref currentCmd, false, ref cmdIndex);
           }
           else if (message.Contains(back))
           {
               active = true;
               currentCmd.isJoint = isJoint;
               currentCmd.cmd = (byte)JogCmdType.JogAPPressed;
               DobotDll.SetJOGCmd(ref currentCmd, false, ref cmdIndex);
           }
           else if (message.Contains(stop))
           {
               currentCmd.cmd = (byte)JogCmdType.JogIdle;
               DobotDll.SetJOGCmd(ref currentCmd, false, ref cmdIndex);
           }
           bool active = false;
           UInt64 cmdIndex = 0;
       }

Robotic Arm code

Code for controller Robotic Arm from PC

Credits

Peter Ma

Peter Ma

49 projects • 393 followers
Prototype Hacker, Hackathon Goer, World Traveler, Ecological balancer, integrationist, technologist, futurist.
Shin Ae Hong

Shin Ae Hong

5 projects • 35 followers
Global Startup Incubation Specialist @Innoway

Comments