segunda-feira, 8 de abril de 2013

Baking a cake

Today I took the chance to test a small block of my latest project - A cheap reflow soldering oven.

The oven control PCBs arrived a few days ago and while I wait for some parts to arrive, I decided to test the thermocouple interface.

The IC is a MAX31855 and the interface is SPI, so basically, in one side you connect the thermocouple probe and on the other side you get temperature bits.

To test the all of that, I've used a generic SPI port from my 68K board connected to the oven control PCB and the first results gave me a nice, slightly noisy, temperature measurement.

In the 68K board, the user interface is done via sysfs and a simple iio driver (basically a copy from my MCP3208). It gives me 2 ADC channels - one is the thermocouple temperature with 14 bit resolution in 0.25 C steps and the other one is the MAX31655 internal temperature sensor, used for the cold-junction compensation, with 12bit resolution in 0.0625 C steps.

M68K + oven control board on the kitchen, ready to log!

Today my wife decided to bake a cake on the cooking oven so I've wired up the whole thing on the kitchen and... baked a banana flavored cake.


Thermocouple placed inside the oven
 
For data logging I've coded a simple TCL script that reads the temperature from the thermocouple and dumps a 2 column CSV file: the temperature and a moving average of the last 10 temperatures.

The result is the following chart:
Baking a cake!
In the chart you can see a red line (the 10 value moving average) and barely see a noisy blue line (the sampled temperature).

So, my wife sets the oven control for 175 C and the timer to 45 minutes (counting from the moment the cake in placed inside the oven).
The results not near what I expected...


Reviewing the chart you can see:
  1. Initial heating (around 13 minutes)
  2. Oven door opening, cake placed inside the oven.
  3. Baking, thermostat control (around 53 minutes).
  4. Timer ended, oven shut down.
  5. Door opened to take out the cake - fast temperature drop.


Facts:
  • The oven thermostat selection is below the real temperature (175 C selected and around 200 C real temperature).
  • The timer is not that accurate.
  • We forgot to take out the cake as soon as the timer finished... overcooked cake!
  • And the most important, the MAX31855 works great!


Slightly overcooked cake... but still tasty!


As for the reflow oven control, I'll be using an atmel microcontroller.
It will have an USB connection (to upload reflow profiles) and an alphanumeric LCD display with some buttons to control the unit among other nice features.



If anyone is interested in building a reflow oven, leave a comment!

sexta-feira, 18 de janeiro de 2013

Playing some mp3!

Remember my old mp3decoder board? Well, I decided to pick it up and plug it to the Alcetronics M68K board.
The result is a cool and huge and non-practical mp3 player!

Checkout the video where I show how it works!




The driver is a simple char device where the mp3 file gets dumped.
The mp3decoder board is fed by a SPI at the fpga.


How did it:

The Linux driver allocates a buffer that will act as a FIFO. It gets filled whenever data is sent to the char device and get empty when the decoder chip requests data.

My first implementation was a failure... The interrupt routine was taking too long to dump the data and the FIFO was getting empty, that caused music to stop until it was again filled.

To solve this I had to do several tweaks to the interrupt routine, codding some assembly and also optimized the SD card driver to read data faster.

The result was a 68000 running the latest Linux kernel and playing mp3 files from an SD card! (tested with mp3 bitrates up to 320kbit/s)

I know... not a big deal nowadays, but for a CPU with almost 34 (maybe older than you?) it really is impressive.



Whenever I get some time, I plan to connect a simple USB host chip and then... try USB devices!