Wireless 3D Printing with Bluetooth, Marlin, and RAMPS 1.4

The initial modifications to the Reprap 3D Printer firmware called Marlin are ready for public testing. I’m using it now to control the printer wirelessly and run jobs from its SD card. The code is at https://bitbucket.org/terawattindustries/marlin-bt (master branch). Communication speed between Arduino and BT is @ 115.2kbps. UPDATE: default speed is now 500K in firmware means set your BT module accordingly.

Hardware

I’m using the Bluetooth module discussed in a previous post. The Bluetooth setup costs about $25. Terawatt Industries is manufacturing a PCB design so this attaches directly onto RAMPS and will work with RepRap power sources without an adapter board as shown.

  • I’m using the BT module I blogged about at https://tenacious33.wordpress.com/2012/07/21/5v-tolerant-bluetooth-module/. It’s reliable and inexpensive. It’s class 2 but that seems perfect here.
  • Speed is 115.2kbps. 250k (Marlin max) should work with the firmware also, but this BT module is programmed for 115.2k. UPDATE: I’ve confirmed Marlin go handle the MEGA’s max USART speed of 1M bps. This module goes a little faster so I’m experimenting with 921.6k bps and will know more soon.

Software

The new features are:

  • Installs just like Marlin – use the Arduino IDE.
  • Enabled with a #define in Configuration.h.
  • Backwards compatible with USB connections, whether or not #define’d.
  • USB and Bluetooth connections live side-by-side. In testing we can have one machine connected to the printer via USB, then connect to the printer from another machine using Bluetooth and issue GCODE commands, like SD print. The machine that’s connected via USB echoes all of this on its console (Pronterface) and we can even disconnect and re-connect the BT module to eavesdrop without affecting the print.
  • USART2 is used for Bluetooth communication in the firmware and USART0’s behavior is mostly intact. Actually, when BT support is enabled everything on USART0 gets multiplexed to USART2.
  • USB and Bluetooth commands shouldn’t collide. This isn’t well tested – it’s an unusual scenario – but the firmware should only read one command from each port and block the other until the end of command is reached. There are some interesting implications. Let’s move along…

Instructions

These instructions apply to the pictured BT module. The module must be wired as 5V tolerant as mentioned in my blog post.

RAMPS Setup

    1. Download the Bluetooth-enabled version of Marlin from the Terawatt Industries Bitbucket Repository.
    2. Install the firmware on your (RAMPS/Arduino MEGA) control board. The reprap wiki has instructions for this if you need help.
    3. Connect the BT module’s 3v3 pin to a 3.3 volt power source. The Terawatt ATX PSU Adapter Board and the ATX PSU Dev Board from Ultimachine are awesome for this. They’re perfect for powering 3D printers too.
    4. Connect the BT module’s GND pin to a ground source.
    5. Connect the TX pin from the BT module to pin 17 on RAMPS 1.4.
    6. Connect the RX pin from the BT module — through the 5v tolerant circuit — to pin 16 on RAMPS. If you skip the 5v tolerant circuitry you’ll fry this BT module as stated in the datasheet.

    Printing via Bluetooth

    These instructions assume you’ve already installed the Bluetooth-capable Marlin firmware on your RAMPS 1.4 Control Board and attached a working Bluetooth module to it.

    1. Pair your computer to the BT module. Doing this depends on your OS, whether you run Windows, OS X, Linux, or otherwise. For this module the name contains the word “linvor”. The Linvor BT module has a pin of 1234.
    2. Open Pronterface.
    3. Set connection speed to 115200
    4. Choose the port listed with the name of your Bluetooth module
    5. Click Connect
    6. Tell Pronterface to print all the neat things stored on its SD Card. You can print via bluetooth – just make sure your computer stays in-range for the duration of the print.

    Addendum

    If you’re using the “screen” app or a terminal to drive the Bluetooth connection the following GCODE commands can be useful:

    M119
    M104 S190
    M140 S60
    M20
    M23 myfile.gco
    M24
    M27

    Advertisements

2 thoughts on “Wireless 3D Printing with Bluetooth, Marlin, and RAMPS 1.4

    1. Yes, you can. I wrote at least 2 posts on the Terawatt Industries blog in 2012 about this topic. Unfortunately, the blog was defaced in 2014, and most of its content (not already on this blog) was lost as a result. I seem to recall some content on reprap.org about this, but I don’t recall where now. The YT video at http://randomthoughts.club/youtube.php?video=-ddUM8Fy3es might provide a good resource to get started, and applies to the HC05/06 BT module. If you use a module like BlueSmirf from Sparkfun you won’t need the voltage divider.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s