Click here to access the Canvas page with the repository for this assignment.
As you’ve noticed, the Arduino is a type of programmable computer. Its main chip (the Atmega328), is a microcontroller rather than a microprocessor, like the Intel CPUs in most laptop and desktop computers. As the name implies, microcontrollers are used to control things. Consequently, microcontrollers typically have several features that make them amenable to controlling things. For example, the Arduino can determine an analog voltage, which microprocessors can’t typically do.
The goals of this assignment are to:
S&S Enterprises has recently acquired several hundred defective dishwashers at a clearance sale. They’d like to fix these pieces of junk and sell them as soon as possible. In fact, they’ve already “rebranded” them by placing a sticker with the S&S product name over the original manufacturer’s name. Now they just need some computer engineering expertise to fix them…and that’s where you come in…
Through painstaking testing S&S has determined that all the machines suffer from a faulty control board. They believe a properly programmed Arduino will be able to replace the control board and restore the dishwashers to working order.
Fortunately, the dishwashers are rather simple. The control panel provides just two inputs:
The knob dictates the phases of washing.
The washing machine control board also has several outputs. Each is a simple digital (ON/OFF) signal. The control signals are:
Using an actual machine for your testing would be awkward, so you should simulate the outputs by using LEDs. Use:
Since the controls are pretty primitive, the washer can only support three types of wash cycle:
S&S would like to give users the flexibility to mix and match wash and dry cycles by adjusting the control knob in the middle of the current cycle. In particular they’d like:
Reminder: The Super Deluxe wash cycle should never be cut short. It should always wash with hot water for 7 minutes, then in medium water (both hot and cold) for 7 minutes (even if the knob is turned to Economy half way though).
Also keep in mind that the door to the washer should be locked whenever it’s running.
Start by drawing out a Finite State Machine diagram for the dishwasher. As a reminder, we recommend this Finite State Machine Designer. Please indicate which state your FSM starts in by drawing an arrow to it, and clearly label each state and transition. Here are some things to consider as you are trying to create your diagram:
setup()
and a loop()
)setup()
configures pins correctly before powering the Arduino.The start button will require an actual button. When pressed the buttons will make a connection between the two connectors on the top of the button and the two connectors on the bottom:
The button will be connected to a digital pin. To keep things simple, make the pinMode()
be INPUT_PULLUP
for the button. INPUT_PULLUP
will pull the value of the input pin UP (to HIGH
) by default. The button will then be used to pull it down (to LOW
or ground).
The buttons will be connected as follows:
Notice that a digital pin is connected to one side of the button and the other side of the button is connected to ground.
digitalRead( PIN_NUMBER )
will be used to determine if the button is pressed or not. If the button is NOT pressed, the digitalRead()
will return HIGH
(due to the pull-up). If the button IS pressed, the input will essentially be connected to ground, and, consequently the digitalRead()
will return LOW
.
Make sure you understand how the button works by creating a simple sketch that just prints the values from digitalRead()
.
The potentiometer can be used as a variable resistance. Here it will be used to control an electrical potential (i.e., voltage), which the Arduino will be able to read via the analogRead()
. Consequently, the potentiometer should be connected to an analog input pin.
Make sure you understand how the potentiometer works by creating a simple sketch that just prints the values from analogRead()
. (Simple sketches like this that are used to just test a feature shouldn’t be in your repository. You can create it by just using File > New
from the Arduino IDE and then saving it in a default location.) Based on this test sketch you should be able to find a way to determine if the switch is all the way to the left/counter-clockwise, or if it’s in the middle, or if it’s all the way to the right/clockwise.
The sketch already contains a Washer
package with a partial, but incomplete Washer.ino
sketch.
Washer/
Washer.ino
This assignment may at first seem silly, but microcontrollers are at the heart of many everyday devices. Moreover, you can use an Adruino to fix a broken dishwasher as seen in this HackADay article: Hey OEMs, Arduino Controlled Dishwasher Has Much Potential
Generated at 2022-07-20 19:49:20 +0000.
Page written by Bill Siever and Doug Shook.