Assignment Project presentation
What does it do?

The Leds are switched on with the button. 
Who's done what beforehand?
The adafruit made the lilypad arduino. This is the inspiration of the project.
What did you design?
I designed the arduino Medusa, 
with the help of an adviser and electronics engineer Jose De los Rios.  
The rest of the boards I modified using  the fab academy´s schematics as a reference. 
What materials and components were used?

I´ve mentioned them already in THIS ASSIGNMENT XVII. 
Where did they come from?
All the materials I had from the FablabTecsup. 
How much did they cost?
 During the project development some boards I milled did not function. 
The Modela is good for milling small boards. 
Some vias of my arduino elevated and some pins of microcontroller were removed. 
The second one was milled  more or less satisfactory 
but did not function because I made a mistake.
 I used the crystal 20OM instead of 16OM. 
So the third one I milled with Gravograph and the result was excellent. 
 What parts and systems were made?
I made an Arduino, one button board and one temperature sensor board.
What processes were used?
For the Arduino fabrication I used the Gravograph machine 
because only this one could make precise milling of thin vias and pins. 
What questions were answered?
Till the last moment I did not know how difficult it would be to make this project. 
The conclusions are: 
It`s not difficult.
To make this project you`ve got to know the following software and techniques: 
Electronics basics
Eagle
Roland Modela`s software
How to mill in Roland Modela
How to solder
How to program your boards
How was it evaluated?
 I programmed the Arduino and programmed the button to switch on and switch off the leds. 
I evaluate this project and a completed well done project. 
I had clear understanding of what I had to do and the clear understanding of what I have done. 
I learned to make electronic boards and arduinos and to program them. 
I have already known the CAD designing and molding and casting. 
I also have experience of doing the composites. 
Well, as you see I`ve chosen the most difficult task for me to make. 
What are the implications?
The conclusion is that this project is easy to make. 
You`ve got to learn some techniques to do it.
And then you`ll be able to make wearable electronics for your clothes. 
So, I want to say that I am convinced that everybody can do that. 
Imagine, that everyone makes electronic accessories in their house. That`s great. 

ELECTRONIC BOARDS

Its the first version of the LEDS board design

This is the second design of LED BOARD

Press "Скачать" to download the Eagle schematic

regulador The voltage REGULATOR
temperature

The

SENSOR OF

TEMPERATURE

RGB BOARD

Press "Скачать" for the downloading

This is the BUTTON BOARD
The cutting process

 

WATCH THE VIDEO GRAVOGRAPH functioning!

arduino

DOWNLOAD EAGLE FILE OF ARDUINO MEDUSA

The arduino I´ve made with the help of Gravograph machine due to the fact that the routes are very thin and requare a thin drill of 3 mm with the point of o 0.15 mm.

//
//
// hello.temp.45.c
//
// thermistor hello-world
//    9600 baud FTDI interface
//
// Neil Gershenfeld
// 10/27/10
//
// (c) Massachusetts Institute of Technology 2010
// Permission granted for experimental and personal use;
// license for commercial sale available from MIT.
//

#include <avr/io.h>
#include <util/delay.h>

#define output(directions,pin) (directions |= pin) // set port direction for output
#define set(port,pin) (port |= pin) // set port pin
#define clear(port,pin) (port &= (~pin)) // clear port pin
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set
#define bit_delay_time 100 // bit delay for 9600 with overhead
#define bit_delay() _delay_us(bit_delay_time) // RS232 bit delay
#define half_bit_delay() _delay_us(bit_delay_time/2) // RS232 half bit delay
#define char_delay() _delay_ms(10) // char delay

#define serial_port PORTC
#define serial_direction DDRC
#define serial_pin_out (1 << PC2)

float eps = 0.5;
float filter = 0.0;

void setup(){
  ADMUX = (0 << REFS1) | (1 << REFS0) // VCC ref
      | (0 << ADLAR) // right adjust
      | (0 << MUX3) | (1 << MUX2) | (1 << MUX1) | (1 << MUX0); // 20(PB4-PB3)
   ADCSRA = (1 << ADEN) // enable
      | (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); // prescaler /128
   ADCSRB = (1 << BIN); // bipolar mode
}
   void loop(){
  
   
      ADCSRA |= (1 << ADSC);
      //
      // wait for completion
      //
      while (ADCSRA & (1 << ADSC));
      //
      // send result
      //
      
      int value = 256*ADCH + ADCL;
      if (value > 511){
        value -= 102;
      }
      float V = 2.5 - value*5.0/(20.0*512.0);
      float R = 10000.0/(5.0/V-1.0);
      float B = 3750.0;
      float R25 =  10000.0;
      float T = 1.0/(log(R/R25)/B+(1/(25.0+273.15))) - 273.15;
      float filter = (1-eps)*filter + eps*T;
   }

The code for temperature sensor

//Include Files
#include<avr/io.h>
#define F_CPU 128000UL
#include<util/delay.h>
int main(void) {
DDRB |= 1<<2|1<<3;//Declare as outputs
PORTB |= 1<<2|1<<3;
//Switch off the LEDs
DDRB &= ~(1<<0|1<<1);//Input declared
PORTB |= (1<<0|1<<1);//Pull up Enabled
while(1){
//switch1
if(!(PINB&(1<<0))) //If pressed
{
_delay_ms(10);//debounce
while(!(PINB&(1<<0)));
//wait for release
_delay_ms(10);//debounce 
PORTB^= (1<<3);//Toggle
}
//switch2
if(!(PINB&(1<<1)))//If pressed
{
_delay_ms(10);//debounce
while(!(PINB&(1<<1)));
//wait for release
_delay_ms(10);//debounce
PORTB^= (1<<2);//Toggle
}
}
}

The CODE for MEDUSA LEDS

const int buttonPin = 2;
const int ledPin = 13;

int buttonState = 0;

void setup() {
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

The Button`s code

float centi()
{// Funcion para leer el dato analogico y convertirlo a digital:

  int dato;
  float c;
  dato=analogRead(A0);
  
  c = (500.0 * dato)/1023;

  //Esta fórmula sale de la relación del sensor con los grados. Ésta es fácilmente rastreable por la web pero vamos a intentar explicarla un poco: El sensor de temperatura LM35 responde a variaciones de 10 mV por cada grado centígrado. Si el sensor detecta 1 grado centígrado a la salida del sensor obtendríamos 10 mV. Ejemplo: 26,4ºC = 264 mV = 0.264 V.
  //Tenemos que el convertidor de analógico a digital es de 10 bits de resolución, los valores variarán entre 0 y 1023, entonces Vout= (5V*Dato)/1023 siendo  ( 0 < Dato < 1023 ) y para ajustar la escala a grados centígrados: Vout = ((5V*Dato)*100)/1023
  return (c);
}

void setup(){
  pinMode(13,OUTPUT); 
  pinMode(12,OUTPUT);
  pinMode(11,OUTPUT);
}
void loop(){
  float Centigrados = centi();

  if (Centigrados >= 37.01 && Centigrados <= 38.00){
  digitalWrite(13,LOW);
  digitalWrite(12,HIGH);
  digitalWrite(11,HIGH);
  delay(500);
  }
  if (Centigrados >= 36.60 && Centigrados <= 37.00){
  digitalWrite(13,HIGH);
  digitalWrite(12,LOW);
  digitalWrite(11,HIGH);
  delay(500);
  }
  if (Centigrados >= 36.30 && Centigrados <= 36.59){
  digitalWrite(13,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(11,LOW);
  delay(500);
  }
}

The code for programming the Arduino