Go Down

Topic: Serial Not Working With the Power Plug (Read 565 times) previous topic - next topic

eddiea6987

hey guys , i just got my first two Arduino (uno) and some RF links http://www.nkcelectronics.com/433Mhz-RF-link-kit_p_185.html
my phone SD card is messed up so i had to draw out my connections
The problem is that i am trying to figure out how to connect these RF links and have the Arduinos talk to each other, and I do not want to use the software serial library either.
So as far as i understand , in its most basic form a serial connection is first initiated (serial begin) on both ends then one listens (available) untill it has something to work with, and the other end simply sends. Now while powered by the USB this works fine because its not really doing anythign special its all routed through the usb and ONE arduino serves as both tx and rx
but once i have the code on the arduino and I keep my receiver plugged into usb so i can print to serial monitor the data being  received and then i use the power plug on the transmitter, the transmitter does not transmit , the TX light flashes and works fine when powered by the usb but not when powered by powerplug. And i did do my research before i came here and i found two things...

1.this same question on the old arduino forum which now is "read only" and the issue was resolved but i dont know what this means "If its on the edge for smoothing or voltage, you can get unexpected problems." which im assuming was the answer to the mans question. but i dont know what it means http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263010462

2. this just helped me get around of why there where two data cables on the reciever and i hope im doing it right ..
http://letsmakerobots.com/node/12336 this also mentions an additional library to download but im assuming arduino already has all it needs to make this work..

here are my connections as well as my code, like i said I just want the most basic connection ,and from there i will build up on it.



and heres the code

//reciever

void setup()
{
Serial.begin(9600);
}

void loop()
{
 
     while (Serial.available() == 0);//loop until something is heard
    int val = Serial.read() - '0'; // convert to char
   
   Serial.println(val);
    //this is assuming im only sending over one character i will work out the rest later as to reading strings and aggregating
    // but i need at least this basic thing here to work!!
   
}

///end reciever

//transmitter

void setup()
{
     Serial.begin(9600);
 
}


void loop()
{
 
      Serial.write("6"); // i have also tried print and println but my issue is not what type of data is sent
                              // the issue is that on this side of the project the tx led doesnt even blink once :( when using the power plug
                               // and yes the "on" led is on
     
      delay(1000);
 
}
// end transmitter
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

eddiea6987

#1
Jun 25, 2011, 07:12 am Last Edit: Jun 25, 2011, 10:21 am by eddiea6987 Reason: 1
ok so ive tried this , and made some intersting discoveries , i put the "transmitter code" on both arduinos to check if perhaps it was a board issue and i find that if i open the Arduino IDE and upload the sketch it works i get the TX led flashing 1 every second which means its transmitting my data , but once i unplug it and plug it back in TO EITHER USB OR POWER PLUG it doesnt blink anymore.....which means my code is not running? as if the code is not there anymore i wish there was a way to extract code from the chip to see if its actually there after it loses power because thats what seems to be going on , once it loses power and i reconnect no more tx flashing :/

however when i add something like the blink led example code it works just fine from any power source after as many reboots  as you could imagine so i know its working fine and keepiing the data


update @4am eastern : So ive been on a mission here and i apologize for starting a thread and then talking to my self , but i just want to give you guys as much input on the situation as possible , okay so i downloaded the VirtualWire Library , and got the reciver and transmitter working finally but NOT thourgh my hard wired rx/tx pins , i simply copied and pasted the example code , now have to go read it and unerstand it so i can use it as my heart desires. The only thing that still bothers me is that it allows me to use any pin which tells me this is just an implementation of software serial which is not exactly what i want, because theres no "handshaking" or verification of data , unless i implement some simple chars and use them as starters and end of message to filter out noise. and i also plan on using visual basic to send and receive from serial but with this library im not sure if it will all still work the same   , anywho here is a link to the , nice short and precise, documentation of the VirtualWire library
http://www.open.com.au/mikem/arduino/VirtualWire.pdf
Still wondering though why the hardware tx/rx do not work after losing power the VirtualWire seems to work fine i even got to test the range on the little modules
but i would REALLLY LOVE to just use my hard wired RX/TX pins
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

PaulS

Quote
I do not want to use the software serial library either.

Why not? I don't see any other way to debug the issue, unless you add an LCD that you can write messages to.

Quote
The only thing that still bothers me is that it allows me to use any pin which tells me this is just an implementation of software serial which is not exactly what i want, because theres no "handshaking" or verification of data , unless i implement some simple chars and use them as starters and end of message to filter out noise. and i also plan on using visual basic to send and receive from serial

There is no automatic handshaking, etc. with the hardware serial port, either.

If you have your transmitter on the hardware serial port, you can't have anything else on that port - like the VB application.

So, we are back to the issue of why you don't want to leverage what other people have develop, tested, and debugged, such as NewSoftSerial or VirtualWire.

eddiea6987

Theres no real reason as to why i dont want to use the software serial , its just a matter of prefrence but im at the point where im fine using the VirtualWire now since it gets the job done , but still for the sake of me knowing and understanding why the hardware pins are not working! its kind of just eating at me right now, and as far as Having the serial rx/tx active alone with out something else on it, i have not even coded any VB yet i just got everything in the mail and i was trying to test it all , Only my receiver is going to stay pluged to a computer the other one is going to be powered either by battery or its own power plug , and it does work with the Virtual wire so thats what im giong to use, since i cannot get the hardware pins to work.

I dont know but sometimes if i want to do something a certain way and i know its possible and it should work,even when i find a way "around" i still would like to know why or why not i cannot do what i intend.

Thanks for the reply. 
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

Go Up