Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Help with a Bug - AC Voltage and Current Reading on a Teensy 3.6

  1. #1
    Junior Member
    Join Date
    Aug 2018
    Posts
    10

    Help with a Bug - AC Voltage and Current Reading on a Teensy 3.6

    Hello,

    I'm measuring the current and voltage of an AC Motor with a Teensy 3.6 (see image below). The Voltage sensor requires 5V; and I'm using the Teensy 5V to power it (USBHost_t36.h Library). The diagram works, however, when I turn the motor ON, I can log the data well; but as soon I turn the motor OFF (from switch); the USB port gets disconnected.

    What I'm doing wrong?

    I thought it was a bad ground; but then, If I disconnect everything (gnd, analog and +5V) from the teensy, and run the motor again- It still disconnects from the USB as soon I turn the motor off. I try with 2 teensys 3.6 and 2 different pcs and the problem still exists.

    Any help or tips will be very helpful.

    Click image for larger version. 

Name:	Diagram.jpg 
Views:	16 
Size:	83.3 KB 
ID:	16647

  2. #2
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    189
    Motors generate a lot of electrical noise on the lines, and a lot of EM emissions too. Maybe when the motor is switched off, a spike occurs and disconnects the USB port.
    See if you can figure an RC filter to protect the lines from spikes and noise.

  3. #3
    Junior Member
    Join Date
    Aug 2018
    Posts
    10
    Quote Originally Posted by XFer View Post
    Motors generate a lot of electrical noise on the lines, and a lot of EM emissions too. Maybe when the motor is switched off, a spike occurs and disconnects the USB port.
    See if you can figure an RC filter to protect the lines from spikes and noise.
    Thanks for the recomendation. Would something like an USB Isolator works?

    https://www.amazon.com/HiLetgo-ADUM3...-1-spons&psc=1

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,068
    Does the current sensor have a resistor built in? Some of those current transformers output a pure current and require a resistor to convert to a voltage which can be measured by Teensy. Without the resistor, it could risk damage to the Teensy.

  5. #5
    Junior Member
    Join Date
    Aug 2018
    Posts
    10
    Quote Originally Posted by PaulStoffregen View Post
    Does the current sensor have a resistor built in? Some of those current transformers output a pure current and require a resistor to convert to a voltage which can be measured by Teensy. Without the resistor, it could risk damage to the Teensy.
    Hi Paul, yes; that current sensor has a built in resistor. The diagram works well on a teensy; except that it will disconnect the USB when I turn the Switch off. Do you think that USB Isolator helps?

  6. #6
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    189
    Quote Originally Posted by mendez View Post
    Thanks for the recomendation. Would something like an USB Isolator works?

    https://www.amazon.com/HiLetgo-ADUM3...-1-spons&psc=1
    Honestly, I don't know: never used one. I reckon you intend to put it between the Teensy USB Host port and the voltage sensor. Seems a nice idea to try, at least, if all else fails...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •