crodbor
Published

AQUABOX: Portable and sustainable laundry

We've designed a "sustainable, portable laundry" that includes a coin-operated system to automate and monetize its use.

BeginnerShowcase (no instructions)102
AQUABOX: Portable and sustainable laundry

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Coin selector
×1
LED (generic)
LED (generic)
×2
Grove - 4-Channel SPDT Relay
Seeed Studio Grove - 4-Channel SPDT Relay
×1
Display
×1
Buzzer, Piezo
Buzzer, Piezo
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Keyhole saw

Story

Read more

Custom parts and enclosures

aquabox-6_KDbRKA7Ig3.mp4

aquabox-5_zonviteo_DplZyWWwe2.mp4

1744887930125_fhXroeMbD4.jpg

1744801361380_0ewgvopity.jpg

aquabox_3_v68ZrA4Mbo.jpg

Schematics

Aquabox Control System Schematic

Code

Sketch AquaBox

Arduino
It receives the pulses from the selector and translates them into euros. When the desired euro has been entered (4), the relay is activated for the duration of the active time. A green LED lights up. When the time has elapsed, a buzzer is activated and the red led is turn on (green led turn off).
// Libreras
#include <TM1637Display.h>
#include <Arduino.h>
#include <EEPROM.h>
#include <elapsedMillis.h>

//declaro las variables
#define CLK 3
#define DIO 4

TM1637Display display(CLK, DIO);

elapsedMillis timer;
elapsedMillis countDownTimer;
long interval_timer = 10000; // time the timer will count
bool countDownStarted = false;

int i= 0;
int CuentaImpulso=0;
float total_amount=0;
const uint8_t RELAY_PIN = 7;
const uint8_t LED_V_PIN = 5;
const uint8_t LED_R_PIN = 6;
const uint8_t BUZZER_PIN = 8;

void turnOnRelay();
void turnOffRelay();
void imprime();


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  display.setBrightness(0x0f);
  attachInterrupt(0,Impulso, FALLING); //Function that captures the pulse that arrives from the coin selector through PIN 2. Each time one arrives, it CALLS the "Impulse" function and increases the counter
  //EEPROM.get(0,total_amount);
  display.clear();
  pinMode(RELAY_PIN, OUTPUT);
   pinMode(LED_V_PIN, OUTPUT);
      pinMode(LED_R_PIN, OUTPUT);
     pinMode(BUZZER_PIN, OUTPUT);
  turnOffRelay();
digitalWrite(LED_R_PIN, HIGH); 
}

void Impulso ()
{

CuentaImpulso=CuentaImpulso+1;
//i_count=i;
//i=0; 


}

void loop() {
  //display.clear();
  i=i+1; // "i" increases every millisecond...it is assumed
  //Serial.println("Pulsos:");
  //Serial.println(CuentaImpulso);
  //Serial.println("Total amount:");
  //Serial.println(total_amount);

    //delay(1000);



  if (CuentaImpulso==2){

    total_amount=total_amount+1; //count 1 euro
    CuentaImpulso=0;
      imprime();
  }
if (CuentaImpulso==1){

    total_amount=total_amount+0.5; //count 0.5 euro
  imprime();
    CuentaImpulso=0;
  }

 display.showNumberDecEx(total_amount*100.0, 0b11100000, false, 4, 0); // It multiplies the euros by 100 to center the data on the display screen and use the colon as a separator.

if (total_amount==4 && !countDownStarted){

    countDownStarted = true;
      timer = 0;
      countDownTimer = timer; //the timer countdown is activated
      turnOnRelay();

  }
if (total_amount>=4 && countDownStarted) //At 4 euros it activates de relay and start the count down...it could be the amount you desire
  {
    if (timer >= interval_timer * total_amount*0.8)
    {
      
      digitalWrite (BUZZER_PIN, HIGH);
    }
    if (timer >= interval_timer * total_amount)
    {
      Serial.println("Time is up!");
      turnOffRelay();
      countDownStarted = false;
      total_amount = 0;
    display.clear();
    }
  }

  }

void turnOnRelay()
{
  digitalWrite(RELAY_PIN, HIGH);
  digitalWrite(LED_R_PIN, LOW);
  digitalWrite(LED_V_PIN, HIGH);
}
void turnOffRelay()
{
  digitalWrite(RELAY_PIN, LOW);
  digitalWrite(LED_R_PIN, HIGH);
   digitalWrite(LED_V_PIN, LOW);
  digitalWrite (BUZZER_PIN, LOW);
}
 
void imprime()
{
  Serial.println("Euros introduced:");
  Serial.println(total_amount);
}





  

Credits

crodbor
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.