<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>WowWee Fun: Robosapien 1.0</title><link>https://community.element14.com/products/arduino/w/documents/18358/wowwee-fun-robosapien-1-0</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>WowWee Fun: Robosapien 1.0</title><link>https://community.element14.com/products/arduino/w/documents/18358/wowwee-fun-robosapien-1-0</link><pubDate>Tue, 01 Nov 2016 21:19:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2f148013-9e6c-4a0f-9ac9-99ce9dd9c02a</guid><dc:creator>russm24</dc:creator><comments>https://community.element14.com/products/arduino/w/documents/18358/wowwee-fun-robosapien-1-0#comments</comments><description>Current Revision posted to Documents by russm24 on 11/1/2016 9:19:50 PM&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/421x316/__key/communityserver-wikis-components-files/00-00-00-02-65/3187.contentimage_5F00_76935.jpg"&gt;&lt;img alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/02/65/3187.contentimage_76935.jpg-421x316.jpg?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=u5jYnCjlQQL3IlMRfr4SqSI3UO6IEMSRDJilEKaLMBk%3D&amp;amp;se=2026-09-19T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=pI9Kmj6ZxKvZjCAh9pvktQ==" style="max-height: 316px;max-width: 421px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The RoboSapien 1.0 is ideal for barebones stripping and experimentation, as the motors and switches are set in place and any changes that you wish to be made may easily be done by reassigning their configuration. It is truly ahead of its time in terms of its engineering build and resources pertaining to its documentation can be found on the net for free. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&amp;nbsp; In this documentation, I aim for the following:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:12pt;"&gt;Strip the robot down to bare wires and integrate the use of PIC&amp;#39;s to reconfigure its driver&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:12pt;"&gt;Map out the control board by reverse engineering the electronics&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:12pt;"&gt;Use an application that coordinates with the website API &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:12pt;"&gt;Utilize web SSH to send signals to the microcontroller indicating a change or activation of a motor &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The process is relatively simple, and a fast project that can be done within 2-3 hours. Without further ado, let&amp;#39;s get started.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;strong&gt;Step 1: Disassembly &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;- This part is fairly easy and there is no need for an elaborate explanation. Simply unscrew the front side of the robot&amp;#39;s enclosure. The power switch as well as the speakers must be removed as well with screws, but conveniently have extra connection pads in them for you to add to. The main control board is at the back side. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;- Afterwards, Remove and disconnect all wires from the board and unscrew it. Pin connections are imbued on the PCB&amp;#39;s under side so check that for the connections. For this experiment, we will be using the VCC, GND and&amp;nbsp; IR pins. Solder about 15 cm of wires to&amp;nbsp; each them as such. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/620x413/__key/communityserver-wikis-components-files/00-00-00-02-65/7220.contentimage_5F00_76936.jpg"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/02/65/7220.contentimage_76936.jpg-620x413.jpg?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=lbXmoc77S5qrMqREc8CC0VK2SJcrIikVGeTwftm9Zo8%3D&amp;amp;se=2026-09-19T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=vPHofDHP3BLVA0CMMW03Ug==" style="max-height: 413px;max-width: 620px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;strong&gt;Step 2: Connect to the PIC&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;- Mount the 3 connections mentioned above to your microcontroller (I used an Arduino Mega atm for this). &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The IR signals, per se, are separated by spaces meaning that each bit that passes data will create a high and then a low right after. The pulses will indicate if the bit is 1 or 0. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt; I experimented quite a bit on coding in order to get the establishment between the two right, and this is what I came up with:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void loop()
{
  unsigned char val = 0;
  unsigned long start, ts, dur;
  
  while(digitalRead(irPin)) { 
  start = micros(); 
  }
   
  while(!digitalRead(irPin))
  ts = (micros() - start) / 8;
  }
   
  for(char b = 7; b &amp;gt;= 0; b--) {
  start = micros();
  while(digitalRead(irPin)) { 
  dur = micros() - start;
  }
  if(dur &amp;gt; ts*2)
  val |= 1&amp;lt;&amp;lt;b;  
  while(!digitalRead(irPin)) { }  
  }
   
  Serial.println(val, HEX);  
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The output data seems to come out easily, so that was a good start.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;strong&gt;Step 3: Web Code Implementation &lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The microcontroller will enable us to emulate the same binaries that the original remote that came with the packaging gives. Since we were able to pull them from the code used in the previous step, we are now ready for serial communication. The control board must be triggered on remote mode so as to prevent any disruptions when booting up, which afterwards it can be switched back to where you assigned the MCU.&amp;nbsp; Plug the wires to their respective assignments based on the code below. You may add an LED as an optional accessory to indicate if it works. Upload the following code:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include

volatile int viRobsapienCmd = -1;  // A robosapien command sent over the UART request
#define RSTurnRight       0x80
#define RSRightArmUp      0x81
#define RSRightArmOut     0x82
#define RSTiltBodyRight   0x83
#define RSRightArmDown    0x84
#define RSRightArmIn      0x85
#define RSWalkForward     0x86
#define RSWalkBackward    0x87
#define RSTurnLeft        0x88
#define RSLeftArmUp       0x89
#define RSLeftArmOut      0x8A
#define RSTiltBodyLeft    0x8B
#define RSLeftArmDown     0x8C
#define RSLeftArmIn       0x8D
#define RSStop            0x8E
#define RSWakeUp          0xB1
#define RSBurp            0xC2
#define RSRightHandStrike 0xC0
#define RSNoOp            0xEF

//
#define RSRightHandSweep  0xC1
#define RSRightHandStrike2 0xC3
#define RSHigh5           0xC4
#define RSFart            0xC7
#define RSLeftHandStrike  0xC8
#define RSLeftHandSweep  0xC9

#define RSWhistle         0xCA
#define RSRoar            0xCE

int command, buff[]={
0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0xB1,
0xC2, 0xC0, 0xEF, 0xC1, 0xC3, 0xC4, 0xC7, 0xC8, 0xC9};

int LedControl = 13;     // Show when control on
int IROut= 6;            // Where the echoed command will be sent from
int bitTime=516;          // Bit time (Theoretically 833 but 516)
// works for transmission and is faster
int last;                 // Previous command from IR

//////////////////////////////////////////////////////////////////
// Begin Robosapien specific code
//////////////////////////////////////////////////////////////////
// send the command 8 bits
void RSSendCommand(int command) {
digitalWrite(IROut,LOW);
delayMicroseconds(8*bitTime);
for (int i=0;i&amp;lt;8;i++) {
digitalWrite(IROut,HIGH);
delayMicroseconds(bitTime);
if ((command &amp;amp; 128) !=0) delayMicroseconds(3*bitTime);
digitalWrite(IROut,LOW);
delayMicroseconds(bitTime);
command &amp;lt;&amp;lt;= 1;
}
digitalWrite(IROut,HIGH);
delay(250); // Give a 1/4 sec before next
}

// Set up Robosapien functionality
void RSSetup()
{
pinMode(IROut, OUTPUT);
pinMode(LedControl,OUTPUT);
digitalWrite(IROut,HIGH);

// Make robot burp to indicate setup is complete
RSSendCommand(RSBurp);
}

void setup()
{
Serial.begin(9600);
Serial.println(&amp;quot;RobSapien Start&amp;quot;);

RSSetup();
}

void loop()
{

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;I added a few annotations along the way to guide you. Although there a couple of mapped out functions, the complete table was not included on the code.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;The server functions by utilizing a hexadecimal and a trigger character to the back of the main IRl thereby sending a command to the control board. Line 68 can be changed around as such.&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;"&gt;---&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;br /&gt;&lt;span style="font-size:12pt;"&gt;And there you have it. You are now able to control your Robosapien via a complex non-tied webserver!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>