Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Android USB to Serial RS232 or Bluetooth

Status
Not open for further replies.
I considered audio injection, via the microphone. The mic is built into the tablet too and unfortunately this one has no audio INPUT jack, just an audio OUT jack for headphones. So i'd have to use a small speaker and mount it right under the mic (which would work) but then i'd have to hear the noise of the data transmission which would sound like a telephone modem :)
I didn't see the model of your tablet; if it has a phone function, it's quite possible that it'll have the microphone (for handsfree) available via the 'headphone' jack. This requires the use of a 4 terminal 3.5mm plug, with the terminal functions being: L aud, R aud, GND, mic OR L aud, R aud, mic, GND.
 
Hi dougy,

Very good idea for sure, but mine happens to be an audio output jack only. Three prongs, for stereo output audio. They even give you a set of ear phone 'plugs' that are stereo.
My cordless phone has this option though so i know what you mean, and i use that with a headset regularly.

Here's a funny idea im not sure how well it would work but...
This Tablet has cameras front and back, so i could set up a 7 segment display and use the camera to read a three digit 7 segment display driven from the microcontroller. Thus the microcontroller would be able to send data to the Tablet in the form of a stream of pictures taken maybe once per second. Big chuckle here haha.
Alternately, a single LED to show a binary 1 or zero (even bigger chuckle here ha ha ha).
 
Very good idea for sure, but mine happens to be an audio output jack only. Three prongs, for stereo output audio. They even give you a set of ear phone 'plugs' that are stereo. My cordless phone has this option though so i know what you mean, and i use that with a headset regularly.
Ok, that's a pity. My mobile phone accepts the standard "3 prong" stereo headphones for calls/music/etc. but can accept the 4-prong plug also (the stereo headphone plug just shorts the mic connection to ground).

Here's a funny idea im not sure how well it would work but...
This Tablet has cameras front and back, so i could set up a 7 segment display and use the camera to read a three digit 7 segment display driven from the microcontroller. Thus the microcontroller would be able to send data to the Tablet in the form of a stream of pictures taken maybe once per second. Big chuckle here haha.
Alternately, a single LED to show a binary 1 or zero (even bigger chuckle here ha ha ha).
Nice idea! That should be a cinch! Just place some fiducials around the displays to allow for location, rotation and scale normalisation. The actual OCR of 7-segment displays should be pretty straight forward after normalisation (if the LED scanning is faster than the camera acquisition time).
 
I've been playing with sensor access too. My type 3 (orientation) sensor is sensitive to magnetic fields, so I wonder if it is an emulated one, with readings (azimuth, pitch, roll) derived from the type 2 (magnetic field) sensor? I had assumed it was gravity-actuated (basically a pendulum of sorts). If your type 3 sensor is like mine perhaps it would be possible to place a coil near it to inject a varying mag field.
 
Hi alec,

I checked mine, and it is not sensitive to magnets being held anywhere near the case. I had to try several areas around and underneath the tablet case. No change in the orientation sensor outputs.

When you did your test how did you determine it was a magnetic sensor? Did you use a small magnet?
 
The solid state accelerometers they use are a capacitive device, and should not be overy affected by magnets.

Maybe the tablet has a magnetic compass? They are becoming cheap and common now too.
 
Hi MrRB,

I checked the sensors and none of them are sensitive to a magnetic field.
Some Tablets have a magnetic field sensor too, but not this one.

If the microphone is dynamic (which i doubt) i may be able to stimulate that with a magnetic field (coil) rather than actual audio, but not sure i want to go that route either as im sure it would still make some sounds.
 
I checked the sensors and none of them are sensitive to a magnetic field.
A mixed blessing.
My tab (Samsung Galaxy Tab 2 7.0) reports that it has a type 2 (mag field) and type 3 (orientation) sensor. But as mentioned above, because its orientation sensor is (surprisingly) affected by mag fields (e.g. if near my laptop speakers or CD drive) I wonder if it may be an emulated one with readings derived from the mag field sensor? I've found the orientation azimuth reading has an error of ~15°, which corresponds to the difference between the magnetic declination in the UK and east-coast US. That may be a coincidence, of course, or it may mean the azimuth was calibrated for US use
 
If I've read you wrong, this might be entirely redundant, in which case I apologise!

I'm surprised you can't use a standard usb-bluetooth dongle for this. Android afaik is closely derived from Linux, and Linux has a really good bluetooth stack. Also plenty of Android devices have bluetooth built in, so it should be a standard part of the OS, though you might have to hunt around and install it for your exact tablet - slight hackery perhaps? There's bound to be USB-A to micro USB-A adapters so you can plug it in and play with it - should be easy to make if there isn't since we all have hundreds of spare USB leads around these days, right?
 
Hi,

dougy:
Yes that would work i think, i'd just have to check how fast i can take pictures within BASIC. Would be a bit of work though.

throbscottle:
Im not so sure it is a matter of it not working, but which one actually works with the Android. I'd want to have a definite "Yes this model works". Maybe one that works with Linus without extra drivers? I have no idea yet. That's the problem. I've read that it works, but you have to have the right bluetooth adapter, and i havent found one. Somebody out there must have gotten this to work already. The ones i looked up dont seem to be made anymore or are not available.
 
I see your problem. I bought a couple of very cheap own brand adapters from Tesco a few years ago to plug one into the printer and one into a laptop, (also meant my wife could print photo's directly from her phone), and they work just fine with every Linux I've had on my laptop since then - they are branded "Technika" (or possibly "Tecnika"). You can just make out the board inside says on it "Toshiba" - so there may be something of use to you there. They just use the standard linux kernel bluetooth driver, so I'm guessing they would be a safe bet if you can get them where you are. I would guess you should avoid something that contains a Connexant chip though, they are not a foss friendly company.
 
If I've read you wrong, this might be entirely redundant, in which case I apologise!

I'm surprised you can't use a standard usb-bluetooth dongle for this.
...

Yeah it's funny hey? The tablet obviously has a USB port capable of megabits per second and everyone is talking about ways to communicate with it by faking clumsy slow sensor signals.

It reminds me of a stone age man setting fire to a cellphone and making smoke signals to communicate to his neighbour; "Me talk cellphone now! UGH!" :D

Which is why this thread is so cool. :)
 
Yeah it's funny hey? The tablet obviously has a USB port capable of megabits per second and everyone is talking about ways to communicate with it by faking clumsy slow sensor signals.
MrRB, the problem is really how to make an Android tablet talk to home-brew gizmos (e.g. using low-end PICs) without having to have a Bluetooth or Wifi module on each gizmo.
 
Hi again,


Yeah he he i guess this thread would look a little funny to someone who was more familiar with the Android and how it works with other things like USB stuff.

And yes im trying to get it to work with a minimal of extra hardware and expense, and a side issue is trying to get bluetooth to work also.

The other viewpoint is power consumption which is always an issue with battery operated devices. Since i am also looking for portability, powering a bluetooth dongle will surely use more power than not using a bluetooth dongle, so not using one would be an advantage there too. But getting one to work in the first place would be a benefit for other things which may include the same apps as not using one at some point too. So really i am considering any options that come up and hoping to get them working.

MrRB you'll get a kick out of what i am thinking of doing next: taking control of my microwave oven. Silly thing has the utmost ridiculous power control setting i've ever seen. I have to hit the "power" button 10 times (yes count 'em, ten pushes) to get to power level 1. All the ovens in the past i hit "power", then "1", and that's it. But not with this one. Well this is another subject that needs a new thread...
 
Post deleted
 
Last edited:
...
Yeah he he i guess this thread would look a little funny to someone who was more familiar with the Android and how it works with other things like USB stuff.

And yes im trying to get it to work with a minimal of extra hardware and expense, and a side issue is trying to get bluetooth to work also.
...

I think the "easy" answer is what everyone said at the start; use a $4 USB-TTL serial dongle, and the standard android driver in the tablet so the dongle emulates a serial COM port. That's how you would do it on a PC etc, and gives you serial comms rates at least up to 115kbaud, possibly >1Mbaud depending which dongle.

But I think the problem that killed that idea was that your BASIC interpreter had no support for serial port?

This must be a common desire for someone using that BASIC software, I would get on to the people that made it or make a fuss on their forum about how important a feature it is. Or maybe use a different BASIC that has serial comms support?

Interesting idea on the microwave controller! :)
 
get on to the people that made it or make a fuss on their forum about how important a feature it is.
Already done. It's on their to-do list :)
 
Hi again,

Yeah i cant wait. It will be a snap for me to use my already built four channel volt meter with the Android if this gets completed. And i wont have to buy anything new either.

Im still curious about the bluetooth adapters though, in case i ever need one for something else for use with the Android Tablet. I'll have to keep an eye open for one that works. Maybe i'll have to take a chance and buy a few? I hate doing that though as it's a waste if they dont work.
 
Some of the bluetooth adaptors and drivers do the same thing, they just emulate a serial COM port.

So if the BASIC people add that COM support to their software you should get the same functionality from a bluetooth module, but probably lower datarate than the wired USB device.
 
Hi MrRB,


Right now i can get away with say 100 baud, as i dont need really fast updates. In the future however i may need much faster, but i'll worry about that then :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top