A quick summary of the last blog: I used a thermistor to measure temperature, soldered my mains power switching circuit, and I discovered that the raspberry pi is not made to be used like a microcontroller.
I started working on controlling my stepper motors. I was really excited to be doing this part, but (as I learned again) the raspberry pi is not meant to function like a microcontroller. A microcontroller is very good for controlling a stepper motor. A raspberry pi is very good for telling a microcontroller to control a stepper motor. So I had to re-think my whole plan for this machine. Now my plan is to use a microcontroller for reading the thermistor temperature values, controlling the mains power switching circuit, and controlling all the motors. I'll use the rapsberry pi to communicate over serial with the microcontroller and tell it when to do each thing.
I decided to use the PSoC CY8CKIT-049-42xx for a few reasons: it's small, it can plug directly into a USB port, and I have some experience with PSoC. As I began researching, I discovered that I can communicate from a computer to the PSoC using UART serial communication through the USB port! This got me super excited! This simplifies my project considerably from what I thought I was going to have to do. I'll be able to plug my PSoC board directly into the raspberry pi's USB port. This eewiki page gave me all the information I needed to know in order to do UART communication with the PSoC. It goes through the basics of using this kit and then has UART communication as an example project. I used putty to test this, but it took me a while to realize that the "echo" was the only thing showing up. I expected a double character for everything I typed, but luckily I figured it out before spending way too much time on it.
Building on that, I used this project #041 to figure out how to read my thermistor with PSoC. As it turns out, PSoC already has a component to do all the thermistor calculations - how cool is that? After I downloaded the project, made it bootloadable (instructions in the eewiki page), and built the thermistor circuit on my breadboard, I tried to send the data over USB. This took me forever figure out. But it turned out to be simple in the end. I found that the sprintf function uses a ton of memory, so I used the tinyprintf component from and imported it into my project following this tutorial. The thermistor is set up the same as it was before, just a voltage divider with a 10k ohm resistor. The only difference is that with this set-up, using the PSoC's internal ADC, I have to read power and ground as well. Here's the schematic and the actual circuit:
I've also been working on the mechanical design, but I think it will be better to make that a separate blog post when I get a little farther along on it.