Week12. Output devices

This week, following last week’s input device, create an output device.

Group Assignment

The content of our group assignment is here
Week12 Group Assignment

Impressions

Household appliances that we use regularly consume more power than any of the circuits we created and are more dangerous.
Being able to live safely means that it is being dealt with.
I think that’s thankful.

Output Devices

Create a motor driver that can be connected to the board created in Week 11.

Design

  • Scematic
    Schematic

  • Board
    Board

Cut out

I cut the board in three times and took it out.

  • Circuit
    Circuit

  • Holes
    Holes

  • Round
    Round

  • Cutout & Soldering CutAndSoldering

I re-created the circuit three times.
Because I made a mistake in the following points.

  • The direction of the 12V power connector is reversed.
  • The power supplies connected to Vref and VBB were reversed.
  • A capacitor for noise suppression was attached to Vref instead of VBB.

It’s not fun at all to repeat simple mistakes.

Programming

Use Arduino as in Week 11.

Arduino

The following program was created by Arduino and written.
It sends PWM signal to the motor and repeats forward and reverse at 1 second intervals.

// Using GroveConnectors
#define GROVE_R1 2 // Right 1 PIN11
#define GROVE_R2 3 // Right 2 PIN10
#define GROVE_L1 8 // Left 1 PIN5
#define GROVE_L2 7 // Left 2 PIN6
#include <SoftwareSerial.h>
SoftwareSerial softSerial(0,1); // RX, TX
// Variable value
int sensorValue_R;
int outputValue_L;
void setup() {
  // put your setup code here, to run once:
  pinMode(GROVE_R1,INPUT);
  pinMode(GROVE_R2,INPUT);
  // analogWrite not need setting pinMode
}

void loop() {
  analogWrite(GROVE_L1,128);
  analogWrite(GROVE_L2,0);
  delay(1000);
  analogWrite(GROVE_L1,0);
  analogWrite(GROVE_L2,128);
  delay(1000);
}

Result

The following sensors are connected to the Grove Connector.

  • Right Side not use
  • Water Pomp Moter (Left Side)

There are limited pins available for PWM output at Attiny44. Among the pins used for the Grove connector this time, PB2 and PA7 used for the left connector corresponded.

Pins

Files