17. Machine design

During this week I work in week assignment

Over the process I contributed to different components, first I review information about physical and chemical features of the raw materials used in our partnert Fab labs to prepare the machining wax.

I learned about the properties of parafin and all its uses related to fabrication, I was especially interested on its fussion and combustion temperatures because this is one of the risks in the preparation of the wax. Then I research about polyethylene its solubility and how it interacts with hydrocarbons and their performance in hot mixes, at this point I learned that density and molecular structures of this polymers could affect its solubility in the wax

I focused on contributing to the software component of the machine, so I test two diffferent types of modules which could be used to monitoring the temperature of the wax.

First, I review Documentation and tested the DS1820, I built the circuit and charge the code but I have some problems related to the accuracy of the measurements, we have had this kind of inconvenients with this specific Sensor before, I found information about its calibration methods. I was interested on this sensor because it will be advanced to include the lines of code which helps to trigger alerts once the temperature exceed secure limits.

I also test a KY-028 Digital temperature sensor module as this is other option I have acces in my apartment. Finally I finished using a DTH11 to measure temperature and send the message of monitoring to the 16x02 LCD here is a seen of the code:

/* YourDuino.com Example Software Sketch
 16 character 2 line I2C Display
 Backpack Interface labelled "A0 A1 A2" at lower right.
 ..and
 Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
 MOST use address 0x27, a FEW use 0x3F
 terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <Wire.h>  // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>

//temp************************************
#include "DHT.h"

#define DHTPIN 2     // what pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

// Initialize DHT sensor for normal 16mhz Arduino
DHT dht(DHTPIN, DHTTYPE);
//temp************************************



/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 16 chars 2 line display
// A FEW use address 0x3F
// Set the pins on the I2C chip used for LCD connections:
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

/*-----( Declare Variables )-----*/
//NONE

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);  // Used to type in characters
  Serial.println("DHTxx test!");
  dht.begin();
  lcd.begin(16,2);   // initialize the lcd for 16 chars 2 lines, turn on backlight

// ------- Quick 3 blinks of backlight  -------------
  for(int i = 0; i< 3; i++)
  {
    lcd.backlight();
    delay(250);
    lcd.noBacklight();
    delay(250);
  }
  lcd.backlight(); // finish with backlight on  

  //temp************************************
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  // Read temperature as Celsius
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit
  float f = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
    }

  // Compute heat index
  // Must send in temp in Fahrenheit!
  float hi = dht.computeHeatIndex(f, h);

  //temp************************************

//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0  
  lcd.setCursor(0,0); //Start at character 4 on line 0
  lcd.print("Temp:");
  delay(1000);
  //lcd.setCursor(0,2);
  lcd.print(t);
  lcd.print(" C");
  //lcd.setCursor(0,2);
  //lcd.print("end of reading");
  delay(8000);
  if (t <= 26)
  {
    lcd.setCursor(0,1);
    lcd.print("Safe temperature");
  }
  else
  {
    lcd.setCursor(0,1);
    lcd.print("Warning High Temp");
  }

}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  {
    // when characters arrive over the serial port...
    if (Serial.available()) {
      // wait a bit for the entire message to arrive
      delay(100);
      // clear the screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0) {
        // display each character to the LCD
        lcd.write(Serial.read());
      }
    }
  }

}/* --(end main loop )-- */


/* ( THE END ) */