résumé  |   play  |   contact  |   email  |   links     homepage  |   Sunday, February 5th



The paper I handed in

From running the microwave to waking us up in the morning, microcontrollers are all around. It is hard to even fathom the extent microcontrollers play in our everyday lives. What is even harder to fathom is the work required to get them to do what they are supposed to do. One wrong movement of a servo motor and the whole factory could burn down. A wrong instruction and our flight to Jamaica could leave without us. Not only may it be hard to make them function as we desire, some people may have a hard time understanding what one is. So in order to better understand the microcontroller’s world we must first understand "What is a Microcontroller?"

The first step we took in our independent study involved a book by Parallax titled "What is a Microcontroller?" The book contained a series of detailed experiments showing both the program that needed to be entered and loaded onto the Basic Stamp II, and the circuit diagram. At the end of each experiment was a challenge question or two. These allowed us to take what we had learned from the experiment further. We were able to do about two to four of these a week, some taking longer than others. The experiments in "What is a Microcontroller?" gave us some insight into the life of a microcontroller.

A microcontroller is basically an integrated circuit "god" or it could even be thought of as a small central processing unit. It runs whatever language the manufacture has designed it for. In our case this was PBASIC, which is just Parallax’s version of BASIC. Through the languages’ commands, one is able to "tell" the microcontroller what to do. The Basic Stamp contained a series of I/O pins (15 total) that could all be used in order to perform whatever the programmer desired. For instance, if a button was depressed on the circuit a LED might blink on and off for 10 seconds. This is done through both outside circuit design and the PBASIC language. All in all this is the basic concept behind microcontrollers. Take some kind of "outside" or physical human input (pushing buttons on a microwave for example), performing calculations or whatever is desired, and showing the human the result. For our Stamp this included anything from sending text to the debug terminal to making a speaker beep. Of course all of this input and output is done in binary or digital. This is where the next book came into the spotlight.

"Basic Analog and Digital" presented us with experiments much like the first, however, dealing with analog and digital conversions. These experiments allowed us to understand the processes that go on in order to convert some sort of analog input (a variable resistor for example) and show its output on the debug terminal. Of course it would be much simpler for us to just show the Stamp’s output, however, this would be very hard to convert quickly into something we can use. So inside of our program we were able perform the necessary conversions and display the output in a "readable" form.

Both of these books gave us a great overview into the workings and functions of a microcontroller. After completing both of these books we went one step further and worked alongside another individual who previously built an electronic rain gauge.

What they desired was some modifications of their program. They had already implemented the ability to count the number of dumps, but they wanted a way to store to data and read it back at a later time (See attached Fig. 1 for modified program). This was solved by researching the capabilities of the Basic Stamp II to write and read from its EEPROM (where the program is stored). We found these to be simple read and write PBASIC commands that only required a location in memory to write or read to or from and what was to be written or read. While these commands are easy to use, we must be sure that we are not careless. If we wrote too far into the EEPROM we will begin to overwrite our own program! Since our program already took about 33% of the EEPROM’s memory, we found that we could store approximately 300 readings. Each one of the readings would include the day, month, and year of the reading along with the hour, minute, and how many dumps that had occurred. We already knew how to get the number of dumps, but what about the rest?

To accomplish this task we added a quartz clock (Pocket Watch B by Solutions3), which already has built in serial capabilities in order to interface with our Basic Stamp. Since PBASIC includes simple serial commands (SERIN and SEROUT) this makes communication with the clock very simple. We then added a LED and a pushbutton. These are both used in order to retrieve our data (See attached Fig. 2). Upon "waking up" the Basic Stamp will blink the LED for 10 seconds. During this time the button can be depressed, which signals the Stamp to retrieve all of the data from memory and display it on the debug terminal.

We believe that the rain gauge was a perfect example of a microcontroller in action. Taking some outside force, performing data retrieval and calculations, and later showing them in some fashion. This device is yet another that can be added to the list of microcontrollers that are in existence today. While the electronic rain gauge is a brilliant idea, we would have to say that our HRCF with built in breeze simulation tops the list. (HRCF being, of course, Holmes Remote Control Fan.)


Fig. 2: Rain Gauge Data Storage and Retrieval

Storage of Data

1 - Power on both the BS2 and computer
2 - Connect serial cable to each
3 - Open PBASIC program on computer
4 - Edit program for current date and time
5 - Load program onto BS2
6 - Reset BS2 (use reset button on BS2 board)
7 - Disconnect serial cable from both computer (before closing debug terminal) and stamp
8 - Do a rain dance

Retrieval of Data

1 - Connect serial cable to BS2
2 - Power on computer, open a debug terminal (^D) to correct serial port
3 - Connect serial cable to serial port used in step 2
4 - Wait for BS2 to wake up (LED will blink)
5 - While LED is blinking (10 seconds) push the push button on the BS2
6 - The stored readings will now be displayed on the debug terminal


Please note:
BS2 refers to the BASIC STAMP II microcontroller by Parallax.

Parts for Data Retrieval and Storage

1 - (1) LED (any color)
2 - (1) pushbutton switch
3 - (1) Pocket Watch B by
Solutions^3
4 - (2) resistors - 10K ohms, ~470 ohms

study details

entire paper

PBASIC program

pictures

circuit diagram



© Gfuss - updated 15 days ago

  FREE THE MOUSE

 

38.107.179.224  |  CCBot/1.0 (+http://www.commoncrawl.org/bot.html)