Diccionari.cat
Optimot, consultes lingüístiques

Digital Tachometer for Harley Davidson Sportster (Part 15 - Issues during development and improvements)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Issues:

  • First and main issue was.. how the hell do I make this project?! It was my first electronic project and I had to think & plan basically all the steps (quite stressful).
  • The J1850 VPN trasnceivers were discontinued and not available in the main online electronic stores. Luckily, I was able to find 3 IC on eBay and I was able to build my first dummy control unit that was broadcasting messages all the time on the data bus. For the final design I manage to replace the IC by a couple of transistors and resistors.
  • The lack of experience when soldering electronic parts and in particular SMD components. I lost 2 PCB on the way but I learnt the lesson to start always by soldering the most difficult components first.
  • I suffered many times problems on the PCB, usually due to my poor soldering skills that created micro joint cracks. I spent sometimes weeks trying to find the rootcause and that caused many times to loose hope.
  • Poor test & lab equipment, for example a computer 12V fixed power supply to simulate the battery of the bike. Anyway, I have to say that even with some basic equipment if you want to do something you can do it. With time I manage to buy a decent soldering station, a decent multimeter, scope, ….


Improvements:

  • The software still has some minor glitches that I don’t care to solve. For example, from time to time some number that should not be there appears on the gear indicator, but as fast as it comes, it goes away.
  • Need to implement the fuel consumption function on the tachometer.
  • Brightness can be increased or decreased by user request, except for the gear indicator that is fixed and it could disturb at night.
  • All the LEDs used on the RPM bar or on the mode indicator can not be seen when driving at daylight.
  • When the sun shines from the rear of the bike, it is not possible to read the 7 segments (even with full brightness).
  • Rear switch does not perform as expected sometimes. The connector should be improved.
  • 3D printed housing could be improved in many ways. It does not have a PCB fixing tab, only a position tab. Also it could be improved the hole on the back of the housing to avoid/reduce humidity entrance.
  • Design and print a vinyl for the tachometer cover. Currently, it has a printed paper that is now deteriorated due to the humidity and the sun.


Any other question or request, please leave a comment below or send me an email. Salut

Content: Homemade Digital Tahcometer for Sportster. Source: Momex.cat

Project index:
Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Digital Tachometer for Harley Davidson Sportster (Part 14 - Final result and videos)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Finally!! here you have some images and videos of the project.

Content: Digital DIY Tachometer for Harley Davidson Sportster. Source: Momex.cat
...Read more

Digital Tachometer for Harley Davidson Sportster (Part 13 - Wiring harness and installation)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Once we have the PCB, the housing and the bracket, now we “only” need the harness. There are a thousand ways to connect the PCB to the 3 wires that will allow it to operate (12V, Ground and J1850 data bus). We can choose the cheap option (3 wires from the PCB to some part of the harness) or the expensive one (ref# 68811-07 HD harness that comes with the tachometer ref#67182-07).
Let’s go first to take a look on the schematic (spedometer side) to understand what do we have there:

Content: HD Sportster schematic. Source: google

As you see, there is a harness that goes from the speedometer through the 39A/B connector to a subharness and from there to the HD main harness through the 20A connector. This connector is located just under the fuel tank, as seen in the following pictures.

...Read more

Digital Tachometer for Harley Davidson Sportster (Part 12 - Housing design and brackets)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Following list will summarize the parts included on the housing and bracket assembly for the speedometer and tachometer:

1-Dual gauge bracket (ref#: 67338-97) (seen on Part5)

Content: HD bracket 67338-97. Source: eBay Content: HD bracket 67338-97. Source: eBay Content: HD bracket 67338-97. Source: Momex.cat
Note: It is important to take care of the gauge "rear horns" that are used to center and fix the position of the speedo and tachometer. The housing used for the tachometer will need to have a specific space to fit correctly.


2-Gauge cover and glass from an old analog speedometer: In order to avoid humidity issues I will reuse the gauge cover from an old analog speedometer bought some time ago to get some ideas for this project.

Content: Gauge cover from an old analog speedo. Source: Momex.cat

3-3D printed housing:
Following design has been done with FreeCAD v0.15. According wiquipedia, FreeCAD is a parametric CAD 3D design tool. It is opensource (GPL and LGPL license) and focused in mechanical engineering, industrial engineering and architecture. It is available for Ubuntu by typing the following command:

sudo apt-get install freecad

It can not be compared with other professional CAD tools, but FreeCAD offers enough resources to allow the design of complex models. The housing, as you will see, is quite simple and as beeing my first 3D printed design I feel quite satisfied. The design can be summarized in 5 steps:

3.1- Exterior part: In workbench “Part Design”, we will create a sketch on the X-Z and will draw the shape of the housing. Afterwards, with the option revolve, we will be able to revolve 360º in order to have the basic housing shape.

Content: Creation of the 3D model tachometer housing. Source: Momex.cat Content: Creation of the 3D model tachometer housing. Source: Momex.cat
...Read more

Digital Tachometer for Harley Davidson Sportster (Part 11 - Source code and libraries)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

Once the code is uploaded to the new Github repository (DIGTACHO), in this post I will try to summarize all the important parts of this project. As seen below, 4 subgroups have been defined in order to categorize each one of the programming files:

Generic libraries

  • cdefs.h
  • inttypes.h
    Note: Other libraries needed to compile this project such as p18f2553.h, timers.h, string.h, usart.h, stdio.h, pwm.h are already included in MPLAB software and that's why they are not included in this subgroup.

SAE J1850 related functions

  • j1850.c
  • j1850.h

MM5450 driver related functions

  • MM5450.c
  • MM5450.h

Main

  • macros.h
  • main.c

In theory, all the files should have english comments to explain what is the code doing. Nevertheless, I will try to write a short explanation of what I think are the most interesting / important parts:

Interesting code in j1850.h

Timming definition and the function used for configuring PIC Timer0 according to SAE J1850 protocol.

// define J1850 VPW timing requirements in accordance with SAE J1850 standard
// all pulse width times in us 
// receiving pulse width
#define RX_SHORT_MIN	us2cntT0CON8(34)      // minimum short pulse time
#define RX_SHORT_MAX	us2cntT0CON8(96)      // maximum short pulse time
#define RX_LONG_MIN	us2cntT0CON8(96)      // minimum long pulse time
#define RX_LONG_MAX	us2cntT0CON8(163)     // maximum long pulse time
#define RX_SOF_MIN	us2cntT0CON8(123)     // l'he posat a 153 (abans 163) minimum start of frame time
#define RX_SOF_MAX	us2cntT0CON8(279)     // l'he posat a 249 (abans 239) maximum start of frame time
#define RX_EOD_MIN	us2cntT0CON8(163)     // minimum end of data time
#define RX_EOD_MAX	us2cntT0CON8(239)     // maximum end of data time
#define RX_EOF_MIN	us2cntT0CON8(239)     // minimum end of frame time, ends at minimum IFS
#define RX_BRK_MIN	us2cntT0CON8(239)     // minimum break time
#define RX_IFS_MIN	us2cntT0CON8(280)     // minimum inter frame separation time, ends at next SOF
...Read more

Digital Tachometer for Harley Davidson Sportster (Part 10 - Prototypes evolution)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

On this section, I will show the different parts of this project and the evolution on each step. As you will see, on every step I used different prototype platforms and I will explain its pros and cons.

Protoboard

All and each one of you have had a protoboard in your hands when you started to built simple electronic circuits. I did the same and the first prototype was built with a protoboard I had on my drawer. So, I started by lighting a LED with a PIC, then multiplexing a LED matrix, creating a data bus, interruptions, etc…
Pros: Immediate availability when trying to test new circuits.
Cons: You can suffer from bad connections (intermitent connections, disconnections, shorts,…) that can lead you astray and kill your desire of building something bigger. You can easily waste hours or days just because a simple cable was having a bad connection. I would not recommend it for complex circuits.

Images

Content: Initial Protoboard. Source: Momex.cat Content: Protoboard with power supply and oscilloscope. Source: Momex.cat Content: wire mess on protoboard. Source: Momex.cat
...Read more

Digital Tachometer for Harley Davidson Sportster (Part 9 - PCB Design)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

In this 9th part I will show you some of the steps I followed up to do this PCB design.

1) To be able to do the schematic or the PCB layout, Altium Designer requires some libraries where it can find the components information we will use. It will be necessary to have 2 libraries, one for the schematic with, for example, the number of IC pins, and antoher library for the PCB with the footprins and the position of the terminals. Additionally, if you want to be able to see a 3D version of your PCB, it is in this second library where you have to include the 3D files (STEP format). Following figures show a couple of examples where we can see from left to right (schematic, terminal list, footprint and a 3D model using STEP files).

7 SEGMENTS

Content: 7-segments schematic. Source: Momex.cat Content: Pinout 7-segments. Source: Momex.cat Content: footprint 7-segments. Source: Momex.cat Content: STEP vista 3D 7-Segments. Source: Momex.cat

PIC18F2553

Content: PIC schematic. Source: Momex.cat Content: Pinout PIC. Source: Momex.cat Content: footprint PIC. Source: Momex.cat Content: STEP veiw 3D PIC. Source: Momex.cat

2) Once the schematic is done (part8), we can proceed to build the PCB. To do so, we will need to transfer all the component footprints to the PCB shape we choose.

Content: Component footprints on the PCB layout, Altium Designer. Source: Momex.cat
...Read more

Digital Tachometer for Harley Davidson Sportster (Part 8 - Schematic and BOM)

Part1 / Part2 / Part3 / Part4 / Part5 / Part6 / Part7 / Part8 / Part9 / Part10 / Part11 / Part12 / Part13 / Part14 / Part15

So far, everything we have done has been to investigate about the SAE J1850 protocol, check on the Internet about which components are available and think how we are going to build this tachometer. Now it is time to start the practical part, this means, start to define the schematic to allow us, afterwards, design the PCB (Printed Circuit Board).

In order to do it we will use specific electronic design software that we can find on the following list. In my case, I have used Altium Designer.
Here, you have the schematic (PDF / Altium ):

Content: Harley tachometer schematic. Source: Momex.cat

And the list of components or BOM (Bill Of Materials):

...Read more

If you want to keep reading posts on this blog, please go to the archive and select your preferred posts.