Use transistor to enable/disable a 1wire device

Hi all, first time posting here. I’ll preface this by stating I’m a software guy, not a hardware guy.

I’m working on a project that connectors for several stepper motors. The motors may or may not be there and they may change the ports they are connected to.

ie.

Configuration 1
Port 1,2 → Motor A
Port 3,4 → Motor B
Port 5,6 → Motor C

Configuration 2
Port 1,2 → Motor B
Port 3,4 → Motor C
Port 5,6 → Motor A

I would like to be able track and store data on each motor over time, so I need to be able to identify if Motor A is moved from Port 1 to Port 3. I am using a 7 wire connection to connect the motor to the Arduino (only 4 wires are used, 3 are free).

I was thinking of attaching a dallas 1 wire eeprom device to each pump which would use 2 more wires. To identify which eeprom device goes with each motor, I wanted to use a transistor, attaching C and E to the ground of the 1 wire and B to a 24v line to the motor.

Simple question, would this work? If not, is there something else that could accomplish this?

Thanks,

Justin

schematic.png

Simple question, would this work?

No.

If not, is there something else that could accomplish this?

I am not sure why you need to disable this device anyway.

Grumpy_Mike: No.

lol, no it won't work, or no its not simple?

Grumpy_Mike: I am not sure why you need to disable this device anyway.

The idea is to disable all motors, thus disabling all 1-wire eeprom. Then I would turn on the motor using Port1,2, enabling the 1-wire on that motor. Query the wire, get a single serial number back (since only 1 device is active), and I would know Motor B is using Port1,2. Turn off Port1,2, disabling the 1-wire associated with that motor and repeat for Ports3,4, etc. Thus figuring out what pump is connected to which port.


| Motor 1 | | Arduino | | |==============| | | EEPROM | | | | |==============| | ____________ | | | | | | ____________ | | | Motor 2 | | | | |==============| | | EEPROM | | | |________|==============| | | | | | _________ | | | Motor 3 | | | | |==============| | | EEPROM | | | |________|==============| | |______|

Since you are planning to run extra wires to the motor, just use two of those extra wires to use the eeprom device as it is intended to be used.

Couldn't you leave the EPROMS connected and query each port for an address?

jremington: Since you are planning to run extra wires to the motor, just use two of those extra wires to use the eeprom device as it is intended to be used.

outsider: Couldn't you leave the EPROMS connected and query each port for an address?

I believe you guys are making a similar point, but I don't think it will help. I can get the serial numbers using them as intended, but I don't see how that tells me which ports the motor is connected to.

Maybe I should go back to the beginning. I am using stepper motors that are rated for X number of hours. I would like to track the number of hours the motor has been used on memory that moves with the motor. Someone could conceivably have 10 or 100 different Arduino boards and could move a single motor between any one of the boards. I want whatever board the motor is connected to, to know how many hours that motor has been used for.

depends, yes you could use the EE to track this as an hr/min meter per motor of sorts. You would want to implement wear leveling EE library, keep the hr meter var as a global until you tell it to power off, or have a super cap connected to VDD and sense when power was pulled from the arduino so that the arduino has time to write the updated value back to EEprom

EE's have a finite write life generally ~100,000 cycles, can get a bit more mileage with wear leveling techniques. You'll also want to have another variable to use as a write cycle meter so that your program can perform a copy from a worn out EE to a fresh one, like changing out a failing HDD with a new one in your computer with a bit-for bit copy program.

Also, google "diode switch"

If you want to have multiple arduinos connected at the same time, is possible but you'd need to implement some kind of busy-wait bus to sync them, otherwise you get data collisions (bad).

Thanks for the response, but I don't think this solves my problem.

There will be multiple independent arduinos, there's no way for data collisions to happen. They are independent devices performing similar duties. Each arduino can have up to 3 motors connected to it, using motor slot A, B and C.

There will be N number of motors available, but a user can move and swap them around as needed. There is no guarantee that Motor_1 will be attached to Slot_A for the lifetime of Motor_1. It could be start off attached to Slot_A, then the user moves it to Slot_B, then to Slot_A on a different arduino.

Under this scenario, each motor needs its own EEPROM to keep track of usage data. EEProm_1 needs to be coupled with Motor_1 for the lifetime of Motor_1. If Motor_1 switches from Slot_A to Slot_B on the same arduino, or moves to a different arduino, the data needs to follow. I have limited i/o pins and limited space on my board, so I would like to use the 1wire protocol to communicate with each Motor's EEPROM.

I need some way to figure out how to identify what EEPROM is coupled with what Motor. If I could somehow disable the EEPROM unless power is being applied to the motor, I could identify which EEPROM is connected to which Motor by turning off all motors, then turning them on 1 by 1 and seeing what EEPROM is there.

You might want to look at this. The code on the page returns addresses so if the device stays with the motor you know that address. Or is the question here really, what one wire device to use with the motors?

http://playground.arduino.cc/Learning/OneWire

outofoptions: Or is the question here really, what one wire device to use with the motors?

Exactly. I need a way to know what EEPROM to associate with what Motor.

Have you ever used a transistor before ? Why is there no base resistor ?

BJT transistor would not be good. What you really need is a MOSFET switch to minimize the effect of the transistor on the signal. Part like this: http://www.digikey.com/product-detail/en/SN74CBTD1G125DCKR/296-6476-1-ND/377997

More options: http://www.digikey.com/product-search/en?FV=fff40027%2Cfff802b3%2C20800bd%2C93c0001%2C9440001&k=switch&mnonly=0&newproducts=0&ColumnSort=1000011&page=1&stock=1&pbfree=0&rohs=0&quantity=&ptm=0&fid=0&pageSize=25

1-wire EEPROM, that was new item for me as well: http://www.digikey.com/product-search/en?pv154=188&FV=fff40027%2Cfff80434%2Cf040003&k=eeprom&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

Why do you want to know how long each motor has been used for? Is this an x-y problem perhaps?

How much experience do you have with electronics and arduinos ? It might be more expedient to explain exactly WHAT you are trying to accomplish (the big picture) because it is quite possible that your project plan is not the best way to do it and someone can recommend a better way.

MarkT: Why do you want to know how long each motor has been used for? Is this an x-y problem perhaps?

The motors have an expected lifetime. I need to know when they are nearing end of life.

raschemmel:
How much experience do you have with electronics and arduinos ?
It might be more expedient to explain exactly WHAT you are trying to accomplish (the big picture) because it is quite possible that your project plan is not the best way to do it and someone can recommend a better way.

I’m a noob at hardware, expert at software.

Motors could be unplugged and shelved for a year, and then hooked back up. I need to know that that motor has 100 hours left before it needs to be replaced.

What if I shared a pin from my L293 via a signal switch (CD4066BE).

Put a pullup resistor and the EEPROM on an IO pin of the CD4066BE. And on the OI pin, share a line with one of the inputs from the L293. If I need to use EEPROM, I disable the L293, or I could even cut power to it and then turn the signal switch on. If I need to use L293, turn the signal switch off and enable the L293.

Can you post a photo of a hand drawn schematic of that ?