Skills Dev IV: Working with Outputs - Motors and Movement

Made by Sohail Shaikh

Get oriented with output and feedback by working with an actuator. Taking cues from Google's Paper Signals experiment with materials to create an interesting notification or effect when combined with the actuator.

Created: December 18th, 2022

0

Outcome

    • In this project, I used a Servo motor to show an alert about the current temperature range. This range is divided in 5 categories- Very Cold, Cold, Cool, Warm and Hot. The user will input the current temperature in degrees Celcius using the cloud function.
    • Going forward, this can be connected to platforms such as IFTTT to get a real-time temperature alert.

0

Process

The range of the servo meter was a challenge. dividing the servo meter to show the changes in the temperature. I had to debug and run the code a few times to understand if the range can be differentiated. and how many temperature ranges should I keep to ensure the difference is clearly visible.

0

Reflection

This project helped me learn that Servo motor can be used to create unique and easy alerts or notifications for the user. The Google's Paper Signals Project helped me in generating ideas for this project. In future I will develop a cloud connected temperature alert system using a Servo Motor. 

0
Get Temperature range using a Servo Motor
Sohail Shaikh - https://youtube.com/shorts/n6PyMRheRDU?feature=share
0
Servo myServo;
int servoPos = 0;

void setup() {

    myServo.attach( A3 );
    Particle.function("Current_Temperature", servoControl);
    Particle.variable(  "servoPos" , &servoPos , INT );
}

void loop() {

}

int servoControl(String command)
{
    // Convert
    int newPos = command.toInt();
    // Make sure it is in the right range
    // And set the position
    int veryCold= 18;
    int cold= 55;
    int cool= 91;
    int warm= 127;
    int hot= 163;
    if( newPos<=0){
     servoPos = constrain( veryCold, 0 , 180);
    }else if(newPos> 0 & newPos <=8){
     servoPos = constrain( cold, 0 , 180);
    }else if(newPos> 8 & newPos <=18){
     servoPos = constrain( cool, 0 , 180);
    }else if(newPos> 18 & newPos <=29){
     servoPos = constrain( warm, 0 , 180);
    }else if(newPos> 29){
     servoPos = constrain( hot, 0 , 180);
    }
    
   // Set the servo
   myServo.write( servoPos );

    return 1;
}
Click to Expand
x
Share this Project

Courses

About

Get oriented with output and feedback by working with an actuator. Taking cues from Google's Paper Signals experiment with materials to create an interesting notification or effect when combined with the actuator.