3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Python/Arduino Serial Controller: Homemade Blast Furnace

Python/Arduino Serial Controller: Homemade Blast Furnace

What started as a simple project to make a small firing container for ceramics experiments spiraled out of control into a scrap-constructed, CPU controlled, Oxygen-injected miniature blast furnace.
The finished project combines a GUI interface, I/O firmware, analog control circuitry, chemistry and thermodynamics.

The core of this project is the Python-Arduino serial interface, in which I include the flexible control code and the data collection/GUI software. I would like to present this project as a particular instantiation of this flexible framework as the controller of a somewhat difficult system. I would like people to take away from this project the utility of the python controller, and ideally use that section of code as a tool in their own projects. This is the reason I include the flexible version of the software/firmware, which is far overpowered for this particular project. I intend the presentation of the Blast Furnace project as an example case for how to use the serial controller.

The software level is a python executable, incorporating the zelle graphics module to support the GUI, and pySerial  to support the serial communication protocol. The software includes a communication layer that encapsulates the Serial protocols, and a control layer (GUI, file processing and interfacing).

The firmware level is a short program which receives serial data from the CPU and implements the commands as a switch-based I/O board. The Microcontroller used is an Arduino Nano.

The Hardware level includes electronic, chemical, and structural elements, including the furnace itself, the safety stand, an electrolysis pool, Thermocouple and associated circuitry, switching circuits, and a drip feed for fuel injection.

The primary fuel for the furnace is 90% commercially available isopropyl alcohol. The electrolysis pool uses an electrolyte solution of saturated Epsom salt (MgSO4) in water.

In the following sections, I will discuss the construction and operation of each individual section, and conclude with the construction of the complete device.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Serial Connection

Serial Connection
The whole apparatus is controlled via serial port from a PC. Coordinating serial communication between the CPU and the MCU, which run on different clocks, is the most difficult part of the project. In practice, coordination was accomplished by consistent use of transmit-receive-transmit-receive blocks, where neither the PC nor the MCU can progress until each transmission to the MCU is acknowledge, and receipt of any return data from the MCU is recorded by the PC.

The serial communication protocol consists of a 4-byte command from the master (the PC) and a 2-byte return from the MCU. An example transmit-receive action would look like this:
PC: '255'-'101'-'11'-'0'        A start byte ('255') followed by command-data-address transmissions
MCU: '9999'-'0'                   a receipt acknowledge ('9999'), followed by return data.
This example tells the MCU to set digital output pin 11 low; the MCU collects no data, so it just returns '0'.

The command byte is cast to an integer by the MCU, and sorted by a simple switch/case block. The data byte contains any pertinent data for the action called for by the command, which is usually a pin designation. The address byte is mostly unused, but is added in for ease of use in cases where two data parcels are required to use an MCU function, such as PWM (or analogWrite() in Arduino) which \requires both a pin and a value. This scheme is easier and simpler to coordinate than a 2-transmission protocol for such aberrant functions.  

The software implementation is attached, as well as the Firmware for Arduino. Both sets of code are commented for comprehension.
(Note that the python file requires pySerial)
« Previous StepDownload PDFView All StepsNext Step »
2 comments
Jul 22, 2011. 1:04 AMilium007 says:
Hi - the two blastFurnace links above don;t work. Any chance of reposting them. Cheers. Nice project ;)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
1
Author:ckrobi