# didgitalpunk

2
I've been bathing in electronics since I was born, and mechanics since my grandpa showed me how his clock worked. nowadays, I'm studying industrial maintenance at university and thinking of launching an e-waste recycling and re-purposing company.

## Achievements

100+ Comments Earned a bronze medal
• didgitalpunk completed the lessons Large Motors, Further Considerations, Reversing a Motor, Big Batteries and 1 other in the class Large Motors Class1 year ago
• maybe, depends on what type of motor it is, but it most likely will only be two phase, low voltage, and low power. basically, all you will get is a signal, and a hardly useable one at that.Your best bet is to make a three phase generator from a three phase motor. Just watch out what coupling it's using (although you'll be able to change it, most likely)

wye (also called star) and delta ( also called triangle) are the coupling of the individual phases relative to one another. those are not components. you can't "make them". here is a good read: https://en.wikipedia.org/wiki/Three-phase_electric_power#Balanced_circuits

• overly complicated...

The way you do that is you store the last state read from the encoder and compare the current state to the last state. For example: if there is a change from high,high to low,high,  it means you're going in one direction and you can add 1 to your counter or whatever you're using it for. If you go high,high, to low,low , it means you're going the other direction, and you can remove 1 from your counter. bit of code: upState = digitalRead(up);   downState = digitalRead(down);   if(lastDownState == 1 && lastUpState == 1){       if(upState == 0 && downState == 0){       //Detects Counter Clock Wise rotation        timer--;         ...

see more »

The way you do that is you store the last state read from the encoder and compare the current state to the last state. For example: if there is a change from high,high to low,high,  it means you're going in one direction and you can add 1 to your counter or whatever you're using it for. If you go high,high, to low,low , it means you're going the other direction, and you can remove 1 from your counter. bit of code: upState = digitalRead(up);   downState = digitalRead(down);   if(lastDownState == 1 && lastUpState == 1){       if(upState == 0 && downState == 0){       //Detects Counter Clock Wise rotation        timer--;                             // removes 1 from the existing timer count     }}       if(lastDownState == 0 && lastUpState == 0){       if(upState == 1 && downState == 1 ){       //Detects Clock Wise rotation       timer++;                             // adds 1 to the existing timer count     }} upState and downState are my outputs from my encoder, and my encoder track goes like this: _ :low     -  :high track1:  ______----___ track2:  ___---------___ I'm using the same code (adapted a bit of course) on a 2500 step encoder, and it works a charm, even at (fairly) high speeds. -Didgitalpunk