Skip to content

Commit 661bfde

Browse files
committed
Add additional README for each folder
1 parent fa23222 commit 661bfde

File tree

6 files changed

+66
-4
lines changed

6 files changed

+66
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<img src="pictures/logo.png" alt="CoverImage" width="800px"/>
33
</div>
44
<p>
5-
SmoothBus is a fuel gauge conversion for the classic VW Bus. More specifically a 1978 Bus. It's an all in one package with a small form factor that is slightly larger than the original gauge and can be installed with very minimal modifications to the dash. A majority of this project was done over a weekend, so don't expect perfection, but for my case it was a huge upgrade to a non working gauge.
5+
SmoothBus is a fuel gauge conversion for the classic VW Bus. More specifically a 1978 Bus. It's an all in one package with a small form factor that is slightly larger than the original gauge and can be installed with very minimal modifications to the dash. This started as a weekend project after my fuel gauge was showing me readings from all over the place.
66
</p>
77
<p>
8-
The original gauges in the buses are pretty clever design in my opinion. I've included a picture of it below. You can see it's rather simple and if my understanding is correct the flow of current through it causes the wire to heat up and expand which causes the needle to move to different positions. The current is controlled by the fuel sender float which is located in the fuel tank and is essentially a rheostat. Utilizing this thermal property also smooths out bumps and turns since it takes a second or two for it expand & contract. These things don't normally break, it's the voltage regulator that they are connected to that often goes bad, but what's the fun in replacing that when you can make your own.
8+
The original gauges in the buses are pretty clever in design. I've included a picture of it below. It's pretty simple and if my understanding is correct, the flow of current through it causes the wire to heat up and expand which causes the needle to move to different positions. The current is controlled by the fuel sender float which is located in the fuel tank and is essentially a rheostat. Utilizing this thermal property also smooths out bumps and turns since it takes a second or two for it expand & contract. These things don't normally break, it's the voltage regulator that they are connected to that often goes bad, but what's the fun in replacing that when you can make your own.
99
</p>
1010

1111
<div align="center">
1212
<img src="pictures/original_gauge.jpg" alt="Original fuel gauge" width="300"/>
1313
<br />Original fuel gauge guts.
1414
</div>
1515

16-
The SmoothBus design ditches the old gauge components including the voltage regulator keeping only the fuel sender float which is used as the variable resistor in the voltage divider circuit. The overall process is still pretty simple, the ATTiny85 microcontroller reads the analog voltage on one of it's pins and outputs that value as a servo position that corresponds to the location on the original dial. The positions & values were determined by some very useful investigations that were done in this [samba forum post](https://www.thesamba.com/vw/forum/viewtopic.php?t=693930). The analog voltage that gets inputted is the voltage divider circuit that consists of a known resistor value (100ohms) and the unknown resistor value from the fuel sender which ranges from 10 ohms to 79ohms. There is also a moving average that is happening with each read. The configuration that I found works best has been a moving average window of 35 that has readings every 200ms. All of this can be easily changed in the code that can be found in `src` directory. It should be pretty easy to setup, it was all written in the Arduino IDE with the [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) library that adds support to a bunch of tinyAVR devices (very cool project).
16+
The SmoothBus design ditches the old gauge components including the voltage regulator keeping only the fuel sender float which is used as the variable resistor in the voltage divider circuit. The overall process is still pretty simple, the ATTiny85 microcontroller reads the analog voltage on one of its input pins and outputs that value as a servo position that corresponds to the location on the original dial. The positions & values were determined by some very useful investigations that were done in this [samba forum post](https://www.thesamba.com/vw/forum/viewtopic.php?t=693930). The analog voltage that gets inputted is the voltage divider circuit that consists of a known resistor value (100ohms) and the unknown resistor value from the fuel sender which ranges from 10 ohms to 79ohms. There is also a moving average that is happening with each read. The configuration that I found works best has been a moving average window of 35 that has readings every 200ms. All of this can be easily changed in the code that can be found in `src` directory. It should be pretty easy to setup, it was all written in the Arduino IDE with the [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) library that adds support to a bunch of tinyAVR devices (very cool project).
1717

1818
Programming the board wasn't the most intuitive. I decided to have probe points on the board (bottom left corner of PCB) that I thought would be a good idea to easily program the device, but it ended up being a bit finicky. It required making a jig and using tiny spring loaded probes that were then connected to an Arduino Mega that was used as an ISP (see below). [I thought I learned my lesson last time](https://gitlab.com/_Pegor/kepler_fw/-/tree/master/Hardware?ref_type=heads#programming-jig). I think the rest of design is rather straight forward. It contains a voltage regulator that can handle up to 35V and also has some red LEDs to indicate low fuel level. The schematic is included in `hardware/PCB` along with the gerber zip that you can send to a PCB manufacturer of your choice.
1919

@@ -75,10 +75,16 @@ Lastly here is a picture of the finished product and a gif of it in action. Happ
7575
</td>
7676
<td>
7777
<div align="center">
78-
<img src="pictures/smoothbus.gif" alt="Installed Gauge" width="400"/>
78+
<img src="pictures/smoothbus.gif" alt="Installed Gauge" width="360"/>
7979
<br /> GIF of it in action
8080
</div>
8181
</td>
8282
</tr>
8383
</table>
8484
</div>
85+
<br>
86+
<br>
87+
Almost forgot! Here is the little loaf if you're curious.
88+
<div align="center">
89+
<img src="pictures/loaf.jpg" alt="loaf" width="800px"/>
90+
</div>

hardware/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SmoothBus Hardware
2+
3+
This folder contains the 3D parts that were used and the PCB components including the schematic.
4+
5+
## 3D Parts
6+
7+
There are 4 total parts that were 3D printed:
8+
* `case.stl`: The housing that the PCB and dial get mounted onto. Printed at standard 0.20mm layer height.
9+
* `hand.stl`: The indicator hand that was then attached to a servo arm. Printed at 0.08mm layer height to preserve the chamfer detail.
10+
* `programming_jig.stl`: The jig that was used along with needle probes to sit on the case and be used to program the MCU. Printed at standard 0.20mm layer height, but the holes didn't come out with the print and I had to drill them by hand with some [REALLY tiny PCB drill bits](https://a.co/d/grPr89h). Resin printing might be better for this piece if possible.
11+
* `spacer.stl`: Required spacer to make sure the connection screws on the back don't short against the metal backplate. Based on the original spacer, but shortened. Printed at standard 0.20mm layer height.
12+
13+
## PCB
14+
* `board_layout_gerber.zip`: Zip file that contains the necessary files to be sent to a PCB manufacturer. This can be directly uploaded to most online manufacturers and should be all you need.
15+
* `smoothbus_v1.pdf`: Schematic that the PCB was based off.
16+
17+
18+
## Parts list
19+
Most parts were ordered from DigiKey. You can find the link to every part below.
20+
* [ATTiny85 MCU](https://www.digikey.com/en/products/detail/microchip-technology/ATTINY85-20SU/735470?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXekrVHnhWS_QH42e2IfO4IPqG7whUqVekeKc50QXDYyLq4FDMk1B03GmXVukNkQf5vT7wma6IGS9dvrSbytcA07hW30_9-LSLiFI)
21+
* [Voltage Regulator](https://www.digikey.com/en/products/detail/onsemi/MC7805BDTRKG/919331?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXQPZI5IpIA4jxuSj-j0oJsKcf3MiN5_SPBbcSTN6yNa732chOnHBOtDvxcu8hei2zJ8ulLiHPiOVp4p6lIHpy8KIhn2Zh2r5UxWp)
22+
* [Resistor (100 ohm)](https://www.digikey.com/en/products/detail/panasonic-electronic-components/ERJ-3EKF1000V/196074?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXYRDXpi8Ml4N9Sp83X4YqKcldPyiTMATzQcQUZd8mh4gmYTtWWy6-fSJDjSYEJzsJjWVK19N6Dzl_O6S3iiEtepvPORJ8gQC9Rv4)
23+
* [Resistor (300 ohm)](https://www.digikey.com/en/products/detail/panasonic-electronic-components/ERJ-3EKF3000V/1746363?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXdEbFEk2vnz8TdDCMYi2ZvBRvi0xZ3QWf4A1BBz3Y6H9VUHtYQ7Hx6Yc9U8TIDwPAMeCyvmbiHD4zOseAaEuE4b6-RVKmEEzlJ0n)
24+
* [Capacitor](https://www.digikey.com/en/products/detail/panasonic-electronic-components/EEE-1AA101WAR/1717732?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXXrESR0Uub-6f2kRNF92ux7_UfMi5lWjfZ3HeSCeRQ4K-QIheCeCLtJbuBlB7UzqJeScWqTYXTorI1clshc5IrSi3ZXfU0YRYQy1)
25+
* [Green LED](https://www.digikey.com/en/products/detail/w%C3%BCrth-elektronik/150060VS55040/8557182?so=89524344&content=productdetail_US&mkt_tok=MDI4LVNYSy01MDcAAAGWmcaWXSWnwSJVfg821OYlSVqJ8XjR337j5IsVlRd9hIlqfH-6m_PKL9PQZvykHguCCXttRMn7EU1WLZ2d0dGRmJl8GlbqXjSWTcFVhbzZ)
26+
* [Red LED](https://a.co/d/7SslF5E)
27+
* [Servo](https://a.co/d/cdSHXeV)
28+
* [Test probe pins used on programming jig](https://a.co/d/gTRcbDf)
29+
* M5 Screws and Nuts (ACE/Home Depot)
30+
31+
## Things to improve
32+
* Ditch the probe points and programming jig. Add a connector instead.

pictures/complete_build.jpg

-7.07 MB
Loading

pictures/loaf.jpg

2.36 MB
Loading

src/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SmoothBus Src
2+
3+
This folder contains the code that gets slapped onto the ATTiny85 chip using the Arduino IDE.
4+
5+
6+
### Dependencies
7+
8+
* [Konde's ATTinyCore library](https://github.com/SpenceKonde/ATTinyCore) - add to your Arduino IDE.
9+
10+
### Flashing
11+
12+
* I used an Arduino Mega2560 as an ISP to flash the ATTiny85 with the programming jig. [Here](https://www.instructables.com/How-to-Burn-ATTiny85-Using-Arduino-Mega/) is a decent write up.
13+
* Flashed the ATTiny85 with the clock set to 16 Mhz, anything less with introduce more servo jitter.
14+
15+
## Things to improve
16+
* Discard readings that are dramatically different than previous reading. Could be based on percent difference.
17+
* Low fuel warning indicator logic could be improved to not trigger on every time it has a reading in that range. Instead turn the warning lights on if there has been continuous readings in that range (maybe something along the lines of if 20 readings) same with turning them off. This could help reduce flashing warning lights when you take a turn.

src/SmoothBus.ino renamed to src/SmoothBus/SmoothBus.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//==========================================
2+
// Title: SmoothBus.ino
3+
// Author: Pegor Karoglanian
4+
// Date: 11/1/24
5+
// Notes: Code for SmoothBus fuel gauge conversion for VW Bus.
6+
//==========================================
7+
18
#include <ATTinyCore.h>
29
#include <Arduino.h>
310
#include <Servo.h>

0 commit comments

Comments
 (0)