
Week 13
Output Devices
The assignment this week was to add an output device to a microcontroller board you've designed and program it to do something.
My final project is going to be a vacuum chamber for degassing molds and dehydrating materials. Sometime materials need to be held under vacuum for a long time to fully dehydrate and to both preserve the life of the pump and save electricity, I would like a circuit that senses when air pressure increases past a low threshold and then automatically turns on the vacuum pump.
For my output device this week, I'm going to work on modifying the hello speaker board to act as a simple trigger board to throw a relay. With the addition of a small vacuum sensor, I should be able to control an AC switch by sending 12V to a relay.
The first task I had in working on this board was to increase the amount of current it can handle. As designed, the speaker board has a MOSFET with a limit of 30V and ~1A. While that might sound like a lot, we could conceivably burn it out from extended use. Instead I am switching to the MOSFET N-CH 50V 16A TO-252AA included in the inventory. With such high limits, we are surely not going to burn out components.
I redrew the board in eagle ( trigger.brd and trigger.sch) with the updated components and exported the cutout images as normal.


The cutfile

After stuffing everything was looking pretty good!
The hello world code written by Neil for a speaker board generates a random sound wave for speakers, effectively pulsing on and off extremely quickly. Obviously that wasn't going to work for this concept, as you don't want the relay firing thousands of times per second.
I modified the hello world code, combining the basic example provide by hello.rgb.45.c and hello.speaker.45.c. I took the loop section of rgb, isolated the turning on and off of a single LED, pasted it into the speaker code, adjusted the variables as necessary and significantly slowed down the PWM delay. The resulting code is available as C code and a makefile
Running the code while connected to an oscilloscope demonstrates a clear on/off cycle, outputting 12V on regular period.