Skip to content

11. Input devices

This week I worked on defining my final project idea and started to getting used to the documentation process.

To do list

  • Group assignment:
  • Measure the power consumption of an output device
  • Document your work to the group work page and reflect on your individual page what you learned
  • Individual assignment:
  • Add an output device to a microcontroller board you’ve designed and program it to do something

Output device classification

Classic circuits include input, input, main control and power supply.Common output devices can be divided into three categories.

  • Sound
  • Light
  • Movement

PWM(Pulse width modulation)

img

Steering gear is a kind of position servo driver, which is suitable for those control systems that need to change and maintain the angle. Its working principle is that the control signal enters the signal modulation chip from the channel of the receiver to obtain the DC bias voltage. There is a reference circuit inside it, which generates a reference signal with a period of 20ms and a width of 1.5ms. The obtained DC bias voltage is compared with the voltage of the potentiometer to obtain the voltage difference output. Finally, the positive and negative voltage difference is output to the motor drive chip to determine the forward and reverse rotation of the motor. When the motor speed is constant, the potentiometer is driven to rotate through the cascade reduction gear, so that the voltage difference is 0 and the motor stops rotating.

Arduino control servo

We can use the external signal to make the steering gear change the angle with the change of input, which is convenient to make some controllable rotating devices. Here we need a variable resistor potentiometer to control the steering gear.

Use the three backticks to separate code.

// 
#include <Servo.h>   
Servo myservo;   
int potpin = 0;      
int val;         

void setup() { 
      myservo.attach(11);   
} 

void loop() { 
       val = analogRead(potpin);   
       val = map(val, 0, 1023, 0, 179);  
       myservo.write(val);             
       delay(20);                        
}

Video

From Vimeo

Sound Waves from George Gally (Radarboy) on Vimeo.

From Youtube

3D Models


Last update: April 6, 2022