<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hobby Farit</title>
	<atom:link href="https://hobby.farit.ru/feed/" rel="self" type="application/rss+xml" />
	<link>https://hobby.farit.ru</link>
	<description></description>
	<lastBuildDate>Thu, 13 Aug 2026 04:59:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.39</generator>
	<item>
		<title>BMW E30 Premium Sound System Amplifier</title>
		<link>https://hobby.farit.ru/bmw-e30-premium-sound-system-amplifier/</link>
		<comments>https://hobby.farit.ru/bmw-e30-premium-sound-system-amplifier/#comments</comments>
		<pubDate>Thu, 13 Aug 2026 02:11:34 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">https://hobby.farit.ru/?p=756</guid>
		<description><![CDATA[Premium Sound The later BMW E30 may be equipped with the 4-channel Premium Sound System. The audio head unit is the Alpine CM5908 with the 4 audio preamp outputs: Front Left, Front Right, Rear Left, Rear Right. The 4 preamp outputs are connected to the Blaupunkt amplifier (called Quadro Booster), but the Ground output wires [&#8230;]]]></description>
				<content:encoded><![CDATA[<h3>Premium Sound</h3>
<p>The later BMW E30 may be equipped with the 4-channel Premium Sound System.</p>
<p>The audio head unit is the Alpine CM5908 with the 4 audio preamp outputs: Front Left, Front Right, Rear Left, Rear Right. The 4 preamp outputs are connected to the Blaupunkt amplifier (called <em>Quadro Booster</em>), but the Ground output wires of each channel are connected and form a single Ground wire input to the amplifier. This amplifier connection is called &#8220;Single-Ended Input&#8221;. There is nothing bad about it. If you have a newer head unit , connect the grounds of all preamp outputs (usually, RCA connectors) together. The Alpine CM5908 uses 2-pin DIN connectors for preamp outputs, they are covered with silver, which has tarnished by now: <a href="https://en.wikipedia.org/wiki/DIN_connector#Loudspeaker_Connector" rel="noopener" target="_blank">DIN 41529 connector</a>. </p>
<p>4 RCA outputs.<br />
<a href="https://hobby.farit.ru/wp-content/uploads/2026/08/rca.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/rca.jpg" alt="rca outputs" width="652" height="279" class="aligncenter size-full wp-image-759" /></a></p>
<p>Preamp output signals are measured in volts, usually in the range of 2-5 Volts. Older head units provided the voltage close to 2V. Newer head units provide 4V preamp outputs, which require lower gains in an amplifier; otherwise, audio from an amplifier will be too loud even at the lowest loudness levels.</p>
<h3>Blaupunkt Quadro Booster Amplifier</h3>
<p>The default amplifier is pretty simple. It uses 8 venerable SGS TDA2003 chips. They are still produced by Chinese companies like <a href="https://www.unisonic.com.tw/uploadfiles/836/part_no_pdf/TDA2003.pdf" rel="noopener" target="_blank">Unisoc</a>.</p>
<p>The TDA2003 is a Class-AB amplifier chip. Each two TDA2003s are connected in the bridge configuration providing 14 Watts into each of the 4 channels. </p>
<p>The Remote Enable (Auto Antenna) input enables the relay that provides power to the circuit. Two inductors filter the power supply line. The TDA2003s are mounted on the heatsink.</p>
<p>The vertical and horizontal panels are connected using wires, which break easily. Also, there are many electrolytic capacitors that should be replaced. </p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/blaupunkt_amplifier.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/blaupunkt_amplifier-854x548.jpg" alt="blaupunkt e30 amplifier" width="854" height="548" class="aligncenter size-medium wp-image-762" /></a></p>
<h3>Class-D Amplifier</h3>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/tas5414_amplifier.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/tas5414_amplifier-854x586.jpg" alt="tas5414 amplifier" width="854" height="586" class="aligncenter size-medium wp-image-761" /></a></p>
<h4>Schematics</h4>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30amp.zip">Kicad files</a></p>
<h4>Vertical panel</h4>
<p>The vertical panel runs traces from the main connector to the 2 board-to-board connectors.</p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_panel.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_panel.jpg" alt="e30_panel" width="790" height="636" class="aligncenter size-full wp-image-767" /></a></p>
<h4>Horizontal panel</h4>
<p>The horizontal panel contains all components. </p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp-854x505.jpg" alt="e30_amp" width="854" height="505" class="aligncenter size-medium wp-image-768" /></a></p>
<h4>Protection Circuit</h4>
<p>The protection circuit with the LM76202 protects against reverse power connections, when a car battery is connected incorrectly. It also protects from undervoltage (< 10 V) and overvoltage (> 16 V) power supply. Its Shutdown pin is connected to the Remote Enable (Auto Antenna) output from a head unit; when the signal is High, the chip provides power to the circuit.</p>
<p>The chip TPS3711 monitors the power voltage and sets the fault line Low when the voltage is under 11 V. It allows the microprocessor to run fault routines. </p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_protection.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_protection-854x379.jpg" alt="e30_amp_protection" width="854" height="379" class="aligncenter size-medium wp-image-764" /></a></p>
<h4>Microprocessor Circuit</h4>
<p>The microprocessor circuit uses the chip STM32L412KBT3, which has only 32 pins. The amplifier gain is set by the switch, the selected value is read by the microprocessor at the initialization stage and the gain register is set in the amplifier chip.</p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_microprocessor.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_microprocessor-854x584.jpg" alt="e30_amp_microprocessor" width="854" height="584" class="aligncenter size-medium wp-image-765" /></a></p>
<h4>TAS5414C Circuit</h4>
<p><a href="https://www.ti.com/product/TAS5414C" rel="noopener" target="_blank">TAS5414C</a> is a 4-channel D-class automotive amplifier. It&#8217;s suitable for setups with single ended inputs. Its registers can be set using I2C. During the initialization step, tests can be run to test each channel for faults. It doesn&#8217;t consume much power, so a small chip-mounted heatsink can transfer all excess heat to the existing amplifier body. </p>
<p><em>It sounds great.</em></p>
<p>Companies rarely provide full documentation for later chips. The TAS5414C is still produced with full documentation available. There are inexpensive test boards from <a href="https://www.mikroe.com/audioamp-3-click" rel="noopener" target="_blank">Microe</a>.</p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_tas5414c.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2026/08/e30_amp_tas5414c-854x559.jpg" alt="e30_amp_tas5414c" width="854" height="559" class="aligncenter size-medium wp-image-766" /></a></p>
<h3>TAS5414 Zephyr Driver</h3>
<p>The microprocessor does the initialization of the amplifier chip TAS5414C. It sets the registers, runs tests to find out if any of the outputs has faults, especially when speakers are not connected. When the power goes down, its fault interrupt routine sends a mute message to the amplifier chip.</p>
<p>The driver is written for the Zephyr RTOS, so it can be adapted to run on different processors.</p>
<p><a href="https://github.com/faritka/e30amp" target="_blank">TAS5414 Driver</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/bmw-e30-premium-sound-system-amplifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coolant temperature gauge in BMW E30 instrument cluster</title>
		<link>https://hobby.farit.ru/coolant-temperature-gauge-in-bmw-e30-instrument-cluster/</link>
		<comments>https://hobby.farit.ru/coolant-temperature-gauge-in-bmw-e30-instrument-cluster/#comments</comments>
		<pubDate>Fri, 20 Jun 2025 02:45:42 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[bmw e30]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=727</guid>
		<description><![CDATA[The coolant temperature gauge in the BMW E30 instrument cluster is connected to the brown-plug coolant temperature sender(12621710511). The coolant temperature sensor The temperature sensor is an NTC thermistor, its resistance is higher when the temperature is lower. It was inserted into a container with liquid silicone that was subjected to freezing and heating. Temperature [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The coolant temperature gauge in the BMW E30 instrument cluster is connected to the brown-plug coolant temperature sender(12621710511). </p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2025/06/tempgauge-e30.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2025/06/tempgauge-e30-854x728.jpg" alt="Temperature Gauge BMW E30" width="854" height="728" class="aligncenter size-medium wp-image-728" /></a></p>
<h3>The coolant temperature sensor</h3>
<p>The temperature sensor is an NTC thermistor, its resistance is higher when the temperature is lower.<br />
It was inserted into a container with liquid silicone that was subjected to freezing and heating. Temperature values were recorded. They are lower that the temperature range of the engine, I may try to measure the higher temperatures later and recalculate the results.</p>
<table>
<tr>
<th>Temperature</th>
<th>Resistance</th>
</tr>
<tr>
<td>3°C (38°F)</td>
<td>1300 Ω</td>
</tr>
<tr>
<td>25°C (77°F)</td>
<td>620 Ω</td>
</tr>
<tr>
<td>60°C (140°F)</td>
<td>186 Ω</td>
</tr>
</table>
<p>The Steinhart–Hart equation coefficients:<br />
A = 0.0021390576483277567<br />
B = 0.00011856786248721395<br />
C = 0.000001702703922601429</p>
<h3>Coolant temperature gauge values</h3>
<p>The values for the reference marks, they start from 0. The supplied voltage is 5 Volts.</p>
<table>
<tr>
<th>Mark</th>
<th>Resistance</th>
<th>Temperature</th>
<th>Input voltage</th>
</tr>
<tr>
<td>0 (blue)</td>
<td>160 Ω</td>
<td>64°C (147°F)</td>
<td>3.1 V</td>
</tr>
<tr>
<td>1</td>
<td>85 Ω</td>
<td>82°C (180°F)</td>
<td>2.3 V</td>
</tr>
<tr>
<td>2</td>
<td>54 Ω</td>
<td>94°C (201°F)</td>
<td>1.8 V</td>
</tr>
<tr>
<td>3 (middle)</td>
<td>35 Ω</td>
<td>106°C (222°F)</td>
<td>1.33 V</td>
</tr>
<tr>
<td>4</td>
<td>25 Ω</td>
<td>114°C (237°F)</td>
<td>1.05 V</td>
</tr>
<tr>
<td>5 (red)</td>
<td>20 Ω</td>
<td>120°C (248°F)</td>
<td>0.86 V</td>
</tr>
<tr>
<td>6</td>
<td>12.5 Ω</td>
<td>132°C (270°F)</td>
<td>0.6 V</td>
</tr>
</table>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2025/06/resistance-e30sensor.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2025/06/resistance-e30sensor-854x447.jpg" alt="resistance-e30sensor" width="854" height="447" class="aligncenter size-medium wp-image-732" /></a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2025/06/resistance-voltage-e30.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2025/06/resistance-voltage-e30-854x447.jpg" alt="resistance-voltage-e30" width="854" height="447" class="aligncenter size-medium wp-image-733" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/coolant-temperature-gauge-in-bmw-e30-instrument-cluster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HML087 coding plug ROM for BMW E30 instrument cluster</title>
		<link>https://hobby.farit.ru/hml087-coder-rom-for-e30-instrument-cluster/</link>
		<comments>https://hobby.farit.ru/hml087-coder-rom-for-e30-instrument-cluster/#comments</comments>
		<pubDate>Sat, 15 Feb 2025 21:39:47 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=693</guid>
		<description><![CDATA[The E30 instrument cluster for newer models have a coding plug (codier stecker) in front that stores the configuration parameters for SI boards: 6 or 4 cylinders, the maximum RPM, etc. If you open the coding plug, you can find the chip HML087. It&#8217;s a 40-year-old ROM that uses its own communication protocol. The coding [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The E30 instrument cluster for newer models have a coding plug (codier stecker) in front that stores the configuration parameters for SI boards: 6 or 4 cylinders, the maximum RPM, etc.<br />
If you open the coding plug, you can find the chip HML087. It&#8217;s a 40-year-old ROM that uses its own communication protocol.</p>
<h3>The coding plug pins</h3>
<table>
<tr>
<th>Pin</th>
<th>Function</th>
<th>Description</th>
</tr>
<tr>
<td>1</td>
<td>CLOCK</td>
<td>The data is sent on its level going from high to low</td>
</tr>
<tr>
<td>2</td>
<td>GND</td>
<td>Ground</td>
</tr>
<tr>
<td>3</td>
<td>+5V</td>
<td>Power to the chip</td>
</tr>
<tr>
<td>4</td>
<td>GND</td>
<td>Ground</td>
</tr>
<tr>
<td>5</td>
<td>DATA</td>
<td>The output data: high &#8211; 1, low &#8211; 0</td>
</tr>
<tr>
<td>6</td>
<td>GND</td>
<td>Ground</td>
</tr>
<tr>
<td>7</td>
<td>CS</td>
<td>The ROM is selected when the CS level is high</td>
</tr>
<tr>
<td>8</td>
<td>GND</td>
<td>Ground</td>
</tr>
</table>
<h3>Communication protocol capture</h3>
<p>The protocol can be captured using a Saleae compatible logic analyzer and the Saleae software. </p>
<p>The coding plug for HML087 1385468 (E30 325i M20B25 7000RPM USA)<br />
<a href="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_1385468.png"><img src="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_1385468-854x172.png" alt="hml087_1385468" width="854" height="172" class="aligncenter size-medium wp-image-697" /></a></p>
<p>The communication protocol description.<br />
The pin CS is set high by a microprocessor. Then, the microprocessor sends 64 CLOCK signals. When the CLOCK signal goes from high to low, the ROM outputs data on the DATA pin.</p>
<h3>Data from different E30 coding plugs</h3>
<table>
<tr>
<th>Coding plug</th>
<th>Description</th>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
<th>9</th>
<th>10</th>
<th>11</th>
<th>12</th>
<th>13</th>
<th>14</th>
<th>15</th>
</tr>
<tr>
<td>1385468</td>
<td>E30 325i M20B25 7000RPM USA</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1380873</td>
<td>E30 M3 S14 8000RPM Europe</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1377368</td>
<td>E30 325e M20B27 5000RPM USA</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1394321</td>
<td>E30 318is M42B18 7000RPM USA</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1385364</td>
<td>E30 318i M40B18 7000RPM Europe</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>16</th>
<th>17</th>
<th>18</th>
<th>19</th>
<th>20</th>
<th>21</th>
<th>22</th>
<th>23</th>
<th>24</th>
<th>25</th>
<th>26</th>
<th>27</th>
<th>28</th>
<th>29</th>
<th>30</th>
<th>31</th>
</tr>
<tr>
<td>1385468</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1380873</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1377368</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1394321</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1385364</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>32</th>
<th>33</th>
<th>34</th>
<th>35</th>
<th>36</th>
<th>37</th>
<th>38</th>
<th>39</th>
<th>40</th>
<th>41</th>
<th>42</th>
<th>43</th>
<th>44</th>
<th>45</th>
<th>46</th>
<th>47</th>
</tr>
<tr>
<td>1385468</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1380873</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1377368</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1394321</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1385364</td>
<td>&nbsp;</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>48</th>
<th>49</th>
<th>50</th>
<th>51</th>
<th>52</th>
<th>53</th>
<th>54</th>
<th>55</th>
<th>56</th>
<th>57</th>
<th>58</th>
<th>59</th>
<th>60</th>
<th>61</th>
<th>62</th>
<th>63</th>
</tr>
<tr>
<td>1385468</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1380873</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1377368</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1394321</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1385364</td>
<td>&nbsp;</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</table>
<h3>HML087 emulation</h3>
<p>The communication protocol can be emulated by a microprocessor. While the Attiny family looks like an obvious choice, it&#8217;s too slow for the application. It will work with older SI boards where the CLOCK signal period is 30 µseconds, but in the newer SI boards the period is 5 µseconds.</p>
<h3>HML087 emulator that uses the microprocessor ch32v003</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_emulator.png"><img src="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_emulator-854x535.png" alt="hml087_emulator" width="854" height="535" class="aligncenter size-medium wp-image-717" /></a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_emulator_schema.png"><img src="http://hobby.farit.ru/wp-content/uploads/2025/02/hml087_emulator_schema-854x519.png" alt="hml087_emulator_schema" width="854" height="519" class="aligncenter size-medium wp-image-719" /></a></p>
<p>Here is the software for the BMW E30 coding plug emulator that uses the RISC-V microcontroller CH32V003: <a href="https://github.com/faritka/hml087" rel="noopener" target="_blank">https://github.com/faritka/hml087</a></p>
<p>You can check the timing diagram for the coder.</p>
<p>The CLOCK signal pulse period is 5.583 µs as the programmed coder was inserted into one of the latest SI boards.<br />
When the CLOCK signal changes from HIGH to LOW, the coder reacts after 725 ns (0.725 µs) and sends 0 (LOW) on the DATA line. This delay is acceptable for the latest SI boards. </p>
<p>The CLOCK signal pulse period is about 30 µs for earlier SI boards, and the coder certainly works with them.</p>
<p><a href="https://hobby.farit.ru/wp-content/uploads/2025/02/coder_diagram.jpg"><img src="https://hobby.farit.ru/wp-content/uploads/2025/02/coder_diagram-816x854.jpg" alt="coder_diagram" width="816" height="854" class="aligncenter size-medium wp-image-752" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/hml087-coder-rom-for-e30-instrument-cluster/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Playing WAV files on STM32 for BMW E30 gong</title>
		<link>https://hobby.farit.ru/bmw-e30-gong/</link>
		<comments>https://hobby.farit.ru/bmw-e30-gong/#comments</comments>
		<pubDate>Mon, 15 Jul 2024 05:57:41 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[bmw e30]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=680</guid>
		<description><![CDATA[The main goal of the project was to minimize power consumption by replacing the existing gong module with a modern microprocessor. The main microprocessor for the gong is the STM32L452RET6. The microprocessor sleeps most of the time consuming only 5 μA. When the level changes on one of its interrupt lines, a WAKEUP interrupt awakens [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The main goal of the project was to minimize power consumption by replacing the existing gong module with a modern microprocessor.</p>
<p>The main microprocessor for the gong is the STM32L452RET6.</p>
<p>The microprocessor sleeps most of the time consuming only 5 μA. When the level changes on one of its interrupt lines, a WAKEUP interrupt awakens the microprocessor. The program detects which interrupt line awakened the system and plays a corresponding WAV file on its DAC. When it stops playing, the microprocessor goes back into sleeping.</p>
<p>WAV files are only a few seconds each, and they are stored in the microprocessor flash. The program uses a timer to transfer bytes to the DAC according to the bit rate, usually, 16 bit/44.1kHz or 16 bit/48kHz. As the STM32 DAC is only 12-bit, some conversion is done. First, bytes are read into a memory buffer. Then, they are transferred to the DAC using a DMA channel. The program waits until it receives a transfer complete interrupt, and send a new portion of the music file to the buffer. </p>
<p>The DAC signal is amplified by the amplifier chip NJM2135M (MC34119).</p>
<p>The software uses the Real-Time Operating System Zephyr to organize multiple threads and simplify writing drivers.</p>
<h3>The gong schema.</h3>
<p>I used a simpler and cheaper octocouple before, and the power consumption was similar. </p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_schema.png"><img src="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_schema-854x604.png" alt="BMW E30 gong schema" width="854" height="604" class="aligncenter size-medium wp-image-681" /></a></p>
<p>The audio amplifier subschema.<br />
<a href="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_amplifier_schema.png"><img src="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_amplifier_schema-854x604.png" alt="BMW E30 gong amplifier schema" width="854" height="604" class="aligncenter size-medium wp-image-682" /></a></p>
<h3>The gong PCB</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_front.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_front-854x507.jpg" alt="BMW E30 gong pcb" width="854" height="507" class="aligncenter size-medium wp-image-685" /></a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_back.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2024/07/gong_back-854x471.jpg" alt="BMW E30 gong pcb" width="854" height="471" class="aligncenter size-medium wp-image-686" /></a></p>
<p>Software: <a href="https://github.com/faritka/e30gong" target="_blank">BMW E30 gong software for Zephyr RTOS and STM32</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/bmw-e30-gong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>6-button digital clock for BMW E30</title>
		<link>https://hobby.farit.ru/bmw-e30-clock-zephyr-stm32/</link>
		<comments>https://hobby.farit.ru/bmw-e30-clock-zephyr-stm32/#comments</comments>
		<pubDate>Tue, 15 Aug 2023 05:14:18 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=657</guid>
		<description><![CDATA[The clock is engineered to be installed into the existing 6-button BMW E30 digital clock enclosure. The digits and letters are drawn by five red LTP-305HR 5&#215;7 dot matrix displays covered by an orange filter. There are two PCBs: the first is for the power supply and processor, the second is for the displays, buttons, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The clock is engineered to be installed into the existing 6-button BMW E30 digital clock enclosure. The digits and letters are drawn by five red LTP-305HR 5&#215;7 dot matrix displays covered by an orange filter. There are two PCBs: the first is for the power supply and processor, the second is for the displays,  buttons, and display chip. The time functions are processed by the RTC module RV-3032-C7, which is temperature-compensated and very accurate. When the power is off, the RTC module gets power from the supercapacitor, which can supply enough power for a few months. The light sensor VEML7700 provides information about the current light level. The display dims at night. The optocoupler provides isolation from other car electronics.</p>
<p>The software is written using RTOS Zephyr for the processor STM32L452RE. There are several threads that read and update the current time, check the light level and adjust the display brightness, process interrupts fired by controlling buttons. A watchdog process restarts the processor in case of a serious error.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_parts.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_parts-854x423.jpg" alt="clock_parts" width="854" height="423" class="aligncenter size-medium wp-image-664" /></a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_open.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_open-854x569.jpg" alt="clock_open" width="854" height="569" class="aligncenter size-medium wp-image-666" /></a></p>
<h3>The processor is programmed by connecting it to an STM32 Nucleo board.</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_programming.jpg"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/clock_programming-854x639.jpg" alt="clock programming" width="854" height="639" class="aligncenter size-medium wp-image-667" /></a></p>
<h3>The display PCB.</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/display.png"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/display-854x604.png" alt="Display" width="854" height="604" class="aligncenter size-medium wp-image-658" /></a></p>
<h3>The processor PCB.</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/processor.png"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/processor-854x604.png" alt="processor" width="854" height="604" class="aligncenter size-medium wp-image-659" /></a></p>
<h3>The power module.</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/power.png"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/power-854x604.png" alt="power" width="854" height="604" class="aligncenter size-medium wp-image-660" /></a></p>
<h3>The supercapacitor charger module.</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2023/08/battery_charger.png"><img src="http://hobby.farit.ru/wp-content/uploads/2023/08/battery_charger-854x604.png" alt="battery_charger" width="854" height="604" class="aligncenter size-medium wp-image-661" /></a></p>
<p>Software: <a href="https://github.com/faritka/e30clock" target="_blank">BMW E30 clock software for Zephyr RTOS and STM32</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/bmw-e30-clock-zephyr-stm32/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LED Matrix Font for HT1632C and Zephyr RTOS</title>
		<link>https://hobby.farit.ru/led-matrix-font-ht1632c-zephyr-rtos/</link>
		<comments>https://hobby.farit.ru/led-matrix-font-ht1632c-zephyr-rtos/#comments</comments>
		<pubDate>Fri, 30 Jul 2021 19:18:33 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[ht1632c]]></category>
		<category><![CDATA[stm32]]></category>
		<category><![CDATA[zephyr]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=629</guid>
		<description><![CDATA[Now, when the HT1632C display driver for Zephyr RTOS is ready, we want to write characters into the display buffer and send the buffer to the LED matrix. LED matrix The LED indicator is the LTP-305HR 5&#215;7 dot matrix display. It has an LED for a dot ., that is located at the column 0. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Now, when the <a href="http://hobby.farit.ru/ht1632-driver-rtos-zephyr-nucleo-stm32/" rel="noopener" target="_blank">HT1632C display driver for Zephyr RTOS</a> is ready, we want to write characters into the display buffer and send the buffer to the LED matrix.</p>
<h3>LED matrix</h3>
<p>The LED indicator is the LTP-305HR 5&#215;7 dot matrix display. It has an LED for a dot ., that is located at the column 0. So, we will start writing characters at the column 1 of the display buffer.</p>
<p>The HT1632C supports 32 ROWs &#8211; in our case they will be vertical columns, and 8 COMs &#8211; they will be horizontal rows. </p>
<p>The center of coordinates 0x0 starts at the left top.</p>
<p>In our case, we will use 5&#215;7 fixed width fonts. Each character will be represented as an array of 5 uint8_t 8-bit numbers(bytes). The array will start from the leftest column. The top row will start from the most significant(the leftest) bit of a byte.</p>
<p>Here is the letter <strong>M</strong> displayed on the LED matrix. When a bit is set to 1, it turns on the LED at that position; when it is set to 0, it turns off the LED. The 8th bit doesn&#8217;t matter as it&#8217;s not displayed at all &#8211; we will set it to 0.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/led_m.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/led_m.png" alt="led matrix m" width="500" height="468" class="aligncenter size-full wp-image-633" /></a></p>
<p>The C array for the letter M looks like this:<br />
{Column 1, Column 2, Column 3, Column 4, Column 5}</p>
<pre>{0b11111110, 0b01000000, 0b00110000, 0b01000000, 0b11111110}, // M</pre>
<h3>Font File</h3>
<p>All characters for the 5&#215;7 font are included in the file font_5x7.h</p>
<p>They are located according to the ASCII order starting from the character SPACE &#8216; &#8216;, which has the decimal number 32.</p>
<pre>
#ifndef FONT_5x7_H
#define FONT_5x7_H

// The width of each font character
#define APP_FONT_WIDTH 5

const uint8_t font[][APP_FONT_WIDTH] = {
    {0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}, // 
    {0b00000000, 0b00000000, 0b11111010, 0b00000000, 0b00000000}, // !
    {0b00000000, 0b11100000, 0b00000000, 0b11100000, 0b00000000}, // "
    {0b00101000, 0b11111110, 0b00101000, 0b11111110, 0b00101000}, // #
    {0b00101000, 0b01010100, 0b11111110, 0b01010100, 0b00101000}, // $
    {0b11000100, 0b11001000, 0b00010000, 0b00100110, 0b01000110}, // %
    {0b01101100, 0b10010010, 0b10101010, 0b01000100, 0b00001010}, // &#038;
    {0b00000000, 0b00000000, 0b11100000, 0b00000000, 0b00000000}, // '
    {0b00000000, 0b00111000, 0b01000100, 0b10000010, 0b00000000}, // (
    {0b00000000, 0b10000010, 0b01000100, 0b00111000, 0b00000000}, // )
    {0b00101000, 0b00010000, 0b01111100, 0b00010000, 0b00101000}, // *
    {0b00010000, 0b00010000, 0b01111100, 0b00010000, 0b00010000}, // +
    {0b00000000, 0b00001010, 0b00001100, 0b00000000, 0b00000000}, // ,
    {0b00010000, 0b00010000, 0b00010000, 0b00010000, 0b00010000}, // -
    {0b00000000, 0b00000110, 0b00000110, 0b00000000, 0b00000000}, // .
    {0b00000100, 0b00001000, 0b00010000, 0b00100000, 0b01000000}, // /
    {0b01111100, 0b10000010, 0b10000010, 0b10000010, 0b01111100}, // 0
    {0b00000000, 0b01000010, 0b11111110, 0b00000010, 0b00000000}, // 1
    {0b01000010, 0b10000110, 0b10001010, 0b10010010, 0b01100010}, // 2
    {0b01000100, 0b10000010, 0b10010010, 0b10010010, 0b01101100}, // 3
    {0b00001000, 0b00011000, 0b00101000, 0b01001000, 0b11111110}, // 4
    {0b11110100, 0b10010010, 0b10010010, 0b10010010, 0b10001100}, // 5
    {0b01111100, 0b10010010, 0b10010010, 0b10010010, 0b01001100}, // 6
    {0b10000000, 0b10001110, 0b10010000, 0b10100000, 0b11000000}, // 7
    {0b01101100, 0b10010010, 0b10010010, 0b10010010, 0b01101100}, // 8
    {0b01100100, 0b10010010, 0b10010010, 0b10010010, 0b01111100}, // 9
    {0b00000000, 0b01101100, 0b01101100, 0b00000000, 0b00000000}, // :
    {0b00000000, 0b01101010, 0b01101100, 0b00000000, 0b00000000}, // ;
    {0b00010000, 0b00101000, 0b01000100, 0b10000010, 0b00000000}, // <
    {0b00101000, 0b00101000, 0b00101000, 0b00101000, 0b00101000}, // =
    {0b10000010, 0b01000100, 0b00101000, 0b00010000, 0b00000000}, // >
    {0b01000000, 0b10000000, 0b10001010, 0b10010000, 0b01100000}, // ?
    {0b01111100, 0b10000010, 0b10011000, 0b10100100, 0b01111000}, // @
    {0b01111110, 0b10010000, 0b10010000, 0b10010000, 0b01111110}, // A
    {0b11111110, 0b10010010, 0b10010010, 0b10010010, 0b01101100}, // B
    {0b01111100, 0b10000010, 0b10000010, 0b10000010, 0b01000100}, // C
    {0b11111110, 0b10000010, 0b10000010, 0b10000010, 0b01111100}, // D
    {0b11111110, 0b10010010, 0b10010010, 0b10010010, 0b10000010}, // E
    {0b11111110, 0b10010000, 0b10010000, 0b10010000, 0b10000000}, // F
    {0b01111100, 0b10000010, 0b10010010, 0b10010010, 0b01011110}, // G
    {0b11111110, 0b00010000, 0b00010000, 0b00010000, 0b11111110}, // H
    {0b00000000, 0b10000010, 0b11111110, 0b10000010, 0b00000000}, // I
    {0b00000100, 0b10000010, 0b10000010, 0b10000010, 0b11111100}, // J
    {0b11111110, 0b00010000, 0b00101000, 0b01000100, 0b10000010}, // K
    {0b11111110, 0b00000010, 0b00000010, 0b00000010, 0b00000010}, // L
    {0b11111110, 0b01000000, 0b00110000, 0b01000000, 0b11111110}, // M
    {0b11111110, 0b00100000, 0b00010000, 0b00001000, 0b11111110}, // N
    {0b01111100, 0b10000010, 0b10000010, 0b10000010, 0b01111100}, // O
    {0b11111110, 0b10010000, 0b10010000, 0b10010000, 0b01100000}, // P
    {0b01111100, 0b10000010, 0b10001010, 0b10000100, 0b01111010}, // Q
    {0b11111110, 0b10010000, 0b10011000, 0b10010100, 0b01100010}, // R
    {0b01100100, 0b10010010, 0b10010010, 0b10010010, 0b01001100}, // S
    {0b10000000, 0b10000000, 0b11111110, 0b10000000, 0b10000000}, // T
    {0b11111100, 0b00000010, 0b00000010, 0b00000010, 0b11111100}, // U
    {0b11111000, 0b00000100, 0b00000010, 0b00000100, 0b11111000}, // V
    {0b11111100, 0b00000010, 0b00111100, 0b00000010, 0b11111100}, // W
    {0b11000110, 0b00101000, 0b00010000, 0b00101000, 0b11000110}, // X
    {0b11100000, 0b00010000, 0b00001110, 0b00010000, 0b11100000}, // Y
    {0b10000110, 0b10001010, 0b10010010, 0b10100010, 0b11000010}, // Z
    {0b00000000, 0b11111110, 0b10000010, 0b00000000, 0b00000000}, // [
    {0b01000000, 0b00100000, 0b00010000, 0b00001000, 0b00000100}, /* \ */
    {0b00000000, 0b10000010, 0b11111110, 0b00000000, 0b00000000}, // ]
    {0b00100000, 0b01000000, 0b10000000, 0b01000000, 0b00100000}, // ^
    {0b00000010, 0b00000010, 0b00000010, 0b00000010, 0b00000010}, // _
    {0b00000000, 0b10000000, 0b01000000, 0b00000000, 0b00000000}, // `
    {0b00000100, 0b00101010, 0b00101010, 0b00101010, 0b00011110}, // a
    {0b11111110, 0b00010010, 0b00100010, 0b00100010, 0b00011100}, // b
    {0b00011100, 0b00100010, 0b00100010, 0b00100010, 0b00000100}, // c
    {0b00011100, 0b00100010, 0b00100010, 0b00010010, 0b11111110}, // d
    {0b00011100, 0b00101010, 0b00101010, 0b00101010, 0b00011000}, // e
    {0b00000000, 0b00010000, 0b01111110, 0b10010000, 0b01000000}, // f
    {0b00010000, 0b00101010, 0b00101010, 0b00101010, 0b00111100}, // g
    {0b11111110, 0b00010000, 0b00100000, 0b00100000, 0b00011110}, // h
    {0b00000000, 0b00100010, 0b10111110, 0b00000010, 0b00000000}, // i
    {0b00000100, 0b00000010, 0b00100010, 0b10111100, 0b00000000}, // j
    {0b11111110, 0b00001000, 0b00010100, 0b00100010, 0b00000000}, // k
    {0b00000000, 0b10000010, 0b11111110, 0b00000010, 0b00000000}, // l
    {0b00111110, 0b00100000, 0b00011110, 0b00100000, 0b00011110}, // m
    {0b00111110, 0b00010000, 0b00100000, 0b00100000, 0b00011110}, // n
    {0b00011100, 0b00100010, 0b00100010, 0b00100010, 0b00011100}, // o
    {0b00111110, 0b00101000, 0b00101000, 0b00101000, 0b00010000}, // p
    {0b00010000, 0b00101000, 0b00101000, 0b00101000, 0b00111110}, // q
    {0b00111110, 0b00010000, 0b00100000, 0b00100000, 0b00010000}, // r
    {0b00010010, 0b00101010, 0b00101010, 0b00101010, 0b00100100}, // s
    {0b00000000, 0b00100000, 0b11111100, 0b00100010, 0b00000100}, // t
    {0b00111100, 0b00000010, 0b00000010, 0b00000100, 0b00111110}, // u
    {0b00111000, 0b00000100, 0b00000010, 0b00000100, 0b00111000}, // v
    {0b00111100, 0b00000010, 0b00001100, 0b00000010, 0b00111100}, // w
    {0b00100010, 0b00010100, 0b00001000, 0b00010100, 0b00100010}, // x
    {0b00110000, 0b00001010, 0b00001010, 0b00001010, 0b00111100}, // y
    {0b00100010, 0b00100110, 0b00101010, 0b00110010, 0b00100010}, // z
    {0b00010000, 0b00010000, 0b01101100, 0b10000010, 0b10000010}, // {
    {0b00000000, 0b00000000, 0b11111110, 0b00000000, 0b00000000}, // |
    {0b10000010, 0b10000010, 0b01101100, 0b00010000, 0b00010000}, // }
    {0b01000000, 0b10000000, 0b01000000, 0b01000000, 0b10000000}, // ~
    {0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}, // Delete
};

#endif /* FONT_5x7_H */
</pre>
<p>When we draw a character, we can subtract the value of SPACE &#8216; &#8216; from its decimal number and find its location in the font array. Then, we write 5 bytes of the font to the buffer.</p>
<pre>
/**
 * Draws a character at the position X
 *
 * @param uint8_t c The character to display
 * @param uint8_t x The position at the display from which to display
 */
void draw_char(uint8_t buf[], const uint8_t font[][APP_FONT_WIDTH], 
               uint8_t c, uint8_t x) 
{
    // Convert the character to an index
    c = c &#038; 0x7F;
    if (c < ' ') {
        c = 0;
    } else {
        c -= ' ';
    }

    for (int i = x, j = 0; j < APP_FONT_WIDTH; i++, j++) {
        buf[i] = font[c][j];
    }
}
</pre>
<p>We can display a character starting from the position 1 like this:</p>
<pre>
draw_char(buf, font, 'M', 1);
</pre>
<p>When all required characters are set in the display buffer, the display buffer is sent to the HT1632C controller at once.</p>
<pre>
display_write(display_dev, 0, 0, &#038;buf_desc, buf);
</pre>
<p>The code is available on <a href="https://github.com/faritka/zephyr-ht1632c" rel="noopener" target="_blank">https://github.com/faritka/zephyr-ht1632c</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/led-matrix-font-ht1632c-zephyr-rtos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing HT1632 driver for RTOS Zephyr and Nucleo STM32</title>
		<link>https://hobby.farit.ru/ht1632-driver-rtos-zephyr-nucleo-stm32/</link>
		<comments>https://hobby.farit.ru/ht1632-driver-rtos-zephyr-nucleo-stm32/#comments</comments>
		<pubDate>Mon, 12 Jul 2021 21:16:31 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[ht1632c]]></category>
		<category><![CDATA[stm32]]></category>
		<category><![CDATA[zephyr]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=598</guid>
		<description><![CDATA[Zephyr Real-Time Operating System When you have a powerful microcontroller, there is no need to limit yourself by the capabilities of Arduino. Most Arduino programs run in a loop that checks buttons, does some calculations, connect to the Internet, etc sequentially. Coding gets complicated when you want to click on a button and process the [&#8230;]]]></description>
				<content:encoded><![CDATA[<h3>Zephyr Real-Time Operating System</h3>
<p>When you have a powerful microcontroller, there is no need to limit yourself by the capabilities of Arduino. Most Arduino programs run in a loop that checks buttons, does some calculations, connect to the Internet, etc sequentially. Coding gets complicated when you want to click on a button and process the click quickly while another function is slowly connecting and parsing a webpage. </p>
<p>A Real-Time operating system allows to code multiple functions and delegate the task of running them simultaneously to the OS.</p>
<p><a href="https://www.zephyrproject.org/" rel="noopener" target="_blank">Zephyr Project</a> is a very promising project. But some sensors, displays, hardware chips don&#8217;t have drivers to interact with them yet.</p>
<p>An experienced programmer usually learns by reading code of sample programs. Zephyr provides <a href="https://docs.zephyrproject.org/latest/" rel="noopener" target="_blank">many samples</a>.</p>
<h3>STM32 Nucleo boards</h3>
<p>ST provides $15 evaluation boards for its family of the STM32 ARM processors called Nucleo. </p>
<p>I compared <a href="https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html" rel="noopener" target="_blank">the list of available Nucleo boards</a> with <a href="https://docs.zephyrproject.org/latest/boards/" rel="noopener" target="_blank">the list of the Nucleo boards supported by Zephyr</a>. </p>
<p>I wanted a low-power microcontroller with the largest RAM and flash, and in the LQFP64 package (64 pins, 10&#215;10 mm), which is hot-air solderable. I selected <a href="https://docs.zephyrproject.org/latest/boards/arm/nucleo_l452re/doc" rel="noopener" target="_blank">ST Nucleo L452RE</a> for the project.</p>
<h3>How the Holtek HT1632C works</h3>
<p>The Holtek HT1632C is a popular display controller that can drive matrices of LEDs (one chip up to 32&#215;8 or 24&#215;16). <a href="https://www.holtek.com/productdetail/-/vg/HT1632D_32D-2" rel="noopener" target="_blank">The Holtek HT1632D</a> is a newer version that can come in a smaller LQFP48 7&#215;7 mm package that has fewer pins for rows.</p>
<p>Here is a typical electrical schema. The HT1632C controls the 5&#215;7 LED matrices (with 1 additional row for a dot) with the common cathodes.</p>
<p>Here is how it works. To turn on the 1st top LED in the 2nd column, the HT1632C sets 1 (HIGH) on ROW1 and opens COM0, so the current flows via the current-limiting resistor to the LED and then via COM0 to the ground. The LED turns on.</p>
<p>The LEDs in the matrices are addressed starting from the leftest top LED.</p>
<p>In order to enable the 1st top LED in the 2nd column, user code must write 1 into the HT1632C RAM address matching the ROW1 and COM0 combination. According to the HT1632C controller datasheet, the address is 02H when the controller is configured as 32 ROW x 8 COM or the address is 04H when the controller is configured as 24 ROW x 16 COM.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/display_LTP-305.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/display_LTP-305.png" alt="display LTP-305" width="832" height="945" class="aligncenter size-full wp-image-605" /></a></p>
<h3>The HT1632C communication protocol</h3>
<p>The HT1632C uses 4 pins to communicate with a microcontroller.</p>
<ul>
<li>CS (chip select)</li>
<li>WR (write)</li>
<li>RD (read)</li>
<li>DATA</li>
</ul>
<p>This driver doesn&#8217;t read from the display controller. It only writes. So, we don&#8217;t use the RD pin.</p>
<ul>
<li>The CS pin is active LOW. When the microcontroller wants to communicate with the HT1632C, it sets the CS pin to the ground (LOW).</li>
<li>The microcontroller sets the WR pin to LOW.</li>
<li>It sends a bit (0 or 1) by setting the DATA pin to LOW (0) or HIGH (1).</li>
<li>It sets the WR pin to HIGH. The HT1632C reads the DATA bit on the rising WR edge.</li>
<li>The microcontroller repeats the WR LOW, DATA bit, WR HIGH sequence until all bits are sent.</li>
<li>When it finishes, it sets the CS pin HIGH.</li>
</ul>
<p>There are two modes of operation: the command mode and the write data mode.</p>
<p>The command mode starts with the 3 bits 100 and then the command itself.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/command_mode.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/command_mode.png" alt="HT1632C command mode" width="1570" height="477" class="aligncenter size-full wp-image-610" /></a></p>
<p>The write data mode starts with the 3 bits 101, the RAM address, the 4 bits of data.</p>
<p>This driver writes the whole array of data starting from the address 00H using the Successive Address Writing Mode. It starts with the 3 bits 101, the RAM address 00H, then all 32 8-bit words or 24 16-bit words.</p>
<p>It&#8217;s the task of the application code to set individual bits in the matrix array. Then it sends the whole matrix array to the driver.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/write_data_mode.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/write_data_mode.png" alt="HT1632C write data mode" width="1469" height="358" class="aligncenter size-full wp-image-611" /></a></p>
<p>Here is how the command SYS EN (Turn on system oscillator) looks like on the screen of my oscilloscope.<br />
SYS EN 100-0000-0001-0</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/sending_command_sys_en.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/sending_command_sys_en.png" alt="HT1632C command SYS EN" width="1050" height="434" class="aligncenter size-full wp-image-615" /></a></p>
<h3>Zephyr Application Structure</h3>
<p>The structure of my application is based on <a href="https://github.com/zephyrproject-rtos/example-application/" rel="noopener" target="_blank">the Zephyr Example Application</a>.</p>
<p>It creates an application with a sensor driver.</p>
<p>I changed the string &#8216;example-application&#8217; in the files to my own application name.</p>
<h3>HT1632C Zephyr Driver Installation</h3>
<p>Download the source from <a href="https://github.com/faritka/zephyr-ht1632c" rel="noopener" target="_blank">https://github.com/faritka/zephyr-ht1632c</a> and follow instructions there.</p>
<h3>Zephyr driver configuration files</h3>
<p>Available configuration options are defined in the file <i>dts/bindings/display/holtek,ht1632c.yaml</i>.<br />
It follows the Device Tree specifications.</p>
<p>The GPIOS have the phandle-array type that describes the GPIO identifier, pin, and flags. For example, the flag GPIO_OUTPUT_HIGH sets the default output as HIGH, the flag GPIO_ACTIVE_LOW means when you set the pin ACTIVE, the signal goes LOW (the CS pin is active low). </p>
<pre>
description:  Holtek HT1632C display controller

compatible: "holtek,ht1632c"

include: base.yaml

properties:
    cs-gpios:
      type: phandle-array
      required: true
      description: GPIO to which the CS pin of HT1632C is connected.

    wr-gpios:
      type: phandle-array
      required: true
      description: GPIO to which the WR pin of HT1632C is connected.

    data-gpios:
      type: phandle-array
      required: true
      description: GPIO to which the DATA pin of HT1632C is connected.

    commons-options:
      type: int
      required: true
      default: 0x00
      description: |
        0x00: N-MOS  opendrain output and 8 common option
        0x01: N-MOS  opendrain  output  and  16 common option
        0x10: P-MOS  opendrain output and 8 common option
        0x11: P-MOS  opendrain  output  and  16 common option
</pre>
<p>The test application is located in the directory <i>app</i>.<br />
I created the overlay configuration file for my Nucleo L452RE board: <i>app/boards/nucleo_l452re.overlay</i>.</p>
<p>I defined the GPIOs that are connected to the HT1632C controller on the Nucleo L452RE board: CS to PB3, WR to PB5, DATA to PB4. The commons-options configures the HT1632C controller as 32&#215;8 N-MOS. This configuration doesn&#8217;t need external transistors, the current will flow from ROWN -> resistor -> LEDs -> COMN.</p>
<pre>
/ {
    ht1632c {
        compatible = "holtek,ht1632c";
        label = "HT1632C";
        cs-gpios = <&#038;gpiob 3 0>;
        wr-gpios = <&#038;gpiob 5 0>;
        data-gpios = <&#038;gpiob 4 0>;
        commons-options = <0x00>;
    };
};
</pre>
<h3>Hardware delays</h3>
<p>The HT1632C datasheet provides the table with electrical parameters.</p>
<p>t<sub>CLK</sub> is 500 ns &#8211; it&#8217;s the pulse width of each WR signal<br />
t<sub>su</sub> is minimum 100 ns, I set it to 250 ns &#8211; it&#8217;s the delay between the setting the DATA pin and the WR pin going HIGH.</p>
<p>The function <i>ht1632c_ns_to_sys_clock_hw_cycles</i> converts nanoseconds to the processor clock cycles that must pass during those nanoseconds.</p>
<pre>
/**
 * @brief Converts nanoseconds to the number of the processor system cycles
 *
 * @param uint32_t ns Nanoseconds
 *
 */
static inline uint32_t ht1632c_ns_to_sys_clock_hw_cycles(uint32_t ns)
{
    return ((uint64_t)sys_clock_hw_cycles_per_sec() * (ns) / NSEC_PER_SEC + 1);
}
</pre>
<p>That&#8217;s what I get for the Nucleo L452RE with the 80MHz clock.</p>
<pre>
Delay t<sub>CS</sub> 33
Delay t<sub>CLK</sub> 41
Delay t<sub>SU</sub> 21
Delay t<sub>H</sub> 21
Delay t<sub>SU1</sub> 25
Delay t<sub>H1</sub> 17
</pre>
<p>The function ht1632c_delay then delays execution counting cycles.</p>
<pre>
/**
 * @brief Delays the execution waiting for processor cycles
 *
 * @param dev Pointer to device data
 * @param uint32_t cycles_to_wait How many processor cycles to wait
 *
 */
static void ht1632c_delay(uint32_t cycles_to_wait)
{
    uint32_t start = k_cycle_get_32();

    // Wait until the given number of cycles have passed
    while (k_cycle_get_32() - start < cycles_to_wait) {
    }
}
</pre>
<p>Here is the function that writes a command to the HT1632C controller.</p>
<pre>
/**
 * @brief Writes a command to HT1632C
 *
 * @param dev Pointer to device data
 * @param uint8_t command Command without the first 3 bits 100
 *
 */
static void ht1632c_write_command(struct ht1632c_data *data, 
        uint8_t command)
{
    //CS down
    ht1632c_delay(data->delays->cs);
    ht1632c_set_cs_pin(data, true);
    ht1632c_delay(data->delays->su1);
    
    //100 - command mode
    ht1632c_write_bits(data, HT1632C_COMMAND_HEADER, BIT(2));
    //the command itself
    ht1632c_write_bits(data, command, BIT(7));
    //one extra bit
    ht1632c_write_bits(data, 0, BIT(0));

    //set the DATA pin low waiting for the next command
    ht1632c_set_data_pin(data, false);

    //CS UP
    ht1632c_delay(data->delays->h1);
    ht1632c_set_cs_pin(data, false);
}
</pre>
<h3>Sample program</h3>
<p>The sample program writes the letter M, changes the brightness, and then makes the HT1632C sleep when CONFIG_PM=y and CONFIG_PM_DEVICE=y in <i>app/prj.conf</i>.</p>
<p>It's interesting to see how the second row of the letter M is half-lighted in the photo. That's because the HT1632C constantly switches ROWs and COMs ON and OFF. The human eye can't catch it, but a photo camera can.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/07/ht132c_sample.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/07/ht132c_sample.png" alt="ht1632c sample program output" width="1600" height="1362" class="aligncenter size-full wp-image-626" /></a></p>
<h3>Useful links</h3>
<p><a href="https://interrupt.memfault.com/blog/building-drivers-on-zephyr?" rel="noopener" target="_blank">How to Build Drivers for Zephyr</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/ht1632-driver-rtos-zephyr-nucleo-stm32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BMW E30 E36 White Flashlight Li-ion Battery 82119413147</title>
		<link>https://hobby.farit.ru/bmw-e30-e36-white-flashlight-li-ion-battery-82119413147/</link>
		<comments>https://hobby.farit.ru/bmw-e30-e36-white-flashlight-li-ion-battery-82119413147/#comments</comments>
		<pubDate>Wed, 23 Jun 2021 22:06:14 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[bmw e30]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[e30]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=563</guid>
		<description><![CDATA[The BMW E30, E32, E34, and E36 have space in the glove box for the white flashlight (torch) 63171375457 or 82119413147. The later BMW models provide the black flashlight 63316962052, which is not compatible because the flashlight contacts are male. The original electric circuit is extremely simple. There are two 1.2V NiMH coin cells, a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The BMW E30, E32, E34, and E36 have space in the glove box for the white flashlight (torch) 63171375457 or 82119413147. The later BMW models provide the black flashlight 63316962052, which is not compatible because the flashlight contacts are male.</p>
<p>The original electric circuit is extremely simple. There are two 1.2V NiMH coin cells, a resistor to constantly charge them, an E10 2.4V bulb, and a switch.<br />
You can read an article about <a href="https://surfncircuits.com/2017/07/23/teardown-and-repair-of-the-simply-designed-bmw-e36-glovebox-flashlight/" rel="noopener" target="_blank">Teardown and Repair of the Simply Designed BMW E36 Glovebox Flashlight</a>. </p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/bmw-e30-flashlight-63171375457.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/bmw-e30-flashlight-63171375457.png" alt="bmw e30 e32 e34 e36 flashlight 63171375457" width="1600" height="1558" class="aligncenter size-full wp-image-564" /></a></p>
<p>All white flashlights that you can get now have dead batteries. You can replace the batteries with similar NiMH batteries, and they should work for a few years.</p>
<p>My project replaces the original circuit with a more sophisticated circuit that has a charger chip, Li-ion 4.2V coin cells, and an LED bulb.</p>
<h3>Electrical Circuit</h3>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-ltc4079.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-ltc4079.png" alt="flashlight charger ltc4079" width="1104" height="727" class="aligncenter size-full wp-image-651" /></a></p>
<p>The charging chip is <a href="https://www.analog.com/en/products/ltc4079.html" rel="noopener" target="_blank">LTC4079</a>. </p>
<blockquote><p>The LTC®4079 is a low quiescent current, high voltage linear charger for most battery chemistry types including Li-Ion/Polymer, LiFePO4, Lead-Acid or NiMH battery stacks up to 60V. The maximum charge current is adjustable from 10mA  to  250mA  with  an  external  resistor.  The  battery  charge voltage is set using an external resistor divider.</p></blockquote>
<p>The chip is tiny, but it&#8217;s possible to solder the QFN chip using hot air.</p>
<p>Two ⌀24.5mm <a href="https://www.illinoiscapacitor.com/ic_search/battery_products_detail.aspx?icpartnumber=16" rel="noopener" target="_blank">RJD2450ST1</a> 200 mAh rechargeable coin cells are used. </p>
<blockquote><p>Charging Current &#8211; Standard: 95 mA<br />
Charging Voltage &#8211; Maximum: 4.2 V</p></blockquote>
<p>The RJD2450ST1 has contacts for soldered wires. But it requires cutting two small slots in the plastic circle in the middle of the flashlight. The RJD2450 without contacts can be used if there is a battery spot welder for the original contacts.</p>
<p>The resistor divider R2=1.54MΩ and R4=249kΩ provides the 8.4V charging voltage.<br />
The resistor divider R1=1.2MΩ and R3=130kΩ disables charging when the battery voltage goes down to less than 12.17V. V<sub>IN(REG)</sub> = 1.190 × (1 + 1200000 ÷ 130000).<br />
The resistor R5=12kΩ sets the charging current to 25mA. R<sub>PROG</sub> = 297.5 ÷ 0.025. The maximum charging current for the coin cells is 95mA. When I tested this amperage by using a 3kΩ resistor, the LTC4079 was very hot as the PCB is too tiny to dissipate all heat.<br />
The timer capacitor C2=0.1µF is set to disable charging after approximately 5½ hours. C<sub>TIMER</sub> = 5.5 × 18.2.<br />
The 10k NTC thermistor is NHQM103B375T5.</p>
<h3>PCB</h3>
<p>I used a 4-layer 1.2mm-thick PCB. </p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-pcb.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-pcb.png" alt="flashlight charger pcb" width="1557" height="1024" class="aligncenter size-full wp-image-652" /></a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-pcb-3d.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-charger-pcb-3d.png" alt="flashlight charger pcb 3d LTC4079" width="1469" height="973" class="aligncenter size-full wp-image-653" /></a></p>
<h3>LED bulb</h3>
<p>The flashlight uses E10 bulbs. </p>
<p>The default polarity of the BMW E30 flashlight bulb is to have &#8211; (negative or ground) at the tip of the bulb and to have + (positive) at the screw body. Most LED E10 bulbs have the opposite polarity: + at the tip and &#8211; at the body. </p>
<p>It&#8217;s relatively easy to change the wires, but the original connectors around the coin cells must be isolated well.</p>
<p>I checked a 1W LED light. It was really hot when it was on. The body of the flashlight is plastic and there is no airflow, so the plastic can melt.</p>
<p>I selected <a href="https://www.aliexpress.com/item/1005002604945130.html" rel="noopener" target="_blank">this LED</a>: 0.5W, Screw E10, Nopolar, 12V Warm White(4300K). It can be connected to &#8211; and + both ways. It doesn&#8217;t get warm. It also has the same height as the original bulb: 22mm. It even has a lens.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/e10-led.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/e10-led.png" alt="e10 led" width="1145" height="1145" class="aligncenter size-full wp-image-582" /></a></p>
<h3>Pictures</h3>
<p>The flashlight is pretty bright and works for more than 10 hours on one charge.</p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/06/rjd2450st1.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/rjd2450st1.png" alt="rjd2450st1" width="1600" height="1045" class="aligncenter size-full wp-image-586" /></a><br />
<a href="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-inside.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-inside.png" alt="flashlight-inside" width="1600" height="1000" class="aligncenter size-full wp-image-587" /></a><br />
<a href="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-inside-led.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/flashlight-inside-led.png" alt="flashlight-inside-led" width="2548" height="1420" class="aligncenter size-full wp-image-588" /></a><br />
<a href="http://hobby.farit.ru/wp-content/uploads/2021/06/e30-flashlight-led.png"><img src="http://hobby.farit.ru/wp-content/uploads/2021/06/e30-flashlight-led.png" alt="e30-flashlight-led" width="1600" height="1369" class="aligncenter size-full wp-image-589" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/bmw-e30-e36-white-flashlight-li-ion-battery-82119413147/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>3D-printed BMW E30, E32, E34, E36 connector 61130007441 61130007442</title>
		<link>https://hobby.farit.ru/bmw-e30-connector-61130007441/</link>
		<comments>https://hobby.farit.ru/bmw-e30-connector-61130007441/#comments</comments>
		<pubDate>Mon, 24 May 2021 05:21:59 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[bmw e30]]></category>
		<category><![CDATA[e30]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=503</guid>
		<description><![CDATA[Many 2-pole (2-pin) and 3-pole (3-pin) electrical connectors in the BMW E30 and other classic BMWs (E32, E34, E36) use 2.5 mm female contacts. There are BMW outer plastic housings for 2 and 3 poles. But they require watertight rubber housing inserts for each contact terminal. BMW offers the sockets and wires with the housing [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Many 2-pole (2-pin) and 3-pole (3-pin) electrical connectors in the BMW E30 and other classic BMWs (E32, E34, E36) use 2.5 mm female contacts.</p>
<p>There are BMW outer plastic housings for 2 and 3 poles. But they require watertight rubber housing inserts for each contact terminal. </p>
<p>BMW offers the sockets and wires with the housing inserts already molded around them:  <a href="https://www.realoem.com/bmw/enUS/part?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=61&#038;sg=15&#038;diagId=61_2489&#038;q=61130007441" rel="noopener" target="_blank">61130007441</a> and <a href="https://www.realoem.com/bmw/enUS/part?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=61&#038;sg=15&#038;diagId=61_2489&#038;q=61130007442" rel="noopener" target="_blank">61130007442</a>. You have to solder them to your existing wires and use shrink wraps to isolate them. They are pretty expensive: $8-9.</p>
<p>If you want to go the DIY way, rubber contact housing inserts can be 3D-printed and regular inexpensive contact sockets can be inserted in them and sealed with a glue. Contact will also look much better without soldered green-wire extensions.</p>
<p>This article is only about straight contacts. There are also 90° contacts, but I didn&#8217;t look for sockets for them. Some BMW sockets should be usable.</p>
<h3>Contact Socket</h3>
<p>The contact socket is made by TE Connectivity (formerly AMP).<br />
At the time of writing, the silver sockets cost $0.27 each for quantities over 10. The gold sockets are of course 10 times more expensive.</p>
<p><a href="https://www.te.com/usa-en/product-T2030002008-000.html" rel="noopener" target="_blank">T2030002008-000</a></p>
<blockquote><p>
    TE Internal #: T2030002008-000<br />
    TE Internal Description: CEF-0.75<br />
    Contact Type : Socket<br />
    Contact Mating Area Plating Material : Silver<br />
    Wire Contact Termination Area Plating Material : Silver<br />
    Wire Size (AWG): 18<br />
    Wire Size (mm²): .75<br />
    Contact Current Rating (Max) (A): 16
</p></blockquote>
<p>This one has a slightly bigger hole for a wire: <a href="https://www.te.com/usa-en/product-T2030002010-000.html" rel="noopener" target="_blank">T2030002010-000</a></p>
<blockquote><p>
    TE Internal #: T2030002010-000<br />
    TE Internal Description: CEF-1.0<br />
    Contact Type : Socket<br />
    Contact Mating Area Plating Material : Silver<br />
    Wire Contact Termination Area Plating Material : Silver<br />
    Wire Size (AWG): 18<br />
    Wire Size (mm²): 1.0<br />
    Contact Current Rating (Max) (A): 16
</p></blockquote>
<p>Check the inner hole diameters yourself: T2030002005-000 &#8211; Ø1.15mm, T2030002008-000 &#8211; Ø1.30mm, T2030002010-000 &#8211; Ø1.45mm.</p>
<p>There are also smaller and gold-plated sockets in the series.</p>
<p>There are similar contacts from other companies: <a href="https://www.digikey.com/en/products/filter/heavy-duty-connectors-contacts/337?s=N4IgjCBcoMwdIDGUBmBDANgZwKYBoQB7KAbRBhgBYBOMakAXQIAcAXKEAZVYCcBLAHYBzEAF8CAJgpRQySOmz4ipEJQAMlAGwB2AKyMW7SF16CR4kAFoJMpFF4BXJcUhl9DUZ6A" rel="noopener" target="_blank">Digikey heavy-duty sockets</a></p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/T2030002010-000.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/T2030002010-000.png" alt="TE AMP T2030002010-000 CEF" width="1016" height="849" class="aligncenter size-full wp-image-510" /></a></p>
<h3>3D-printed housing</h3>
<p>The material is TPU (Thermoplastic polyurethane), which is flexible.</p>
<p>Only the upper part is cut to accommodate insertion of the socket.<br />
The bottom part is a solid circle that wraps around the male part providing good sealing. If it were cut and glued, the adhesive bond could easily break under the stress of insertion.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/contact.stl">Download the 3D model</a></p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/contact.jpg"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/contact-854x802.jpg" alt="contact" width="854" height="802" class="aligncenter size-medium wp-image-736" /></a></p>
<h3>Sculpteo 3D printing</h3>
<p>I used the 3D-printing service provided by <a href="https://www.sculpteo.com" rel="noopener" target="_blank">sculpteo.com</a><br />
The material was TPU (flexible), HP Multi Jet Fusion Fusion (Plastic).<br />
The price was $20 for 20 contacts plus shipping, $1 per contact.</p>
<p>It&#8217;s cheaper to attach more contacts to the existing design in a 3D-program if you need more contacts than to print multiple designs. The model can be joined in Freecad to produce more contacts at once. Use Boolean operation &#8211; there are YouTube videos explaining how to do it.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/scuplteo_multijet_tpu.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/scuplteo_multijet_tpu.png" alt="scuplteo multijet tpu" width="1342" height="1153" class="aligncenter size-full wp-image-517" /></a></p>
<p>Here is the result.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/3dprinted.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/3dprinted.png" alt="3dprinted contacts" width="1024" height="441" class="aligncenter size-full wp-image-519" /></a></p>
<p>Of course, there are other online services that provide 3D printing. But the printing material must be flexible, not rigid.</p>
<h3>Contact installation</h3>
<p>The 3D-insert crevices were cleaned of the excessive material dust using a knife and picks.</p>
<p>The wires were inserted into the sockets T2030002008-000 and they were crimped. The contact holes for wires were tight for the headlight wire gauge. The wiring diagram showed 1 mm² (16 AWG), though.</p>
<p>The sockets are pretty cheap to have an assortment and match different wire gauges perfectly. The biggest socket that will fit into the 3D-printed insert is T2030002015-000.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/T2030002008-000.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/T2030002008-000.png" alt="T2030002008-000 crimped" width="1024" height="762" class="aligncenter size-full wp-image-520" /></a></p>
<p>The sockets were inserted into the 3D-printed housing inserts.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/housing.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/housing.png" alt="Contact housing inserted" width="1024" height="906" class="aligncenter size-full wp-image-521" /></a></p>
<p>The open parts of the housing inserts were glued together using the shoe cement &#8220;Petronio&#8221;. After the glue settled a little bit, the sides were pressed together. Probably, any flexible glue should be good enough. If you wish to use Super Glue, it should be used on both sides ignoring the glue instructions.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/contact_glue.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/contact_glue.png" alt="contact glue" width="1024" height="645" class="aligncenter size-full wp-image-522" /></a></p>
<p>A day passed waiting until the glue hardened.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/contact_glued.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/contact_glued.png" alt="contact_glued" width="1024" height="703" class="aligncenter size-full wp-image-523" /></a></p>
<p>The contacts were installed successfully.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/installed.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/installed.png" alt="installed" width="1024" height="619" class="aligncenter size-full wp-image-533" /></a></p>
<h3>BMW E30, E32, E34, E36 connector plastic housings</h3>
<p>The 3D-printed housing insert described in the article is compatible only with the straight contact terminal plastic housings.</p>
<ul>
<li>White 2-pole: <a href="https://www.realoem.com/bmw/enUS/part?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=61&#038;sg=15&#038;diagId=61_0534&#038;q=61131378401" rel="noopener" target="_blank">61131378401</a></li>
<li>Gray 2-pole: <a href="https://www.realoem.com/bmw/enUS/partxref?id=1113-USA-02-1991-E30-BMW-325i&#038;diagId=61_0534&#038;q=61131378402" rel="noopener" target="_blank">61131378402</a></li>
<li>Yellow 2-pole: <a href="https://www.realoem.com/bmw/enUS/partxref?id=1113-USA-02-1991-E30-BMW-325i&#038;diagId=61_0534&#038;q=61131378403" rel="noopener" target="_blank">61131378403</a></li>
<li>Black 2-pole: <a href="https://www.realoem.com/bmw/enUS/partxref?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=13&#038;sg=15&#038;diagId=13_0335&#038;q=61131378400&#038;series=E30" rel="noopener" target="_blank">61131378400</a>
<li>Black 3-pole: <a href="https://www.realoem.com/bmw/enUS/part?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=61&#038;sg=15&#038;diagId=61_0534&#038;q=61131378410" rel="noopener" target="_blank">61131378410</a></li>
</ul>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/05/housings.png"><img src="//hobby.farit.ru/wp-content/uploads/2021/05/housings.png" alt="BMW E30 housing 61131378401 61131378402 61131378403 61131378410" width="2564" height="1652" class="aligncenter size-full wp-image-535" /></a></p>
<p>The other housings require angled contact terminals: 61131378416 (black), 61131378417 (white), 61131378418 (gray), 61131378419 (yellow). </p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/bmw-e30-connector-61130007441/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Custom bracket to install 6-speed transmission in BMW E30</title>
		<link>https://hobby.farit.ru/custom-bracket-to-install-6-speed-transmission-in-bmw-e30/</link>
		<comments>https://hobby.farit.ru/custom-bracket-to-install-6-speed-transmission-in-bmw-e30/#comments</comments>
		<pubDate>Fri, 26 Feb 2021 00:56:39 +0000</pubDate>
		<dc:creator><![CDATA[Farit]]></dc:creator>
				<category><![CDATA[bmw e30]]></category>
		<category><![CDATA[e30]]></category>
		<category><![CDATA[gs6-37dz]]></category>

		<guid isPermaLink="false">http://hobby.farit.ru/?p=475</guid>
		<description><![CDATA[This transmission bracket (cross member) can be used for an installation of a 6-speed transmission in a BMW E30. It should work with the Getrag 420G, ZF GS6-37DZ and ZF GS6-37BZ. Weld all parts together and paint them. Download 3D model The 6-speed transmission bracket for the E30 dimensions. Use 4 square-headed M8X18 bolts (23711130250) [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This transmission bracket (cross member) can be used for an installation of a 6-speed transmission in a BMW E30. It should work with the Getrag 420G, ZF GS6-37DZ and ZF GS6-37BZ.</p>
<p>Weld all parts together and paint them.</p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/02/transbracket.stl">Download 3D model</a></p>
<p><a href="http://hobby.farit.ru/wp-content/uploads/2021/02/transbracket.jpg"><img src="//hobby.farit.ru/wp-content/uploads/2021/02/transbracket-854x449.jpg" alt="transbracket" width="854" height="449" class="aligncenter size-medium wp-image-738" /></a></p>
<p><a href="//hobby.farit.ru/wp-content/uploads/2021/02/transbracket_e30_6-speed.pdf">The 6-speed transmission bracket for the E30 dimensions.</a></p>
<p>Use 4 square-headed M8X18 bolts (<a href="https://www.realoem.com/bmw/enUS/part?id=1113-USA-02-1991-E30-BMW-325i&#038;mg=23&#038;sg=10&#038;diagId=23_0380&#038;q=23711130250" rel="noopener" target="_blank">23711130250</a>) to connect the bracket to the chassis.</p>
]]></content:encoded>
			<wfw:commentRss>https://hobby.farit.ru/custom-bracket-to-install-6-speed-transmission-in-bmw-e30/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
