Pages: [1]   Go Down
Author Topic: Arduino Android bike computer  (Read 1562 times)
0 Members and 1 Guest are viewing this topic.
Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

I have decided to pursue the following project:

I want to implement the following controller using an Arduino Nano, that I bought

https://github.com/jenkie/Arduino-Pedelec-Controller
http://www.pedelecforum.de/wiki/doku.php?id=elektrotechnik:forumscontroller#downloads

Instead of the Nokia 5110 display most people are using, I would like to use a water resistant Android device.
This would have various advantages over using the Nokia display or other displays available for the Arduino, the most important being that no nice looking waterproof cases are available for the price it would cost to buy used Android phone like the Motorola Defy.

The biggest problem is, that I have zero programming experience. I have a very good idea, of what I want to accomplish.
In a first step the Android device is only supposed to do readouts from data the Arduino produces.
I would prefer to use a USB connection, but if you think bluetooth is easier, I will go for that.

This is, what I would like the app to look like:


I would like to start with readouts from temperature, voltage and current sensosors and the reed switch from the the bike's speed sensor.

I am in need of a lot of guidance, where to begin and what to learn.
There is already code available for the readouts of the sensors. The key task is to somehow make the connection between the Arduino Nano and the Android device and getting it to display the information in the right way.

I would then like to increase the amount of sensory readouts the phone can handle and make the individual fields modular with options to cycle through for each of them.
Then I would like to implement throttle control for the bike's electric motor and a cruise control.

Any advice and guidance on how to pursue this project would be greatly appreciated.
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Since the Android device will need to run some kind of app to know how to talk to your sensors (via the Arduino) then it's possible you can get through this with Bluetooth (say) and something you create using one of the free online app writers for Android, for example the MIT App Inventor.

I'd certainly start looking in that direction for the front-end part of it.  What you do at the Android end will largely determine what communications you need to provide from your Arduino.

Cheers ! Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Greetings to the other side of the world ;-)

The link seems to be a platform, where you can store apps you're designing, but it doesn't really help me, in getting started :-(
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The link seems to be a platform, where you can store apps you're designing, but it doesn't really help me, in getting started :-(
Yes it's a place where you can write simple apps for Android, then load them onto a device.  Unfortunately (or fortunately) by choosing an Android device as your display you're going to have to learn how to program both the Arduino and Android ends of your project.  Using the Nokia display your Arduino will be talking directly to the electronics of the screen - using Android you're asking it to communicate with another computer so it's a little more involved.

Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, I get that.

Most of the Arduino stuff is done already.
If you look at the github page and the wiki I provided, you'll see that almost everything on the arduino has been done already.
So I have to learn how to adapt it to Android and get the readouts there.

Could you maybe help me with the first little task of reading one "DS18B20 Digital Thermometer +/- 0,5 °C TO92 1-wire" and getting the temperature displayed via USB on my computer.
Maybe that'll help me gain some basic understanding of how to take readings and display them. I have attached the sensor to the controller board as desribed in the wiki on J4, which means A3 has the signal from the sensor.


Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you maybe help me with the first little task of reading one "DS18B20 Digital Thermometer +/- 0,5 °C TO92 1-wire" and getting the temperature displayed via USB on my computer.
Maybe that'll help me gain some basic understanding of how to take readings and display them. I have attached the sensor to the controller board as desribed in the wiki on J4, which means A3 has the signal from the sensor.
Hi

As per the wiki article, J4 is an analog connection.  That would be appropriate for something like TMP36, LM335 or LM35DZ temperature sensors - you can read up more on how they're used in this article at Adafruit.

The DS18B20 is a digital sensor, using the one wire bus so you won't get a reading out of it connected that way.

Have a read of how the One Wire bus works and you'll have more success.  One of the examples on that playground page link above will also output the temperature reading to the Arduino serial monitor on your PC over USB.

All the best, Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

0
Offline Offline
Sr. Member
****
Karma: 3
Posts: 268
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For programming the android I would start with this:
http://www.youtube.com/course?list=ECB03EA9545DD188C3&feature=plcp

It brought me up to speed pretty quickly.  Just work your way through all of the videos.  Don't just watch the video.....actually work right along with him on your own system duplicating everything that he does.
Logged

Arduino Uno;
Mega328

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot. I will take a look tomorrow :-)
Logged

Bavaria
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you maybe help me with the first little task of reading one "DS18B20 Digital Thermometer +/- 0,5 °C TO92 1-wire" and getting the temperature displayed via USB on my computer.
Maybe that'll help me gain some basic understanding of how to take readings and display them. I have attached the sensor to the controller board as desribed in the wiki on J4, which means A3 has the signal from the sensor.
Hi

As per the wiki article, J4 is an analog connection.  That would be appropriate for something like TMP36, LM335 or LM35DZ temperature sensors - you can read up more on how they're used in this article at Adafruit.

The DS18B20 is a digital sensor, using the one wire bus so you won't get a reading out of it connected that way.

Have a read of how the One Wire bus works and you'll have more success.  One of the examples on that playground page link above will also output the temperature reading to the Arduino serial monitor on your PC over USB.

All the best, Geoff

Why do you think the pin being a analog one is a problem?
The way I understand it, all Arduino pins can be used as digital in/outputs and some can additionnally be used as analogue ones.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 3988
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All the I/O pins work for digital I/O. Even reset function can be turned off to get an I/O.

Logged

Examples can be found in your IDE.

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why do you think the pin being a analog one is a problem?
The way I understand it, all Arduino pins can be used as digital in/outputs and some can additionnally be used as analogue ones.
That is entirely true.  However what I was calling out is a reason yours might not be working as that is a fundamentally different temperature sensor which also needs the resistor to setup the one wire bus.  

If you connect it and try to talk to it with the same code it will not work. It's not an Arduino issue.

Apologies for the confusion, Geoff
« Last Edit: October 27, 2012, 04:21:11 pm by strykeroz » Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Pages: [1]   Go Up
Jump to: