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, ….
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.
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:
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.
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)
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.
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:
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.
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:
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
MM5450 driver related functions
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.
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.
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.
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).
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.
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 ):
And the list of components or BOM (Bill Of Materials):