lucas

  • **
  • 67
Reading PWM from one of the Outputs.
« on: February 21, 2016, 05:43:05 am »
A brief introduction:  As a spare time project I'm trying to create an LED driver for my CC3Ds.  The idea is quite simple, I'm using an ATTINY 85 to read the PWM signal from an Output (pin 5) that's linked to an AUX input (AUX1) wich is mapped to Channel 3 on my Taranis (Throttle).

That PWM value will then be used to change the blinking speed and color of the LEDs. So as I move the Throttle up the LEDs will change from blue to red and blink faster.

Here comes the problem:  if I have the CC3D connected to the GCS with an USB cable I can read the PWM values and print them in the serial monitor of the Arduino IDE, but as soon as I disconnect the USB (LiPO is powering the FC) I'm unable to read the PWM signal.  On the serial monitor I get low values like 4,5,4,3....

Is there a logic to this?   Why do I get normal PMW values when the USB is plugged in and as soon as I disconnect it I get illogical values?

I don't have my computer nearby so at the moment I can't post pictures, but if it helps I can post them tomorrow.

lucas

  • **
  • 67
Re: Reading PWM from one of the Outputs.
« Reply #1 on: February 21, 2016, 05:34:39 pm »
I added three Screenshots, maybe they can help explain the situation,

On the first one I´m powering the CC3D only with the USB.
On the second one I´m using both the USB and LiPo
And On the third one, only LiPo to power the CC3D.

As you can see the PWM readings are jittery with Battery and USB, and totally Illogical with only Lipo

lucas

  • **
  • 67
Re: Reading PWM from one of the Outputs.
« Reply #2 on: February 21, 2016, 07:48:36 pm »
Well solved!

Seems like you need to connect ground from your CC3D to ground of your ARDUINO!  ;D ;D

I´ll keep on working on my project and as soon as I get a decent LED driver I´ll post the code and the steps here.



On the image you can see the PWM being read with nothing but the LiPo powering the CC3D.