Hi, Is it possible to invert the output?

Hi, Is it possible to invert the output?

I have a circuit where for voltage difference reasons I need to invert the signal to my LED strip. (I can revert it back but I don’t have a lot of room.) Is there a way I can invert it in software to compensate? I wasn’t able to figure out how from the docs. #api documentation

There isn’t any mechanism in there to allow you to do that at the moment.

I accidently left a github issue about this and @Mark_Kriegsman thinks there might be?

It can be done in hardware using an op amp-a ~$1.00 chip. The reason you would do this type of maneuver in hardware & not software is that an opamp can do it faster that the MCU( microprocessor) which would have to do for it in software which eats up the mcu’s resources. More machine cycles to execute the function calls from the software.
I am not an EE but I think that’s about it. If sure if I’m not quite correct-some one will let me know!

Can a latch circuit do this for you?

I also found this interesting, but not sure if it works for you, from
http://www.sbprojects.com/sbbus/hardware.php

I choose an emitter follower circuit for the output transistor. This way we can drive the LED without inverting the signal. A normal NPN transistor would invert the signal from the UART, which is high when it is in rest.
A PNP transistor on the supply side could also be used to drive the LED without inverting the signal. I deliberately didn’t use this option because some UARTS have TTL levels on their outputs, which means that the high level does not exceed 3.5 Volts. This would result in a continuous base current through this transistor.

@Francis_Gulotta ​ can you explain “voltage difference reasons” a little bit more? I’m guessing a split rail supply?

That’s right, its a battery and a low voltage MCU

A voltage rail is the voltage span of a given power supply. Example: A computer switching supply a span(my term) range if you will. But that does NOT 30 volts to ground. +30 Volts to ground. Vcc.
Rather it could mean +15 Volts to 15 volts with ground being 0 volts Rail to rail plus or minus 15 volts. Why would you do that? Because some discrete devices use a minus voltage in the hook us at the “hot” side. I n the vernacular we usually associate the “hot” side as a plus side. But not necessarily so. Think of cars-most cars have minus ground but not so every time with electronic devices or the electronic device with in the device.

That’s a verbose screwy explanation BUT I understand words much better that math explanations!

Could some one tell me why my answer on rail to rail has part of it lined out? Is the answer that some Auto correct does not like my some times awkward way of explaining things? AS the latest total obnoxious Microsoft versions with the so called grammar checkers do?

"Strikethrough Text in Google Plus: If you want to write Strikethrough text, you must start your text with minus sign ‘-’ and end with ‘-’
I think it interpreted your -15 volts as the start of strike through text.

Ah sorry, I misunderstood! I thought you meant inverting the order of the pixels! I don’t think the library software can invert the signal without alteration, but as people have noted, a small amount of hardware can probably help get the job done.

Ah sorry, I misunderstood! I thought you meant inverting the order of the pixels! I don’t think the library software can invert the signal without alteration, but as people have noted, a small amount of hardware can probably help get the job done.

Ah gotcha, thanks!

@Francis_Gulotta having slept on this, i’m still not clear on what the challenge you face is? You said you are using battery, and a low power MCU, but why the inverted signal requirement?

Is there something preventing you from tying the ground of the LEDs to the ground of your MCU, @Francis_Gulotta ?

The grounds are tied together. However using an npn transistor I end up with an inverted output.

See http://electronics.stackexchange.com/questions/149582/how-can-i-use-a-npn-transistors-to-convert-from-3-3v-to-vcc-3-9-3-0v?noredirect=1#comment302632_149582 though they didn’t like the solution I came up with. I don’t know why though.

I’m even more confused now.

You original question was can i invert the output. You asked your question in the FastLED forum, which suggests you are using FastLED on a microcontroller of some sort, and yet the stackexchange question says your using a CMOS device??

But having seen your schematic, on stackexchange I just don’t know what the issue is here.

I have a feeling you are massively over complicating something.

Is this just a case of you using a 3.3v micro, and you need to level shift it to the required 5v clock/data?

You say you are using a 4v LiPo? Just tie the GNDs together (of your 3.3v MCU and the LiPO pack) and drive the 1st pixel with the 3.3v output from the MCU. We are only talking about 0.7v difference, and you will lose that much (if not more) through 2 transistor junctions.

The first pixel you drive, regenerates the signal and passes it on to the next pixel in the line. So you only need to drive the 1st pixel successfully at the 3.3v, i.e keep the line short.

stuart-you are correct. This should be a very straight forward thing to do IN HARDWARE. But-I don’t think he understands electronics. CMOS or TTL logic levels an or gate or an opamp. something easier than I’m or others are suggesting