Arduino digital logic 4.5V - 5V

Digital logic of my arduino is 4.5 (LOW) and 5 (HIGH). I checked on a different pin and seems to be ok. I noticed using a diode test, theres only a diode between ground and a digital output pin ~700 Ohms. I’m using a digital output pin and transistor to interface with a 555 timer

int on = B00000100;
int off = B00000000;
char stringData[] = "a";
int testbyte[] = {0,0,1,0,0,0,0,1};
int syncbyte[] = {1,1,1,1,1,1,1,1};
int startbyte[] = {1,1,1,1,1,1,1,0};
int stopbyte[] = {1,1,1,1,1,1,0,1};
int nullbyte[] = {0,0,0,0,0,0,0,0};
int alternatingbyte[] = {0,1,0,1,0,1,0,1};
bool bytesent = false;

unsigned long startMillis;
unsigned long currentMillis;

void setup() {
 // put your setup code here, to run once:
DDRD = B00000100;
//Serial.begin(9600);
//pinMode(3, OUTPUT);
//digitalWrite(3,HIGH);
//Timer = micros();
//startMillis = millis();
}
void loop() {
//currentMillis = millis();

//if(!bytesent)
sendWord(stringData, sizeof(stringData) / sizeof(stringData[0]) );
//sendByte(syncbyte, sizeof(syncbyte)/sizeof(syncbyte[0]));
//sendByte(nullbyte, sizeof(nullbyte)/sizeof(syncbyte[0]));
//sendByte(alternatingbyte, sizeof(alternatingbyte)/sizeof(syncbyte[0]));
}
//Receives empty array, populates it with binary version of char
void charToBinary(char a, int dataByte[]){
 for (int i = 0; i < 8; ++i) {
   dataByte[i] = (a >> (7 - i)) & 1;
 }
}
//Iterates through each char in array, sends corresponding byte
void sendWord(char dataWord[], int len){
 sendByte(startbyte, sizeof(startbyte)/sizeof(syncbyte[0]));
 for(int i = 0; i < len; i++){
   int arr[8];
   charToBinary(dataWord[i], arr);
   sendData(arr, sizeof(arr)/sizeof(arr[0]));
 }
 sendByte(stopbyte, sizeof(startbyte)/sizeof(syncbyte[0]));

 //Close data transmission
 bytesent = true;
 PORTD = off;
}
//Sends two bytes, sync byte, then data byte
void sendData(int data[],int len){
 sendByte(syncbyte, sizeof(syncbyte)/sizeof(syncbyte[0]));
 sendByte(data, len);
}
//Works by receiving array with length
//Looping through and depending on the value, setting a register HIGH or LOW
void sendByte(int data[],int len){
   //Serial.println("");
 for(int i = 0; i < len ; i++){
   delay(50);
   if(data[i]){
     PORTD = on;
     //Serial.print(1);
   }else{
     PORTD = off;
     //Serial.print(0);
   }
 }
 //Serial.println("");

}

Start here

Nwar, awol says that because your code is messed up. The “How to use this forum” thread tells you (among other things) how to post code that does not get forum induced errors, as yours does as evidenced by the unintended italics. When that happens, it means stuff has been omitted from your code.

While I agree 100% with the previous two comments, here are some observaruins on bits of your code.

Any reason why you use DDRD = B00000100 instead of the pinMode call? hint this is not doing what you think.
And PORTD = on instead of the digitalWrite call?
It only serves to obfuscate what you are doing and has no discernible speed advantage, especially since you have a socking great 50mS delay before it so you are not likely to notice the 4uS speed up you get from this.

It looks like you can program in another system but are just learning C on the Arduino. Your code is over complex and yet you still include the default comments like "// put your setup code here, to run once:" which anyone past a beginner would remove from the default template.

I noticed using a diode test, theres only a diode between ground and a digital output pin ~700 Ohms.

I hope the power was off, and yes that is what most unpowered chips look like to a diode tester. It is the ESP diode to ground.

So I’m not sure but I have a 2N404 interfacing with a digital output. I’m wondering if the emitter to +5V is allowing current to pass through to the base of the PNP transistor.

I have my arduino powering the 555 timer, not the transmitter. I have the +5V pin on the arduino feeding to the rest of the 555 timer. It is powered by USB.

My output pins are now not responding to any square wave patterns I supply. Mostly sawtooth pattern.

I’m also somewhat confused as I put a 10K resistor in series with the digital output pin.

Maybe I’ve drawn too much current from the +5V pin?

Update* The 5V pin is now outputting 500 mV

Maybe I should keep the arduino separate, with a floating ground

FMTransmitterFinal.pdf (56.8 KB)

The OP’s diagram
FMTransmitterFinal.pdf (56.8 KB)
Connecting the pins 2, 4 & 5 on the 555 to +5V is not going to do much good for it.

And your transistor is only going to leave connected to 4.2V. I think you need to examine your 555. Circuit and check on the legality of that circuit.

A 6V battery is not sufficient voltage to power an Arduino through the Vin pin.

The 2 4 5 pins are improperly labeled. There should be no joints at 2 & 5. I planned on just using the usb port to power the arduino and the 555.

So can you make the corrections to the schematic and post it again.

Checked the legality yet?

Yea it works. I didn’t label it properly. The output of the 555 timer actually leads into another circuit with a blocking capacitor. It feeds into a PLL to demodulate the different 555 timer frequencies.

It’s essentially a very crude serial bus. I’m wondering if the other circuit is drawing too much current from the 555 timer which in turn draws current from the arduino?

FMTransmitterFinal.pdf (47.5 KB)

I'm wondering if the other circuit is drawing too much current from the 555 timer

Is that "other circuit" the one you have not shown on the schematic?

The OP’s first sentence:

Digital logic of my arduino is 4.5 (LOW) and 5 (HIGH).

is not correct. AVR digital I/O levels are relative to supply voltage and typically high is >= 0.6-0.7 * vcc and low is <= 0.3 * vcc. Consult the specific processor data sheet for the exact numbers, if it truly matters.

WattsThat:
The OP’s first sentence:

is not correct. AVR digital I/O levels are relative to supply voltage and typically high is >= 0.6-0.7 * vcc and low is <= 0.3 * vcc. Consult the specific processor data sheet for the exact numbers, if it truly matters.

Yes I know, but the output I am receiving is not normal.

And as already explained, your 555 and transistor configuration is not valid. What is the purpose of output D2 and Q1 with respect to 555 operation? What do you think the 555 will do without a timing cap on pins 2&6? Perhaps you should explain what you’re trying to do rather than troubleshoot an incorrect design.

nwar1994:
Yes I know, but the output I am receiving is not normal.

Read reply #3 again. What you are seeing is the difference between a floating input and a pulled up input. You are not looking at an output.

The digital output is an input?

Also is it possible to plug in USB for arduino, but common ground the arduino pin with a 9V battery. Then have the battery drive the 555 timer?

Would the current bypass the transistor if its receiving 0 to 9V at the base?

Also is it possible to plug in USB for arduino, but common ground the arduino pin with a 9V battery.

Not only must you do that, that is what your schematic shows you are doing. If you are not then that could be an alternative explanation for what you see.

Hi,
OPs circuit.
What are you trying to do with the LM555?
If you want to send tones, why not get the Nano to do it for you, using the tones library?
With Q1 connected to the Nano output like that, if you have the emitter at more than 5V, like you have, you will not get the LM555 to change tone.
This because the drop between emitter and base will never be low enough to turn Q1 off.
It will be ON or operating in a linear part of the transistor characteristic curve, causing WEIRD RESULTS.
You must run Vin at least at 8V, 6V will not provide the proper supply to the internal linear 5V regulator.

Also C6 needs to be placed in the correct position.
Tom... :slight_smile:

Hi,
This would be a better control for your LM555.
Feel free to modify or suggest improvements.

Tom.. :slight_smile: