Go Down

Topic: Need Help Programming a Keypad and a Piezo Speaker (Read 234 times) previous topic - next topic

Cdlrosa89

Hi! Me and my partner need help with programming a keypad and a piezo speaker!. We have until the 11th of December 2019 to turn in the project.

So this is the Project!

YOU WILL BE MAKING A SYSTEM CONTROLLER FOR A MODERN WASHING MACHINE

As you should quickly notice you may run out of digital I/O or exceed the current capacity if you try to connect everything directly to your Arduino Uno. There are many options available to use to resolve this issue. As a future engineer this is just one of the many challenges you will face in the workplace. Take time to think through your system and options, figure out WHAT you are building first then figure out the HOW.

Your system will be used to simulate the control or simulation of many peripherals that may be connected in a washing machine system.  The user will be able to deviate from the standard "Normal" cycle that is preloaded each time the machine is powered on. Your final product should visually represent a washing machine or at a minimum a washing machine control panel.  Do not present just a breadboard full of parts, you will lose points if you do this.  If you were presenting this to a non-technical person, they should be able to recognize, without explanation, that this is part of a washing machine.

From the point that the user presses start, a standard "Normal" cycle consists of:

During all stages the LCD should indicate what the current stage is and present either a progress bar that is constantly updated OR a seconds count down to the end of the cycle

When the cycle starts, the door lock servo (if equipped) should be engaged

Turning on the hot and cold water (makes warm water) solenoids (simulate with red/blue LED or 2 relays) for 35 seconds to load to fill the washing machine to a 100% (XL) load when finished turn off the solenoids

User can adjust the water level where 5 seconds=small load, 15 seconds = medium load and 25 seconds large load

If the user selected a different water temperature open the appropriate solenoid(s) for hot and/or cold for the amount of time dictated by the load selection, warm water must not exceed 85 degrees fahrenheit, if it does more cold water must be added to reduce the temperature until it is below that threshold.

The agitation cycle will run for 30 seconds, alternating the direction of the DC motor every 0.75 seconds

If the user changed the spin cycle to delicates the motor will alternate directions every 1.5 seconds for 45 seconds

The system should turn on a pump (simulate with relay or greenLED) for 45 seconds to drain the water then turn off the pump

The DC motor will spin in a CW direction at 100% speed for 30 seconds then turn off
If the user selected extra dry for the spin cycle run at 100% for 45 seconds
If the user selected delicates for the spin cycle run at 50% speed for 20 seconds







The door lock servo (if equipped) should be disengaged

The piezo speaker should play a happy tune to alert the user that the cycle is complete

The washing machine will have the following mandatory items:

Thermistor: Measures the temperature of the water when a warm water cycle is selected

DC Motor:  Used to simulate the agitation of the clothes and to perform the spin cycle. 

LCD: Used to indicate to the user the current cycle stage, LCD must present useful information regarding the current stage of the cycle.  The user should not have to guess what is currently happening.

LEDs, Solenoids, or Water Pumps
: you may choose to drive actual water solenoids or water pumps, however if you choose not to, use a red LED to indicate the hot water solenoid is on, a blue LED to indicate that the cold water solenoid is on and a green LED to indicate that the drain pump is running (do not use the RGB LED, use three separate LEDs)

Keypad: Enables the user to input cycle configuration information:
Changing the water level changes the amount of time the water solenoid is opened
Changing the water temperature controls which solenoids are open (cold, warm, hot)
Changing the spin cycle setting changes the speed and duration of the spin cycle
User should be able to save 3 presets in buttons A, B, and C, pressing and holding the button for 5 seconds will automatically save the current settings
Pressing D will start/pause/resume
pressing # or * will cancel the currently cycle
Pressing 1 multiple times will cycle through the water temperature settings (hot, warm, cold)
Pressing 2 multiple times will cycle through the load size settings (S, M, L, XL)
Pressing 3 multiple times will cycle through the spin cycle settings (delicates, normal, extra dry)


Safety system, your choice of servo or interrupt switch
: The servo simulates the door lock, when a cycle is running and not pause the lock should be enabled to prevent the user from opening the door.  Alternatively you can use a button that is activated when the door is closed, when a cycle is running the cycle should pause immediately.

Piezo Speaker: Provides audio feedback to the user that a button was pressed, also when a cycle is finished the speaker should play a happy song (no annoying long beeps or buzzers, google arduino music if you need help)

Extra credit: Store the 3 presets in EEPROM so that they are saved after the power has been removed

Extra-Extra Credit: You are required to create a physical mock up of the washing machine for the project, if yours is fully functional (water pump(s), solenoid(s), spinning basket, etc) you can receive 25% of your score added as bonus points.  However, this is an all or nothing deal, look at windshield washer motors for water solenoids/drain pump inspiration.

Suggested components to be used:

LCD Display with I2C Backpack
- used to provide feedback to the user.

4x4 Button Matrix
- method of providing user input ability

Piezo Speaker - provide an audible confirmation that buttons are being pressed on the keypad

Required features of the project (30 points):

  (5 points) Small physical mock up MUST be produced (be creative)
(15 points) Software functionality meets all of the requirements defined above
  (8 points) Good use of functions to increase modularity and reduce code complexity.
   (2 point)  Neat and tidy wiring and construction.

Extra credit(cannot earn extra credit without all required features above):

(5 points) Requires Pre-Approval Touch screen LCD
(omit keypad and utilize touch interface for proper user input method)
https://www.adafruit.com/product/1651 (or similar)
(2 points) Store the preset information EEPROM (must still be resettable).
(Points based on complexity) Anything you dream up that adds to useful functionality to the system.
(10 points, all or nothing) Project is a fully functional washing machine prototype

Suggested Libraries to Use:
   -NewLiquidCrystal   https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
   -Keypad   http://playground.arduino.cc/uploads/Code/keypad.zip
   -NewTone   https://bitbucket.org/teckel12/arduino-new-tone/wiki/Home

UKHeliBob

Which part are you stuck on ?

This is supposed to be your project
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

ToddL1962

Can't program it without a wiring diagram.  Either way you should attempt programming it and then ask for help.

12Stepper

Hi! Me and my partner [sic] need help
Well asking for "help" as opposed to asking for "a solution" usually means you go first and say where you got stuck.

So back to you....


slipstick

With only a week to go before your project is handed in I hope you have chosen all the components you'll be using and got most of the code written and working. If not you're way too late so you might as well give up now.

If you have, then post details of all components and post all the code you have so far together with descriptions of any problems that you're having. If it's really ONLY code for the keypad and speaker then you must at least have placeholders in the code for them so post your best attempt so far.

Just for interest how long ago were you given that project specification.

Steve

12Stepper

#5
Dec 05, 2019, 06:36 am Last Edit: Dec 05, 2019, 07:52 am by 12Stepper
Quote
LCD: Used to indicate to the user the current cycle stage, LCD must present useful information regarding the current stage of the cycle.  The user should not have to guess what is currently happening.
I wish my electronic machine had a status indicator. Its electro-mechanical predecessor at least had the dial go clicking round to give a clue. With our current one, we don't know if we should wait to hang the wash out or go to the shops meantime ;( No blinkenlites, bugger all.




12Stepper

#6
Dec 05, 2019, 09:14 am Last Edit: Dec 05, 2019, 09:22 am by 12Stepper
Quote
Need Help Programming a Keypad and a Piezo Speaker
Well asking for "help" as opposed to asking for "a solution" usually means you go first and say where you got stuck.
That said though, my advice, and I hope you have got past this stage already (although that's what weekends are for ;) ), is to install the keypad library and have a look at the examples. Experiment with what the library offers you, but work outside of the main program. Then once you understand how each keypad library feature works, and think that feature X and Y will help, incorporate only feature X into your main code until it works correctly. Only then, add feature Y.

Quote
(15 points) Software functionality meets all of the requirements defined above
(8 points) Good use of functions to increase modularity and reduce code complexity.
Not only does building modular code put you in the running for 8 marks, it increases the chance of your code actually working, and giving you a better run at the 15 marks for that. If you work in a modular fashion, when you add something you lessen the risk of breaking something that worked just 5 minutes before. That will save you a heap of time in the long run

Although I have never run the EventKeypad example, I see it shows how to deal with triggering an event when the pad is used. It shows for example how to deal with a key being pressed: you could use that on key 1 to increment a variable and cycle through the temperatures. It shows how to deal with a button being held: that would likely help you with the user wants to store a setting with keys A, B or C.




12Stepper

your Arduino Uno.

I'm surprised that since the project brief specifically mentions Arduino, there aren't a flood of threads on this topic. Or maybe other students (I assume they're students) have disguised things better and / or are asking piecemeal questions about bits and pieces.


12Stepper

We have until the 11th of December 2019 to turn in the project.

We're all I am waiting with bated breath to see what OP came up with, especially since s/he disappeared after one post and didn't respond to my one PM offering some advice.


Go Up