2

Problem in getting -5 V with Arduino.

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  delay(20);
  digitalWrite(13, LOW);
  delay(20);
}

Above code is generating below digital signal:

puredigi

I want this type of digital signal output:

digiwithn

I read this for generating negative -5 V signal:

https://electronics.stackexchange.com/questions/10322/what-is-negative-voltage

but not able to understand very well WRT Arduino.

Also read this:

Negative voltage: How do I scale a 0 to 5 V signal to -10 V to +10 V?

seems to much complicated circuit diagram with TL802.

My questions:

  1. How do I get above digital signal?
  2. I was wondering if we can use some 1 microF capacitor or transistor to generate negative signal? (simplest way)
per1234
  • 4,278
  • 2
  • 24
  • 43
chandrayaan1
  • 195
  • 1
  • 4
  • 8

1 Answers1

4

It is not so easy to create a -5v power supply using a capacitor or transistor.

A very easy way is to use an additional Wall wart power supply to create -5 volts (while still using your original +5 volt power supply).

For the additional (new -5 volts power supply), use the two wires (positive and negative to create your -5 volts). The positive lead goes to your board ground, and the negative lead becomes your -5 volts.

EDIT 1 : Make certain that the Wall wart that you use is isolated from the mains voltage (line voltage you plug it into). Most Wall warts are isolated, but check to be sure.

Then you need level translation, which can be done with an op-amp and a couple of resistors :

enter image description here

You have not mentioned what frequency (data rate) you need. This circuit is not fast, so for high frequency or high data rates, the circuit could be improved.

Marla
  • 600
  • 1
  • 4
  • 11