Maker Pro
Maker Pro

my first arduino project

martin the warrior

Aug 10, 2015
35
Joined
Aug 10, 2015
Messages
35
To start off with this project is a ways away but I do want to do it. the reason i'm posting it so early is I need to know if what I wan to do is possible will the arduino uno and if not which one would do this for me.. the project is a sensor input to the micro controller the parameters are saved and looked up then displays a message when the parameters are met again. here is a detailed paper on what im trying to do. its long sorry I tired to upload the microsoft word file but every time I went to the folder nothing was in it not even my other stuff. transfer of the information was not very good tried to fix it by editing it but it all went back. but hopefully the jest of it makes sense what im trying to do.


Sensor inputs

(0) condition button - rider input to microcontroller to save the conditions.

(1) Pitch sensor – Analog input to microcontroller says the pitch of bike (uphill, downhill, flat.)

(2) Sitting sensor – digital input to microcontroller says if rider is sitting or standing.

(3) Speed sensor – Analog input to microcontroller says the speed of the bike.

(4) Gear selected sensor – digital input to microcontroller says the currently selected gear.

Sensor sensitivity

Condition button – Digital input on/off

Pitch sensor – 1%

Sitting sensor – digital input on/off

Speed sensor – 0.5 mph

Gear selected sensor – digital input on/off is counted to determine gear selected

Condition parameters

Every time pitch changes by 1% new condition LED will light, if the condition has not been saved before

Every time sitting sensor changes from on to off or vice versa new condition LED will ligh,t if condition has not been saved before.

Every time speed changes by 0.5 mph new condition LED will light, if condition has not been saved before.

Every time gear changes by 1 new condition LED will light, if condition has not been saved before

Saving conditions and saved conditions

Every time a new condition is seen by the microcontroller the new condition LED will light. The rider will then hit the condition button. This will save the condition for further reference by the microcontroller to tell you the best gear to be in.

If the condition light turns on and it is displaying a gear then you can chose to set a different parameter for the conditions. Example if you are going 10 mph sitting with a 1% grade and you change gear from 3,5 (the micro controller selection) to 3,4 you can save this as the new value. However this will only work if the gear is changed if any other variable changes the micro controller will handle this as an unseen condition. When conditions match a parameter the desired gear will display.

Condition graph examples

IF - then light new condition LED - then hit condition button

1= 7% - parameter is saved

2= on <- new parameters

3= 6 mph

4 = 1,6


IF - then light new condition LED - then hit condition button

1= 0% - parameter is saved

2= on <- new parameters

3= 20 mph

4 = 3,5


IF - then light new condition LED - then hit condition button

1= -5% - parameter is saved

2= off <- new parameters

3= 27 mph

4 = 3,7



These are examples of new conditions being saved.

When conditions are saved the micro controller will compare current values to these tables and display the desired gear selection.

When condition is saved graph

When - then

1= 7% - display 1,6

2= on <- saved parameters

3= 6 mph


When - then

1= 0% - display 3,5

2= on <- saved parameters

3= 20 mph


When -then

1= -5% - display 3,7

2= off <- saved parameters

3= 27 mph


This is an example when the parameters are saved in the micro controller. When the parameters match a known table it will display the wanted gear selection.

If you change the gear during a saved parameter read out the new condition light will turn on and you can chose to save the new gear selection for the parameter or leave it. If any other variable changes the micro controller will handle it as a whole new parameter.
 
Last edited:

ADRT

Nov 25, 2014
192
Joined
Nov 25, 2014
Messages
192
It looks like the the UNO will work as far as I/O is concerned. Not sure about program memory though. This program could get quite heavy you may nead a Mega soley for the available program space.
 

ADRT

Nov 25, 2014
192
Joined
Nov 25, 2014
Messages
192
The other thing with the UNO is if your going to use an LCD you would need to use the 2 wire shield as the normal LCD will take up a lot of available I/O space. Again with the Mega that won't be a problem.
 

martin the warrior

Aug 10, 2015
35
Joined
Aug 10, 2015
Messages
35
alright cool thanks. just as long as it is possible like I said this project is a way off. arduino website is out of the uno and mega. is there a good time to buy them before they go out of stock?
 
Last edited:

ADRT

Nov 25, 2014
192
Joined
Nov 25, 2014
Messages
192
I have no idea. I got mine a couple of years ago. They've become very popular. Lot of people using the Megas for DIY drones n stuff like that. Try Radio Shack. Not sure if they cary the Megas but they do cary the UNOs.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Sounds like an interesting project.

Assuming you are talking about a bicycle, not a motorcycle.

Let's calculate how many "conditions" you will need to store.

2 for sitting / standing
51 for 0 to 25 MPH at 0.5 MPH resolution
21 for %grade from 0 to 20
18 gears (or whatever you have)

Multiply all of these together and we get 40698 combinations.

Now, you could probably reduce this considerably, because it is unlikely you could be going 25 MPH up a 20% grade in the highest gear, but basically, you need a lot more storage than an Arduino can handle internally. You will need an external flash memory chip to save your condition data.

And you are missing one sensor. I will not be in the same gear riding 10 MPH with a 20 MPH head wind as I will be with a 20 MPH tail wind. So, I think you need airspeed as well.

Bob
 

martin the warrior

Aug 10, 2015
35
Joined
Aug 10, 2015
Messages
35
(it is a 24 speed bicycle.) is there a way to figure out how much memory ill need? air speed sensor is a good idea. If I can find a cheap MAF sensor that would work it would have to be a low volume since im just a bike and not a car then again it would need afilter since any kind of contamination will throw it off. but a MAF would be most accurate but how can it tell if its a head or tail wind? I guess I could include a switch (1) is head wind (0) is tail wind. hmm its an excellent idea and I will look into it if you a good sensor let me know. there is 51408 combnations since that fits in a 8 bit number 51408*8= 411,264 bytes is 411 KB but im sure that not how it works.
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You take the air speed in the direction of travel and subtract the ground speed. If it is positive, it is a head-wind, negative it is a tail-wind.

Bob
 

martin the warrior

Aug 10, 2015
35
Joined
Aug 10, 2015
Messages
35
ok well like I said this is a project for up the road im not going to get into it right now. I just wanted to know if an arduino could do this and it can. once I get an arduino and the sensors i'll start the project. thanks for your help.
 
Top