Is it possible to use Arduino 2560's serial/USB communication without Arduino bootloader? - arduino

I have an Arduino 2560 and would like to send serial data to my PC. However, I am currently not using the Arduino Bootloader because I wanted to use a program that I wrote for an Atmega644 before (as far as I understood, one has to use the Arduino language when using the Bootloader?).
Does anyone know if what I am trying to do is possible with reasonable effort?

Connection to PC via 2560's serial0 does not depend on bootloader (if you plan connection when main program is running). You need 16u2 running to bridge 5V serial UART to USB or you can of course use any other option (e.g. MAX232 or so) to convert 5V UART to USB or RS232. But in case of RS232 double check baud rate error because of 16MHz crystal for particular baudrate.
2560 bootloader just implements firmware flash.

Related

Sending Data from Arduino to Android using Bluetooth

I am trying to do a project based on arduino and Android in which I want to use ultrasonic sensors and Bluetooth module hc-05 . I want to detect any obstacle using ultrasonic and send it's distance to Android app using Bluetooth. I am completely new to arduino and have never used it before . How could I connect both the Bluetooth and ultrasonic sensor to arduino uno board without using breadboard? Is it possible to connect both of them without using breadboard and just the jumper wires?
You can connect the Bluetooth Module and Ultrasonic Sensor with jumper wires directly to the Arduino.
Depending upon the Ultrasonic Sensor you are interfacing, there must be a library or a sample code. You can tweak the code to get the distance in your desired format or variable.
As far as the Bluetooth is concerned, you can operate it at 3.3v or 5v depending upon the module you use. Most of the Bluetooth module support both 3.3v and 5v - as they have voltage regulators on their break out. I have used these and they work on 3.3v as well as 5v
For instance, check the Bluetooth HC - 05 Module in the below link :
http://www.amazon.in/Verve-VTA009-Bluetooth-Module-HC-05/dp/B00S15XTG8?tag=googinhydr18418-21&tag=googinkenshoo-21&ascsubtag=7a58e842-4c10-40bf-a48f-339edef372a7
For implementing the Bluetooth communication, prefer using the Software Serial. If you connect the Bluetooth HC 05's Rx and Tx to the Arduino's Hardware UART Pins, there can be unpredictable results. I have experienced that using HC05 with Software Serial is reliable. Additionally, you can use the Serial Monitor to debug your code at the same time. I mean, you can send the same data on Software Serial and the Serial port and check if things are as desired.
You can implement, the HC-05 Software Serial at 9600 baudrate. 9600 is the default baudrate on most HC 05 Modules.
For developing the Arduino code and testing it, you can use a terminal client like PuTTY on you computer. You need to establish a bluetooth connection between your computer and HC 05.
HC-05 runs at 3.3V, make sure you do level conversion from 5V to 3.3V using a zener diode. Or buy a level converter if you are new to electronics. If you don't, there is a good chance you will blow up the HC-05. If you could add a photo we can see if its already done on the Bluetooth module, then you need not worry about level conversion
HC-05 is basically a wireless serial port over bluetooh. On arduino create a software serial post using the library SoftwareSerial and send the sensor data to that serial port
There are libraries available for popular HC-SR04 ultrasonic sensor, if that is the sensor you are using.
For testing on android many app are availables like Bluetooh Terminal, you can receive the data sent from arduino.
Yes the whole project can be done without breadboard using connecting wires.

Atmega328p sending data through USB

I'm using the atmega328p and I would like to send data through the USB to use like the serial monitor in the arduino for code testing purposes, so I doesn't need an LCD to print data. I used USART when simulating my code in proteus, and I believe there is a similar approach using the data pins of the USB connector.
When you send data over the UART on the ATmega328, it is converted to serial over USB by the Arduino. The Arduino will enumerate as a virtual serial port on your computer, and you can connect to this with the serial terminal of your choice (screen, PuTTY, RealTerm, etc). The Arduino IDE also has an built-in serial monitor. Note that you cannot use this serial connection while programming the Arduino via the USB port, as it will interfere with the programming.
If you are using the hardware UART for other purposes, then you can use an external TTL serial-USB converter and SoftwareSerial on the Arduino.

Use Arduino board as regular AVR microcontroller

I want to use ATmega2560 MC, but it manufactured only as surface mount IC which means i must make PCB to use it. I searched for a per-made kit and found Arduino Mega R3 board contains the desired MC. (It contains less I/O pins but that's OK for now). Can i implement my code (without any arduino code) in this board? or should i modify it to work with Arduino, also if it runs in the board will it be the same as normal IC or there will be differences in speed.
The MCU in the Arduino Mega2560 is a stock ATmega2560. There is no need to use the Arduino libraries to program it and no need to use the Arduino tools to communicate with it; avr-gcc and avrdude will work with it as normal. Note that you will need to select the appropriate programmer/protocol in avrdude for the bootloader programmed on the chip if you want to program it via serial rather than ISP.

Is it possible to use both external power jack and USB port with Arduino?

I have the Arduino UNO board and I want to know if it is possible to use both the USB connection (for exchanging data) and the external jack to power supply it.
I will use the following cable: http://ecx.images-amazon.com/images/I/41OMXaj5cPL.SY355.jpg with a AC-DC 5V adaptor in order to power supply the Arduino. However, I want to use also the USB connection in order to send some data from the computer.
Both will be connected at the same time.
In short, I want the Arduino to be able to run even if the computer is OFF and whenever I open the computer to send data to Arduino from USB connection.
Is this possible? Will the Arduino Uno board support it?
Yes. From the official Arduino website:
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External DC power will override USB power if the Arduino detects it. [Source]
as other said, it is absolutely possible to have both usb and power jack plugged in.
but be aware that if you shut down your computer and turn it on after, when reading the usb port you'll restart the Arduino and might loose important data.
yeah both of them can be used. If you want to upload the code in arduino then simply use the usb cable otherwise keep it on adapter. it wont harm the device.
What I personally do is, I keep on plugging the adapter and remove the usb once I am done with uploading and then test it as normally the usb cable is quite small and I normally work on robots so I need long wires.
if you want just plugs it in, it's ok but Arduino board will chose one and usb has priority to other power source.
********* Very important :*****
if you are controlling other circuits, that are connected to an external power supply, with your Arduino and connecting it to your PC's usb, Arduino will have potential difference and it will cause current flow that will damage your PC and Arduino board. if you want to do such thing, you have to shield your Arduino board from your other circuits that you want to control and they have external power source. this could happen with optocouplers for digital ports, non signal analog ports with shield relays, and complex analog circuits for analog signals

What happen when use rs232 instead of usb in arduino?

I just start a project which is very basic actually. But I need an information. It is about arduino serial communication. Here is the question.
If I connect arduino to computer using TTL to RS232 converter without USB cable then can I still use serial monitor to get some data or what happens ? Assume arduino is programmed before using usb cable, and it is powered externally when usb is not used.
for instance the code just
Serial.println("It is working");
delay(1000);
Thansk a lot.
you will fry it. Standard RS232 use a +-12V level, while arduino use TTL level (0-5V), so you still need a RS232 -> RS232TTL converter. If you use it, then using virtual serial over USB or real hardware serial is exactly the same, except that hardware serial port never appear/disappear when you plug in the arduino (there is not something like plug'n'play in rs232, it is always plugged)

Resources