Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 26, 2019, 07:33:02 19:33


Login with username, password and session length


Pages: 1 2 3 4 [5] 6 7 8 9 10
 41 
 on: March 07, 2019, 03:37:35 15:37 
Started by Wizpic - Last post by Wizpic
I see this is where I got the confusion from.
This is the TX side(crude but only for a simple test)  on a Arduino Mega
Code:
int potValue = 0;

void setup() {
  Serial.begin(115200); // Default communication rate of the Bluetooth module
  Serial1.begin(115200); // Default communication rate of the Bluetooth module
}

void loop() {

  // Reading the potentiometer
  potValue = analogRead(A0);
  int potValueMapped = map(potValue, 0, 1023, 0, 255);
  Serial1.write(potValueMapped); // Sends potValue
  Serial1.write(0x48);   // H
  Serial.println(potValueMapped); // Sends potValue
  delay(50);
}

This is the RX side(again crude but quick test), Bearing in mind I've not tired this version yet, As I  thought that I could just use the FTL232 converter to read the data from the HC-05 then display it on PC.

Code:
#define led 9

int data=0;
void setup() {
 
  pinMode(led,OUTPUT);
  Serial.begin(115200); // Default communication rate of the Bluetooth module
}

void loop() {
 if(Serial.available() > 0){ // Checks data is  from the serial port
 data = Serial.read(); // Reads the data from the serial port
 analogWrite(led,data);
 delay(10);
 
 }
}
Basicly I just want to replace the cable in-between the PCB and computer with someting wireless, Just make it easier when I have to get someone to operate the machince without having a long cable dangling which gets caught sometimes.

 42 
 on: March 07, 2019, 03:26:58 15:26 
Started by Wizpic - Last post by kreutz
Your linked article is about connecting the HC-05 to a PC using RS232 or two PCs using two HC-05 modules, in case of two Arduinos (instead of PCs) you should be connecting each Arduino's TTL output and input (TX and Rx Respectively) to the HC-05's RX and Tx pins respectively (level translation in between is also necessary), so there is no need to the Max232 chips in between.

If you are receiving data (even if not the one you expected) means that there is communication between them (HC-05s). If the serial configuration for both, Arduinos and HC-05, is the same (baudrate, #of bits, parity, Stop bits), they your data being displayed in ASCII mode is due either to your Received byte processing or your Transmitted byte processing code, or both of them. Posting your code would help us to help you find the cause.

In case of your pcb and laptop you will need the RS232 chip between the PCb (or Laptop) and the HC-05 (as well as the level translation between the max232 and the HC-05 because the MAX232 needs 5Vdc Vcc and HC-05 i/o levels are 3.3. volts maximum)

 

 43 
 on: March 07, 2019, 03:07:18 15:07 
Started by Wizpic - Last post by Wizpic
I don't really want to use any micro controller at all I just want a straight wireless RS232 bridge between the PCB below and laptop which runs the software, I'm not sure if this PCB gives TTL signals as it just uses 3 wire serial cable. I was only trying the Arduino way jsut to make sure that the modules where working in sending data beofre I connected/tried on the real set-up, But I have tried it and it does not connect the PCB, This is why I thoguht I'd try MAX232 in-between the HC-05

Here is the link for that web page where they make the wireless RS232 unit

https://eksfiles.net/a-build-it-yourself-bluetooth-serial-interface/

This is why I thought of the Max232 chips. I've attached some pics of the PCB and software to show you what I'm trying to make.
The PCB.


My trail setup was one arduino connected to the master jsut reading a Pot and sending that value to the HC-05 for TX and the RX I just used an FTL232 converter and connected to the slave HO-05, But I only get rubish as I posted above, I will try it with 2 arduinos for TX&RX which I know will work or I can get it to as it should, This is not as easy has I thought but hey I love a chalange.


 44 
 on: March 07, 2019, 12:32:07 12:32 
Started by Wizpic - Last post by kreutz
Arduino inputs/outputs are ttl signals..

 45 
 on: March 07, 2019, 10:23:40 10:23 
Started by Wizpic - Last post by Wizpic
I have done a bit more searching and I'm think  the HC-05 works on TTL signals so I need an Max232 on both side which I've ordered some of E-bay, I seen a on a link which I will put on here later when I get home

 46 
 on: March 07, 2019, 08:09:39 08:09 
Started by Wizpic - Last post by kreutz
You don't need to change the micro. Review your serial receiving code and change it to convert the received data bytes to BCD and then convert BCD to string, check exactly what you are transmitting using a terminal program on a PC. I will look around for an example, but it will take me some time...

See:   http://www.fiz-ix.com/2012/11/arduino-serial-communication-bytes-bases-and-ascii-characters/

 47 
 on: March 07, 2019, 03:10:56 03:10 
Started by zakouska - Last post by pickit2
CountryIndia
Sitenone
NoteProgramming microcontroller, Designing new products
Yes If invited I would only have to mute you again.
so to save time I moved your request here.

 48 
 on: March 07, 2019, 01:46:57 01:46 
Started by zakouska - Last post by plugs
CountryIndia
Sitenone
NoteProgramming microcontroller, Designing new products

 49 
 on: March 07, 2019, 12:39:04 00:39 
Started by Wizpic - Last post by Wizpic
I've tried connecting these modules direct to the PCB and laptop where I want them to work and they did not work, So guess it's back to the drawing board and re-think.

Parmin, kreutz I know what you mean but I really can't use any micro I just wanted to make an RS232 @ 115200 baud to a wireless bridge between the two units. Think I will just have to bite the bullet and buy one

 50 
 on: March 06, 2019, 04:26:59 16:26 
Started by Wizpic - Last post by Parmin
+1 to what Kreutz say.
The data conversion is not sync properly.

Another thing to do is to reduce the baud rate until you have a good transmission.

Pages: 1 2 3 4 [5] 6 7 8 9 10

DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC