Continue to Site

Joining Two Devices. Is it possible?

SharpTeeth

Junior Member level 2
Junior Member level 2
Joined
Feb 8, 2025
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
247
Hi everyone. New guy here. I am not an engineer but instead an artist who could use some help. I hope I am posting this in the right section.

I am wondering if it is possible to integrate these two devices below? I want to attach a Garage Hoist to a Grow Light Mover. I’m not sure if they are compatible or can do what I want them to do together. Any help would be greatly appreciated.

The end result I want happen is when the Grow Light Mover stops on one end of the rail, the Hoist will then lower an object, keep it there for about 20 seconds then raise it back up before the Grow Light Rail starts to go back in the other direction. I thought the best way to do this was to buy a second Grow Light Mover and detach and use the "timer sensor” to connect to the Garage Hoist.

So in the end the completed finished unit which would ride along the light rail system will have--- a Grow light Mover with sensor in tact and the garage hoist with it’s own Grow light Sensor. when this whole unit moves to one end of the light rail there will be two separate magnetic stoppers. One for the Grow Light and the other for the Hoist.

Thanks in advance…...


DEVICE #1- “GROW LIGHT MOVER”

Designed to slowly move on a rail system from left to right. When the unit touches a magnet touch point it goes in the opposite direction. There is also a built in timer that can pause the device for up to 120 seconds.


____________________________________________

DEVICE #2 SMARTHOME - “MY LIFTER” - ELECTRIC GARAGE HOIST
https://www.smarterhome.com/product...WX1LN7fuMXLtPZK24wFCA93Rj8bNtXqxoCnHYQAvD_BwE

This is a Bluetooth device. There is an app that is used to program this device.
Here is the App— https://apps.apple.com/us/app/my-lifter/id945830110
Here is a video of how the app works_
 
Right, I wasn't certain about the travel length that would be occupied by the Mover. I pictured telescoping tubes (old-fashioned tv rabbit ears), sliding bars... adding flexibility to the motion and time delay as desired.

Youtube has many videos portraying mechanical devices animated.
Hinges, gears, cams, cogs... Might provide ideas. Example:

youtube.com/watch?v=MFmFAgohkIM
So here's the update....

In practice the prototype is working nicely. However it can only pulley up to 2 lbs before the motor/mover starts to hesitate and the pulley starts to push in towards the telescope. I'd like to be able to have it lift at least 20 lbs. The motor/mover unit is able to hold 75 lbs from the bottom. I feel like some hurdles have been overcome but not seeing how to get past the weight issue. Two motors instead of one motor and one pulley would probably help create more resistance but probably not enough.

 
A counterweight might help when the motor bogs down. Attach an equal weight somewhere to counterbalance the mannequin's weight. Then a tiny motor is sufficient to do the job.

It's hard to imagine where the counterweight should go. I doubt you want it in the aisle. Perhaps attached to the ceiling by a pulley system. For a single pulley the counterweight moves the same distance up-and-down as the mannequin travels.

A spring (as for screen doors, garage doors) might be an alternate.

Ideas about using a counterweight:
* Sandbags among stage curtains make it easier for a human to raise & lower heavy curtains or props.
* Railroad crossing gate has heavy weight on the thicker end, so a small motor can raise & lower the gate.
* A lift bridge (or drawbridge) has enormous counterweights at each end, usually hidden from view.
 
As always great leads Brad. Thank u. But first question is where would the counter weight attach to? The motor?
 
Hi Brad and and anyone else who might read this. So a lot has changed since we were brainstorming about my hoist project. I managed to work with someone to get the MY Lifter motor connected to an ESP and added sensors. In the end we will be controlling it through bluetooth.

I've learned a lot but not enough to know why the cord is not stopping at the same exact spot every time it goes in and out. Maybe I need to change this thread to get more eyes on it since the approach has changes so much but wondered if you had any thoughts? I am attaching a couple of photos to show how the motor starts and stops based on the white painted area used to trigger the sensor. It does not stop at the same spot on the white area in as it does out.

I am also attaching the coding used. ANY ADVICE would be great appreciated.......



IMG_1820.JPGIMG_1821.JPG





Code:
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

#define RPWM 27        // RPWM pin of HiLetgo BTS7960 board to esp 27
#define LPWM 26       // LPWM pin of HiLetgo BTS7960 board to esp 26
#define R_EN 25       // Right Enable pin of HiLetgo BTS7960 board to esp 25
#define L_EN 33       // Left Enable pin of HiLetgo BTS7960 board to esp 33
#define IrSensor 14   // connect IR sensor pin to esp pin 14 for motor start
#define IrSensor2 15  // connect IR sensor pin to esp pin 15  for gear count
#include <EEPROM.h>
const int eeprom1 = 0;
const int eeprom2 = 4;
const int eeprom3 = 8;
const int eeprom4 = 12;
const int eeprom5 = 16;
int FMS = 150;    //Forward Motor Run time   ///
int MPT = 10000;  //Middel Pause Time    ///
int RMS = 150;    //Reverse Motor Speed   //
int EPT = 10000;  //End Pause time   ///
int MC = 15;      // Motor Counter
volatile int whiteCount = 0;
bool countFlag = false;

int frdCounter = 0;
int bkdCounter = 0;
BLEServer* pServer;
BLECharacteristic* pTxCharacteristic;
bool deviceConnected = false;
bool oldDeviceConnected = false;
#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"            // UART service UUID
#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"  // UART RX characteristic UUID
#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"  // UART TX characteristic UUID
class MyCallbacks : public BLECharacteristicCallbacks {
  void onWrite(BLECharacteristic* pCharacteristic) {
    String value = pCharacteristic->getValue();
    Serial.println(value.c_str());
    if (value.length() > 0) {
      Serial.print("Received: ");
      Serial.println(value.c_str());
      int numValue = atoi(value.substring(1).c_str());
      switch (value[0]) {
        case 'A': EEPROM.put(eeprom1, numValue); break;  // A Forward Motor Run time   ///
        case 'B': EEPROM.put(eeprom2, numValue); break;  // B Middel Pause Time
        case 'C': EEPROM.put(eeprom3, numValue); break;  // Reverse Motor Speed
        case 'D': EEPROM.put(eeprom4, numValue); break;  // End Pause time
        case 'E': EEPROM.put(eeprom5, numValue); break;  // End Pause time
      }
      EEPROM.commit();
      Serial.print("numValue ");
      Serial.println(numValue);
      Serial.println("Value saved in EEPROM");
    }
  }
};
class MyServerCallbacks : public BLEServerCallbacks {
  void onConnect(BLEServer* pServer) {
    deviceConnected = true;
    BLEDevice::startAdvertising();
  };
  void onDisconnect(BLEServer* pServer) {
    deviceConnected = false;
  }
};
void setup() {
  Serial.begin(9600);
  Serial.println("Connect to MyESP32");
  pinMode(IrSensor, INPUT_PULLDOWN);
  pinMode(IrSensor2, INPUT_PULLDOWN);
  pinMode(RPWM, OUTPUT);
  pinMode(LPWM, OUTPUT);
  pinMode(R_EN, OUTPUT);
  pinMode(L_EN, OUTPUT);
  digitalWrite(R_EN, HIGH);
  digitalWrite(L_EN, HIGH);
  delay(10);
  EEPROM.begin(32);
  EEPROM.put(eeprom1, FMS);
  EEPROM.put(eeprom2, MPT);
  EEPROM.put(eeprom3, RMS);
  EEPROM.put(eeprom4, EPT);
  EEPROM.put(eeprom5, MC);
  FMS = EEPROM.get(eeprom1, FMS);  //
  MPT = EEPROM.get(eeprom2, MPT);  //
  RMS = EEPROM.get(eeprom3, RMS);  //
  EPT = EEPROM.get(eeprom4, EPT);  //
  MC = EEPROM.get(eeprom5, MC);
  Serial.print("FMS");
  Serial.println(FMS);
  Serial.print("MPT");
  Serial.println(MPT);
  Serial.print("RMS");
  Serial.println(RMS);
  Serial.print("EPT");
  Serial.println(EPT);
  BLEDevice::init("Mylifter Motor");
  pServer = BLEDevice::createServer();
  pServer->setCallbacks(new MyServerCallbacks());
  BLEService* pService = pServer->createService(SERVICE_UUID);
  pTxCharacteristic = pService->createCharacteristic(
    CHARACTERISTIC_UUID_TX,
    BLECharacteristic::pROPERTY_NOTIFY);
  pTxCharacteristic->addDescriptor(new BLE2902());
  BLECharacteristic* pRxCharacteristic = pService->createCharacteristic(
    CHARACTERISTIC_UUID_RX,
    BLECharacteristic::pROPERTY_WRITE);
  pRxCharacteristic->setCallbacks(new MyCallbacks());
  pService->start();
  BLEAdvertising* pAdvertising = pServer->getAdvertising();
  pAdvertising->addServiceUUID(SERVICE_UUID);
  pAdvertising->start();
  frdCounter = MC + 1;
  bkdCounter = (MC * 2) + 2;
}


void loop() {
  if (digitalRead(IrSensor) == LOW) {
    int currentState = digitalRead(IrSensor2);
    Serial.print("sensor");
    Serial.println(digitalRead(IrSensor2));
    if (currentState == LOW && !countFlag) {
      whiteCount++;
      countFlag = true;
      delay(200);
    }
    if (currentState == HIGH) {
      countFlag = false;
    }
    if (whiteCount < frdCounter) {  //this will count and unwound the rope
      analogWrite(RPWM, FMS);       // analogWrite(RPWM, FMS);  //Forward Motor Speed
      analogWrite(LPWM, 0);         // analogWrite(LPWM, 0);
      Serial.print("foward");
    } else if (whiteCount == frdCounter) {  // when counting is 25 so it will pause for middle pause time and then start wounding
      analogWrite(RPWM, 0);
      analogWrite(LPWM, 0);
      Serial.print("middle pause");
      delay(MPT);  //middle pause time
      whiteCount++;
    } else if (whiteCount > frdCounter && whiteCount < bkdCounter) {  // when counting is 50 so it will pause for end pause time and then start unwounding and make count 0
      analogWrite(RPWM, 0);
      analogWrite(LPWM, RMS);  //Backward Motor Speed
      Serial.print("backward");
    } else if (whiteCount >= bkdCounter) {
      analogWrite(RPWM, 0);
      analogWrite(LPWM, 0);
      Serial.print("Stop");
      delay(EPT);
      whiteCount = 0;  // Reset for next cycle
    }
    Serial.print("White count: ");
    Serial.print(whiteCount);
  }
}
 
Last edited by a moderator:
I don't know a lot about coding but could this be the issue?
frdCounter = MC + 1;
bkdCounter = (MC * 2) + 2;

Why would these two not be the same?
 
Sorry, I have no experience with the code language.

Does a physical parameter change in one direction compared to the opposite direction?
* Tension on the cord?
* Does the cord stretch in one direction yet relax in the opposite direction?
 
It does not stop at the same spot on the white area in as it does out.

I personally don´t understand what the exact problem is. I miss a clear error description, including how you test it, what you expect and what is not like expected.


still...
* one reason may be that the motor does not stop immediately.

* Another reason may be - I don´t know if you cared for this - the edge "black to white" becomes "White to black" when running in the opposite direction.

* If I understand the code correctly ... your motor is controlled by time. If so, then I would not be surprised if a motor has different speed when running fwd vs reverse.
This might be because of construction, but also because of torque (load).

****
your code is a bit hard to read ... and could be improved ... there is no need for this, asl long as YOU understand it.
Example:
you could replace:
+ const int eeprom1 = 0; --> const int eea_FMS; // eea stands for EEprom Address
+ const int eeprom2 = 4; --> const int eea_MPT;
and so on

but more important .. I´d code a clear state machine:
Idle, forward, wait_middle; backward, wait_end, error ... defined as enum
and a switch to run the different states

I´d not use a delay_ms(200) , but rather an interrupt driven counter

also I vote for some kind of debouncing for the sensor intput

Klaus
 
I personally don´t understand what the exact problem is. I miss a clear error description, including how you test it, what you expect and what is not like expected.


still...
* one reason may be that the motor does not stop immediately.

* Another reason may be - I don´t know if you cared for this - the edge "black to white" becomes "White to black" when running in the opposite direction.

* If I understand the code correctly ... your motor is controlled by time. If so, then I would not be surprised if a motor has different speed when running fwd vs reverse.
This might be because of construction, but also because of torque (load).

****
your code is a bit hard to read ... and could be improved ... there is no need for this, asl long as YOU understand it.
Example:
you could replace:
+ const int eeprom1 = 0; --> const int eea_FMS; // eea stands for EEprom Address
+ const int eeprom2 = 4; --> const int eea_MPT;
and so on

but more important .. I´d code a clear state machine:
Idle, forward, wait_middle; backward, wait_end, error ... defined as enum
and a switch to run the different states

I´d not use a delay_ms(200) , but rather an interrupt driven counter

also I vote for some kind of debouncing for the sensor intput

Klaus
Thank you for this info Klaus. I am not experienced enough to fully understand your information but I got most of it. So far we are not placing any load on the motor but the motor does seem to naturally have a different speed when running forward vs reverse.

When you said--- * "Another reason may be - the edge "black to white" becomes "White to black" when running in the opposite direction."
That may be part of the problem. But how would I solve this issue? Different coding?

I would be grateful - if possible - for you to adjust my code to be clearer as you mentioned, including using an interrupt counter and debouncing.
As I said I don't write code. I am an artist trying to learn fast.

THANK YOU in advance.....
 


Write your reply...

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top