I got the quadrature encoders working after a bit of fiddling with grounds (and not knowing jack shit about electronics, honestly). At one point, I even fed voltage through one of the wheels backwards. I realized my mistake when the LED didn’t go on and quickly switched it off. No harm done. But, for a little while, it appeared that I had done quite a bit of harm, so I contacted the wheel guy himself, Matthias in Germany and asked him about it. He did NOT alleviate my fears. However, it appears that I have indeed not fried them. The wheels stopped reading for quite a while.
Yesterday, I got it all hooked up correctly after some pointers on having grounds all over the place by the creator of the Teensy at PJRC.
The problem with the quad encoder WAS actually the MOSFET circuit I had introduced as a sort of buffer between the two circuits. The Teensy 3.1 guru himself told me that it is OK to send the 5V logic level directly into the Teensy and strongly urged against the component I had been using to step down the voltage. Instead, he suggested this chip for such a task: the 74LCX125 Low voltage quad buffer.
I will be looking into them once I get this project settled. An extra 6ns doesn’t seem like a lot, but if he says that 5V is OK, I can run the wheels at 4.8V and be fine for both electronic components.
That leaves me with being able to have a connected system ground and hot that are the same voltage.
USB Power or Not? How about both by simply swapping out a cable?
I have been working on finding a USB cable that doesn’t send 5V. I haven’t had any luck.
I want to be able to keep my USB connected to the computer while I power the electronics from elsewhere.
I am thinking about building in the capability to power both of the wheels with one USB cable and, if I switch out the cable, I can suddenly flash new firmware and test it without un-patching stuff. I just need to make sure the powered cable is never attached at the same time as the battery or mains…. something I will prevent by cutting the USB, and sticking a fused voltage regulator before the USB power in.
Might be cool to have like 10 microcontrollers attached to a hub inside the unit and be able to flash them all without connecting 10 different cables too.