Output Devices

Group assignment:

  • measure the power consumption of an output device

  • Individual assignment:

  • Add an output device to a microcontroller board you've designed, and program it to do something
  • Actuators:

    An ACTUATOR is an inherently mechanical device whose function is to provide force to move or "actuate" another mechanical device. The force provoked by the actuator comes from three possible sources: pneumatic pressure, hydraulic pressure, and electrical motive force (electric motor or solenoid).

    There are two main types: single-acting cylinders and double-acting cylinders. Rotary actuators: they are in charge of transforming pneumatic energy into rotational mechanical energy. There are two groups: limited-turn actuators and pneumatic motors. Special actuators.


    Final project

    Thinking about the final project and having concluded the allocation of inputs for this week, it was decided to use a humidity sensor which will determine the water needs of the plants that will be at the top of the bus stop.

    To carry out this work, a water pump plus the humidity sensor will be used, this water pump will be activated when the humidity sensor indicates it according to previously configured parameters.


    Image taken from conceptodisenio

    ATtiny 44.


    For this we will use the design made in electronic design that is based on the ATtiny 44 controller, this week we already tried to connect some sensors to our circuit board in conjunction with several LEDs that indicated that the expected parameters were received


    you can download the necessary files from the following links


    Download Code files


    Download G-code files


    Download Eagle files


    PBC fabrication


    For this assignment we will use the same design used in embedded programming since this design has free pins to connect our sensor, You can watch the entire creation process and download the files at the following link, embedded programming


    first attempt:



    In this first attempt we are going to connect the humidity sensor, carry out the verification of the pins and the necessary programming to be able to receive data from the sensor, then we will integrate the led included in the printed circuit board.


    We will connect a proximity sensor to our circuit, For this we will first use our Arduino as a programmer, and we will load the code to control the proximity sensor, In addition, we will control the parameters indicated in the code with the on and off of a led integrated in the circuit board



    Adding a motor


    You will need the following components to add the motor to the circuit board


    • 1x Arduino UNO board
    • 1x PN2222 transistor
    • 1x 6V DC small motor
    • 1x 1N4001 diode
    • 1x 270 Ω Resistance

    • The following connection diagram will help you to connect to the pins of the circuit board


      Image taken fromforum.arduino




      putting everything together



      below we can see a video with the first tests carried out with an arduino to understand the respective connections



      During the process of programming the board, I found it difficult to send a message to the pc using the serial monitor.


      Problems found:


      • Make the connection of Rx and Tx directly to Rx Tx of the Arduino, while the correct thing is to reverse the connection of this way Rx output of the Attiny to the Tx of the Arduino.

      • Image taken fromforum.arduino


        Solved this and received data in serial monitor but in the form of symbols ??????????????.


      • Thanks to Camilo Ortiz, a ZOI colleague in the Fabacademy course, he helped me understand the need to place a bridge between the Reset and Ground pins of the Arduino, this solved the problem of symbols, now my serial monitor already receives the messages that are sent via myserial.print();

      Once everything is tested and working we will use our programmed UsbAtiny to send the code and power the board and we will put our design to work


      Image taken from automatizacionparatodos





      manufacturing motor pcb board


      Below we show the steps of the construction of the pcb board for the motor control elements that in the future will work as a water pump for the irrigation of the roof of the bus stop, and thus not use the proto board for the connections, to see more in detail the process of design and manufacture of pcb boards I invite you to see it in the following link Electronic Design


      Here we can see the design process at Eagle



      Once our design is finished, we export it as a png image, and later we generate the G-Code with the help of Mods from the Mit



      Finally we check our G-Code using the G-Code simulator website



      Now we can see the finished board and then weld the electronic elements



      Finally we connect our motor control module to our pcb board with the ATtiny44 controller and send the code using our FabIsp programmer, we connect our humidity sensor to the motor and perform the functional tests.





      you can download Eagle file

      you can download G-Code file



      Arduino Code

      #include //include library which implements software serial port, for comunication
      SoftwareSerial mySerial(0,1);
      const int LED =7;
      const int MOTOR =10;
      void setup() {
      // put your setup code here, to run once: Here we are configuring speed of the serial port
      mySerial.begin(9600); //bits per second, 9600 is standard speed
      //pinMode(sensorpin,OUTPUT);
      pinMode(LED,OUTPUT);
      pinMode(MOTOR,OUTPUT);}
      void loop() {
      // put your main code here, to run repeatedly:
      digitalWrite(LED, HIGH); // enciende el LED
      int humidity=analogRead(2);
      mySerial.print("Humidity is:");
      mySerial.println(humidity);
      if(humidity > 760){
      mySerial.println("Sensor en suelo seco");
      digitalWrite(MOTOR, HIGH);
      }else if(humidity < 750){
      mySerial.println("Sensor en agua");
      digitalWrite(MOTOR, LOW);
      } delay(2000);
      }



      Second try, testing a board with Atmega328p


      To better understand the programming of the pcb boards, several tests were carried out, initially the arduino was used with the Attiny44 to be able to see the information sent by the sensors through the serial monitor, then they were programmed using the FabUsbAttiny programmer. Finally, the construction of the pcb board with the integrated Atmega328p was concluded


      For the realization of the pcb board with the 328p we take as a reference the work that we can find in the following link ATMEGA328p-AU Bootloader



      Image taken from electronoobs




      Once the design of our board has been defined and all the tracks have been placed, we will generate our G code from the Eagle, for this we will go to the ULP button, pcb-gcode and accept, with this our G file will be generated



      When we enter the ULP button, we can go to pcb-gcode-setup, here we can vary the parameters of: milling dimension, velocity, depth among others



      For letters use the MODs as a separate file



      After the manufacture of the pcb board, make a first attempt to bootloader using an arduino uno, initially it was possible to burn the board but it does not work properly, use an arduino uno, since it did not have an arduino nano at that time



      Initially the bootloader was carried out by using ardiono uno and apparently successfully, but the pcb board did not work when connecting the FTDI module


      Burn the bootloader on an ATmega328p


      Once we have made the connections recommended by the manufacturer, we will make the following 4 connections between the pins of our chip and an arduino NANO.


      Digital pin 13 of the arduino NANO to pin 17 of the SMD chip (SCK)

      Digital pin 12 of the arduino NANO to pin 16 of the SMD chip (MISO)

      Digital pin 11 of the arduino NANO to pin 15 of the SMD chip (MOSI)

      Digital pin 10 of the arduino NANO to pin 29 of the SMD chip (CS)


      Image taken from electronoobs



      At this moment we open the arduino IDE. We go to FILE -> Examples -> Arduino as ISP and open the ArduinoISP example. In tools we select the Arduino NANO board, the COM that corresponds to it and load that example program into our Arduino NANO. Now, once the Arduino ISP program has been loaded into the arduino NANO and with the previous connections made we go to Tools -> Programmer -> Arduino as ISP.




      Upload codes (basic configuration)

      Make sure that you change back the programmer from "Arduino as ISP" to "AVRISP mkII". Then connect the FTDI progrmmer to the UART port as below to pins RX, TX and DTR. Add a 100nF cap between DTR and reset pin of the chip. Make sure you have selected Arduino NANO as board and the COM of the FTDI programmer. Then, get your code, compile and uplaod.


      Image taken from electronoobs


      turning on a led by motion detection

      One of the objectives of the sustainable bus stop is to save energy at night, so since there are no people using it, the lights should be off, for this we will use motion sensors to control the lights of the bus stop, to To achieve this goal we have connected a motion sensor and a led to test the led control programming



      you can download the code from the following link Code turn on led


      Problems


      During the manufacture of the pcb board, I did not consider some thicknesses of the circuit tracks, at the time of soldering the compone broke, for this reason I had to repair these tracks as can be seen in the image, once repaired it could be save the pcb board and start your bootloader and programming

      to repair the tracks, I used pieces of wire and epoxy paste


       >


      Download Code files


      Download G-code files


      Download Eagle files


      General Conclusion:

      This week's work was quite interesting and opened the doors to new ideas and design possibilities that I had not explored before, there is a lot to learn in design tools, but expertise is not learned overnight.

      Finally, you have to remember all the safety parameters to make good use of the machines, especially the laser cutter, which can be very dangerous. When it comes to cutting vinyl, it was a lot of fun to be able to make custom stickers, although the job of removing excess material is a bit stressful