Skills Dev IV: Working with Outputs - Motors and Movement

Made by Justin Slusher ·

My goal with this project is to create a device that will utilize a solenoid and a small sign attached to your computer, which will move and alert the user that an item they wish to purchase is now back in stock. It would be helpful during times such as when the PS5 was difficult to buy.

Created: November 21st, 2023

0

Project Summary:

My goal with this project was to develop an alert system to notify users when a product, such as a PS5, is back in stock. The device/system uses a solenoid to physically move a sign, providing a visible alert to the user. 


Process:

The project involved connecting a solenoid at D3 to an Argon microcontroller. I also created a function, activateSolenoid, to trigger the solenoid ten times when the "in stock" was used to validate the function. 


Outcome:

My project achieved its goal of providing the physical sign alert when the solenoid function was triggered. 


Video/Code Below:


*Note you need to put the video in fullscreen

0
0
int solPin = D3;
bool shouldActivate = false;
int ledPin = D7;

void setup() {
  Particle.function("activate", activateSolenoid);

  pinMode(solPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (shouldActivate) {
    Particle.publish("activated");
    doSolenoid();
    shouldActivate = false;
  }
  delay(100);
}

void doSolenoid() {
  for (int i = 0; i < 10; i++) { // Activate the solenoid 10 times
    digitalWrite(solPin, HIGH);
    digitalWrite(ledPin, HIGH);
    delay(100);
    digitalWrite(solPin, LOW);
    digitalWrite(ledPin, LOW);
    delay(100);
  }
}

int activateSolenoid(String command) {
  if (command == "instock") { // Check if instock
    shouldActivate = true;
    return 1;
  }
  return 0; // Return 0 if not instock
}
Click to Expand
0

Next Steps:

One of the next steps I'd like to conduct is to connect it to IFTTT and a service that provides email alerts when an item has come in stock. When the IFTTT receives the email, it would properly trigger the solenoid to move the sign and then alert the user that the item is back in stock. 


Reflection:

One of my primary difficulties was when choosing to utilize a larger breadboard. The breadboard that I chose was actually "separated" in the middle of the breadboard, which was causing my device not to function. I had a conversation with Professor Byrne, and we figured this out. We wired the two sides together so they'd communicate properly.

x
Share this Project

This project is only accessible by signed in users. Be considerate and think twice before sharing.


Courses

48-675 Designing for the Internet of Things 24

· 11 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

My goal with this project is to create a device that will utilize a solenoid and a small sign attached to your computer, which will move and alert the user that an item they wish to purchase is now back in stock. It would be helpful during times such as when the PS5 was difficult to buy.