Week11- Input Devices

June 6028

Input Devices

Download all the files for this week from here It will direct you to the week 12 folder which is the same as week 11.

  • For group assignment visit here

  • Measure something: add a sensor to a micro-controller board that you have designed and read it.

Designing the electronics board for the final project

  • For this week’s assignment I decided to design the the controller board that I will use for my final project. Both the Input & Output devices are done together on the same board.

  • In my final project, The barrel of the extruder is to be heated at a set temperature, this will be done by 3 cartridge heaters. To measure the Temp a Thermistor will be used.

BOM

  • 1 X 100K NTC Thermistor.
  • 3 X Ceramic heater cartridge 12V 40W
  • 1 X DC geared motor 12V 8Nm Torque
  • 1 X Power supply 24V 30A
  • MICRO ATMEGA328P-AU
  • Q1 16Mhz Crystal
  • C1, C2 18pF
  • C3, C4 100nF
  • R1-R8 10K
  • 4 * IRF540 N channel Misfit
  • 5 X Screw terminal

Thermistor

  • For Temperature measurements a 100k NTC thermistor will be used. This is the same as used in most of the REP RAP 3D printers.
  • Information, theory and basic coded for the thermistor temperature measurement is given on the reprap website.

  • Basic Connections

input

Electronic Design

  • I decided to make a DIY Arduino and us an ATMEGA328P-AU to control the nozzle temperature. I will use a 100K NTC Thermistor same as in a 3D printer to have accurate temperature measurements. To heat the nozzle I will use 3 Ceramic heater cartridge and for the same I will need 3 mosfet, 1 more MOSFET for the DC geared motor.

How I designed the Board.

  • So the first thing was to decide which microcontoller to use.I decided to use an ATMEGA328P-AU instead of using the Attiny44, since I’d be needing a lot more i/o and PWM ports, also more memory.
  • The internet is full of DIY arduino, just have to search Hackaduino and you are good to go.
  • One such reference i got for the basic schematic was from How-To: Perfboard hackduino. It’s very simple and use very little component to get going.
  • Also i looked at Satshakit for baisc schematic and the selection of crystal frequency and capacitors.

  • After the basic schematic it went on to add a voltage regulator circuit since input voltage to the board is 12v which is regulated to 5v on board for atmega 328p and 12v raw for the heating cartridges. Here is a basic schematic i found on the internet. input. Source - Here

Schematic

input

Kindly open the image in new tab as to zoom and see the image clearly.

  • File’s Name in the source folder : Input/Output.sch

Board

  • Image of final board input
  • Unrouted Nets input
  • Image showing jumpers which are the unrouted nets. input

  • File’s Name in the source folder : Input/Output.sch

Traces

input

  • File’s Name in the source folder : traces.png

Milling:

  • Milling the board was pretty tricky since 328P-AU has very tiny footprint.
  • The Atmega 328 package i was using had very low clearance b/w the footprints. I edited the cad of the model and made the footprint small and have more clearance.

  • To mill the board I have used the same process described in week 5. After couple of tries I was able to mill the perfect board.

Final Board

  • Here is the milled board stuffed with all the components.

  • Front–input

  • Back– input Here I have marked the programming and the Serial communication pins for better understanding. These pins are used to programme the board and also communicate using a FTDI cable. Bothe of the processes are mentioned in week-9 & week-13.

Programming the board

  • Programming the board is pretty simple. I used a 16mhz clock with 22pf resistor to make sure that the Arduino IDE recognises my board as Arduino UNO which it did. input
  • I used FabISP to programme the board. Here is the picture of my board marked with the ISPheader pins; MISO MOSI VCC GND RESET SCK. Connect these to the respective ISP pins on the programmer and you are good to go. input input
  • After that You need to burn the bootloader. The fuses are set when the bootloader is dumped to the MCU. input
  • The final step is to programme the board, You ned to upload select upload using programmer in order to burn the code to the MCU. input
  • Done Uploading.

    Arduino Input code

  • The code is taken from circuit basic’s website.

  • The values of constant were perfect as i checked the value of thermistor output against a know temp source.

int ThermistorPin = A2;
int V;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

void setup() {
Serial.begin(9600);
}

void loop() {

  V = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)V - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
  T = T - 273.15; 
  Serial.print("Temperature in celcius : "); 
  Serial.print(T);
  delay(500);
}
  • File’s Name in the source folder - Temp_input.ino

Video

  • Ambient Temperature
  • Temperature Increases when in contact with soldering iron.