Jy-mcu

From RepRap
Revision as of 07:53, 19 February 2014 by Jamesdanielv (talk | contribs)
Jump to: navigation, search

jy-mcu is a board that contains the hardware of the hc-03,hc05,hc06 chipsets. compatibility is the same as they all accept the same at commands, however voltage levels may be different, so use caution if it is not on a board with 4 pin headers.

This is a bt adapter that is used on some reprap with bt connection. Also will provide detailed instructions on how to setup with using android device only.


Bluetooth is a wireless technology used for short range communications. Bluetooth has protocols that allow it to mimic serial communications and this makes it perfect for use with arduino, and on a ramps board for 3d printing software controls such as pronterface, and repetier host.

Also it allows programing to be done on any device that has arduino ide. this includes PC, Mac, ubuntu, and android.


here is a video of it working on a reprap.

http://www.youtube.com/watch?v=eZO8BniV1xI&lc=ShtOIYGwn4AhHoBuM1LTSm9Suhi8WjYiwIZM74MbKF0

here is a program i made that runs on arduino ide and automatically detects baud rate and sets up device. bt_magic.ino for arduino runs on version 1 of arduino ide. also serial monitor needs to be at 57600 and set to no line ending. cr and line need to be disabled for serial monitor.

Now there is a version that runs with software serial, so it works on basically anything ported to arduino that can run software serial library. tested on arduino 1.5, but should work as far back as 1.0 softwareserialbtmagic

here is a video of the program used to setup bluetooth adapter link title

SETUP with android devices requires a ON THE GO CABLE and the following free apps to be installed Arduino Communicator (to setup usb comm), arduino droid, and free usb serial. free usb serial app acts as the terminal because the system monitor does not yet exist in android version of arduino ide.


I will do another video soon (using a better camera), and add multicomm port program ability.

enjoy!. questions or comments or feedback contact me on the forum. thanks!



troubleshooting----------

if using a device and it fails to detect, first shorten the tx/rx lines to less than 6 inches, if still not detecting, but you get a single dot at one of the baudrates before a _no, then there is a signal timing issue . it can be addressed by replacing the bauddetect loop in the code with this below. you are accepting one half of the ok signal response. it is not the best method, but it will allow you to access and change your device.

//replace section below void bauddetect( long x){//this solved baudrate Serial.print("baudrate:"); Serial.print(x); int byte1; int detect=0;//used to know if detected long time_keeper=millis();//get start millseconds Serial2.begin(x);//starts at baudrate delay(400);//stabilizer Serial2.print("AT");//initialization command while(millis()-time_keeper<2000){

 //while within 
  if (Serial2.available() > 0) { 
   byte1= Serial2.read();
 if (byte1==79 | byte1==75){
   Serial.print(".");
   detect++; //if o or k is sent then increment
   byte1=0; //clear
 }


   };// conditions met for char sent
}//while loop
Serial2.flush();
Serial2.end();//stops serial at baud rate
delay(200);//stabilizer
if (detect < 1) {x=0; Serial.println("_no");}//clears if result is not a valid response from bt host
else{ Serial.println("_yes");// if baud then 
final_baud=x;//store baud rate for use.
}

} //---end of replacement code