StromTrooper banner

21 - 40 of 181 Posts

·
Registered
Joined
·
2,492 Posts
Discussion Starter #21 (Edited)
Design thoughts - measuring a 12V battery

OK, I'm going to change what I wrote before about voltage dividers - bad idea. :thumbdown:
It is OK with a small 9V battery (my background is with low voltage and amperage), not with a 12V motorcycle battery..don't want the circuit to get fried.. or get me fried! :yikes:

Did some research, and found that the advised solution is using an opto- coupler.
Opto-isolators: An introduction to using them with microprocessors- ec1optoiso

A recommended IC is: MCT61-ND
http://www.fairchildsemi.com/ds/MC/MCT6.pdf

It seems simple enough.
High Voltage: Anode-Cathode go to battery (+ and -).
Low voltage: Port of the AVR connects to Emitter and Collector is grounded.

From what I understand one needs to add an input resistor (10K ohm), output resistor (10K or 4.7K ohm). Input and output resistor are current limiters. A diode is not needed as this is DC not AC.

See method 2:
http://www.arduino.cc/playground/uploads/Learning/Level_shifting_4_arduino.pdf

That been said..I'm starting to think that an Opto Isolator is the way to go also for the gear position indicator connector - this way there is no way the motorcycle's circuit can be mixed with the Mk1B circuit.
It is basically a DC-DC isolation and protection, given the high ampers that can be produced by the bike, and given that the ECU can be harmed otherwise due to potential reverse current.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #22 (Edited)
Mounting - design

My current thoughts of mounting is using option 2 - the center of the handle bar, using the RAM system.

There are three pieces:
1. RAM Mount Motorcycle Handlebar Clamp

ram-b-367u

RAM Mount Motorcycle Handlebar Clamp RAM-B-367U, RAM-B-367U

(Image seems to be actually on a v-strom.. ;) )


2. RAM Mount Aluminum 1.75 inch Short Length Dual 1.0 inch Socket Arm
ram-b-201u-a

RAM Mount Short Arm B-Socket RAM-B-201U-A, RAM-B-201U-A



3. RAM Mount Aluminum AMPS Plate with 1'' Ball and Roadmate Hardware (Plate that is screwed to back of plastic enclosure)

http://www.gpscity.com/ram-mount-universal-hardware-and-amps-plate-ram-b-347-g1.html

ram-b-347-g1

 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #23 (Edited)
Design - Electronic Enclosure/Case

Following advice from good fellow stromtroopers, I figured that I need to look for 'Electronic Enclosures'.. :mrgreen:

Found this case: 715K-ND, $3.03
Digi-Key - 715K-ND (Manufacturer - 715)

Also comes with optional covers - The phenolic cover looks pretty cool. $2.27
Digi-Key - 2050K-ND

 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #24
Passed 'Point Of No Return'

That's it..just made the first order from Digikey for the prototype.
No more design - time to implement!
All the parts and solution are fully figured out in the mind, now need to transfer it to reality.
I hope I get this project done quickly, and not screw up/get stuck :)

I'll start with small incremental steps ('success oriented') and try to document and photograph the stages.
 

·
Registered
Joined
·
9 Posts
Bigman: I have been brewing up a response to your comments on optoisolators and will send it soon. There are a few outstanding points on that front. I'm still abroad and up to my eyeballs, but will catch with you when I get stateside next week.

happy building!
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #26
Bigman: I have been brewing up a response to your comments on optoisolators and will send it soon. There are a few outstanding points on that front. I'm still abroad and up to my eyeballs, but will catch with you when I get stateside next week.

happy building!
@fess: sure, let's talk. Actually if you have some time I need to consult with you on the subject of SMPS (Switched-Mode Power Supply).
I have some worries that the electrolyte capacitors will dry up..people on internet forums are so confusing. you ask them one question and get another 3 unrelated answers..
I asked about LM2574 component and was told to use LM2940. Then some other people say that LM2940 is not good. 10 people 50 opinions.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #27 (Edited)
Note on SMPS

Got some help from the good folks on other electronics forums, one of them rides a Honda Shadow! and he was most helpful guy :), of course.

Decided to go with LMHV2574 - The High Voltage version.
It seems motorcycles/automotive can have volt spikes of 60V.
It is very different than designing a power supply for a typical house gadget.

Pretty darn expensive just for a DC-DC power supply - ~$11, but I'm quality driven here.

Here is the diagram from the data sheet:
From left to right - Unregulated DC (12-60V) comes in, Regulated 5V comes out.

 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #28
Some progress..finally..

Thanks to the ugly 'Irene' I managed to get some work done, until she cut my power today at noon. :thumbdown:

My 60V->5V automotive voltage regulator is producing 3.5V instead of 5V, but that is because the breadboard is not suitable, even for a prototype. A PCB is needed - the breadboard has too much resistance and causes the feedback mechanism to go south.
So I got a generic PCB from RadioShack, but it will take more time.

In the mean while, I taught myself how to program the I2C protocol - it is pretty straight forward and works great.
Started with an I2C IO Expander chip (not part of this project) just for testing using my Lego NXT. Next I'm going to hookup the temperature I2C chip and the I2C DAC/ADC chip (I plan to simulate the gear volts with it and also measure volts until I get the final microcontroller instead of the NXT).

I also prepared the wires for the LCD display, it too will be hooked up soon using the I2C protocol. My first text would be "Hello V-Strom" :)

 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #29
More progress - temperature sensor working

Got the digital temperature I2C chip to work!
It was much easier than I thought it would be.

Here is a video of the original tests I did, with NXT and I2C (not in the original project, but I'm thinking of adding buttons as user interface so the PCF8574 chip is a good emulator..):
Video: PCF8574 I2C Prototype

And here is the temperature sensor working, it sounds like an ER because I put a beep for debugging, so I know when the NXT is sampling.
I used the lamp to heat up the temperature sensor for testing purposes - the video clearly shows the warming up and then cooling down.
Temperatures come out of of the sensor in Celsius, but converting it to Fahrenheit is just adding two lines of code.

Video: Temperature Sensor Prototype
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #30
And more progress - DAC/ADC I2C chip working

I managed yesterday to connect to the PCF8591 - basically it means I can emulate the motorcycle gear position by generating an accurate 'virtual' volt level.
This would allow me to test how the system works with gear changes without actually connecting it to the real bike voltages.
Technically this is the way to create a TRE if I wanted to do so.
I can simply supply voltage to the ECU using this mapping table:
N -> Volts of N
1 -> Volts of 4th
2 -> Volts of 4th
3 -> Volts of 4th
4 -> Volts of 4th
5 -> Volts of 4th
6 -> Volts of 4th

Therefore tricking the ECU to think that it is either in 4th gear or in Neutral..I don't see much value in doing so on the DL650 (It seems that the engine is not powerful enough to make advantage of that).
But this is how a TRE works in theory. Why some vendors charge so much for such a simple device and also decorate it with fancy marketing BS is beyond me.
 

·
Premium Member
Joined
·
2,231 Posts

·
Registered
Joined
·
2,492 Posts
Discussion Starter #32
This is kinda late in the game (I didn't see this thread until today), but I posted about a kindasorta similar project a while back: http://www.stromtrooper.com/techy-world-gps-electronics-etc/55212-awesome-diy-voltmeter-temp-gauge-gps-lo-jack-cell-phone-lean-angle-scooterputer.html
It's not the same set of functions but there is some overlap. Also this project was quite a bit more expensive than yours. Maybe there's some useful info for you in there somewhere anyway.
Great link!
Yes, it is very similar, and I intend to learn from that project for sure :thumbup::thumbup:
My approach is a simpler and cheaper one (key for success of products), I'm looking for less functionality, that guy went for a full blown solution.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #33 (Edited)
@GoldenMoney:
After reading a bit more of that project I have some reservations:
1. Power supply - I do not think that it was designed properly for automotive usage. The linear voltage regulator is not a reliable or stable solution, and it generates quite a lot of heat. I have consulted with other people that have more experience, and this regulator can easily get destroyed in automotive usage.
The developer took a lab regulator assuming the input voltage is around 12V, but in fact it can go up to 60V.

2. Overly complex - Connecting to a GPS chip is nice to have for data logging purposes, but otherwise it is pretty much useless. The problem with GPS is not hardware but software. Garmin and TomTom have put incredible amount of effort in generating software that shows maps and routes calculation.
Having longitude and latitude is just not useful, and it is also available on most GPS devices.
I have a good GPS and never planned to replace it.
The Mk1B is an addition.

3. Display of things nobody really needs:
* Speed - nice to have, not needed at all. The bike has speed display (with 10% offset) and the GPS has actual speed displayed. Why would anybody need a third display?
* Lean - who is going to watch the lean while taking a corner? It is not just a not useful feature but a security hazard.
I can see how it can be used for data logging, but for display? I know what the lean is because a. I feel it and b. the horizon is the best lean meter
* Time and date - The V-Strom has time. The date is really not needed, I have an android for that with a full calendar.
* ODO - V-strom has full functionality - not needed

4. Design is not open - The solution does not seem to be designed with an open architecture.
On that solution if somebody wants to change the display it would require a re-design of the hardware and software.
I wanted an open architecture, hence the usage of I2C components only (MCU, Display, Sensors, etc.)

5. Touch screen - a nice to have feature, but on a motorcycle it can be quite annoying. First it has to be capactive, not resistive, to allow usage with gloves.
But the main point here, is that I do not see the great advantage of touch screen for a read only display module. A few buttons are much more robust and can accommodate for some simple data entry.
The Garmin Zumo has large and easy to use buttons - I find it a good user interface (costly device, but that is another story).
There is another philosophical design aspect - I come from a 'school' of minimal user interface. Having buttons means that you have modes - modes mean that the product is poorly designed.
Read more about this: Jeff Raskin, the Humane Interface
The Humane Interface - Wikipedia, the free encyclopedia

5. Inefficient design -
There is usage of an AVR Arduino Development kit as the main board for 'production'.
While this works, it is not really needed. The AVR MCU is much smaller and doesn't need the whole development stuff that comes in the development kit.
Also the solution comes with two parts:


I want one small unit that has everything contained in it (All-In-One).

7. Measuring the battery level the way it was done in the project (in respect to high voltages of automotive usage) makes me think that the MCU will blow up at some point due to high voltage.
There is a difference between measuring a 9V battery in the lab, and measuring a very strong 12V 30A battery in the 'field'.
It could be a safety issue, maybe one that can lead to fire.
The AVR is using low amps with 5V or 3.3V so no much harm can done.
But connecting to high amps must done with extreme caution. One short and the battery discharges .. not good! :yikes:

8. Cost - As a direct function of the above: in particular complex design, showing things that nobody needs and inefficient design, the cost of the unit would be way too high for most people to build it as DIY, not to mention purchase it as a product.
History shows that cheap and reliable solutions work better than expensive and complex - For example: VHS over Beta.


I typically design things to be robust and functional, if possible 'military grade' that will last for many years.
I think the main problem with that design is Form-Over-Function instead of Function-Over-Form. It looks cool and all, but it lacks on some critical functional aspects.
 

·
Premium Member
Joined
·
2,231 Posts
I think the main problem with that design is Form-Over-Function instead of Function-Over-Form. It looks cool and all, but it lacks on some critical functional aspects.
I agree with all your points, or at least the ones I understood. Just thought there might be some benefit to seeing another solution.
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #35 (Edited)
I agree with all your points, or at least the ones I understood. Just thought there might be some benefit to seeing another solution.
Thanks, and please don't get me wrong - I appreciate your help, any cross references are helpful.
I was just applying some critical thinking.
There are some really interesting parts in that implementation - the enclosure for example.

Currently I've exhausted the prototype options I have with the Lego NXT, and must move to a real AVR microcontroller.
I'm going to get an AVR Development Kit (e.g. Arduino Uno), but am going to eventually use a stand alone AVR chip without the full size kit (unlike the author of the other solution did).
I'm currently thinking of the ATtiny2313.
It is small and simple (and cheap).
I can start with it, worst case I can always move to the bigger and more complex ATmega168.
 

·
Registered
Joined
·
1,856 Posts
I think I found a good candidate for the LCD Module (16x2):

16x2 Character LCD - Serial I2C/SPI/RS232-TTL [16x2 Serial Blue] - $24.00 : FunGizmos, make something fun!
UPDATE: Found a similar module for $20 (green background) at DigiKey


This LCD Module fully supports I2C, and seems pretty easy to program.
Not too expensive.

Also, I plan to use my Lego NXT 'brain' module for the prototype instead of using an AVR MCU.

The Lego NXT has A2D and also I2C support.
I have used a Basic Atom microcontroller for many projects... it has built in AD inputs and it will easily do what you want for about $50 US... Easy to program in Basic and has a crap load of sensors as such for it...


Richard
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #37
I have used a Basic Atom microcontroller for many projects... it has built in AD inputs and it will easily do what you want for about $50 US... Easy to program in Basic and has a crap load of sensors as such for it...

Richard
Hi Richard,
My days programming Basic were done 25 years ago :)
I quickly moved to Assembly, Pascal, C, Object Oriented pascal, C++ then C# and Java. Basic is my least favorite language.

For serious real time I would consider assembly or C. Assembly has many advantages since it is the closest to the machine code level, but C is the obvious choice. There are so many libraries available in C, for any given problem.

I have decided to go with the AVR family for several reasons (was considering PIC as well):
- It has the biggest and strongest community of developers
- It seems to have the best development kits (=boards) and IDEs
- It scales very nicely; you can start with one small chip and move to another much stronger chip with minimal effort
- They are cheap, fast, reliable and simple to use

But thanks for the offer!
 

·
Registered
Joined
·
1,856 Posts
Hi Richard,
My days programming Basic were done 25 years ago :)
I quickly moved to Assembly, Pascal, C, Object Oriented pascal, C++ then C# and Java. Basic is my least favorite language.

For serious real time I would consider assembly or C. Assembly has many advantages since it is the closest to the machine code level, but C is the obvious choice. There are so many libraries available in C, for any given problem.

I have decided to go with the AVR family for several reasons (was considering PIC as well):
- It has the biggest and strongest community of developers
- It seems to have the best development kits (=boards) and IDEs
- It scales very nicely; you can start with one small chip and move to another much stronger chip with minimal effort
- They are cheap, fast, reliable and simple to use

But thanks for the offer!
Wasn't trying to insult your intelligence... Just that for me you don't need a sledge hammer to kill a mosquito... It's a simple project so I would use a simple solution... A simple to understand and simple to program mircro controller... AVRs and Pics are an excellent choice too... and cheap...
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #39
Wasn't trying to insult your intelligence... Just that for me you don't need a sledge hammer to kill a mosquito... It's a simple project so I would use a simple solution... A simple to understand and simple to program mircro controller... AVRs and Pics are an excellent choice too... and cheap...
That's 100% fine..no offense taken :)
Just that C is so simple (for me), I feel at home.
With Basic variants (Basic not a standard Ansi language) I get lost every time due to non-standard language features and lack of proper documentation, so the code gets complicated due to 'workarounds'..
I mean, try building a proper real time ISR in Basic, compared to C.

AVRTiny is pretty simple, no?
 

·
Registered
Joined
·
2,492 Posts
Discussion Starter #40 (Edited)
AVR and programmer choice

Fess is joining the effort, which is great.

I have some thoughts of the choice of AVR chip and also the programmer for it.
I prefer to go with the AVR Tiny, which is small, cheap and simple to program. Arduino will not program it.
AVR Mega is great too, but it is too big.

I need to get the AVR MkII Programmer.
So then ... why do I do need an Arduino?..well I don't.

Any comments on this subject, from people who worked with AVR is more than welcome.
 
21 - 40 of 181 Posts
Top