forked from baoshi/I2C-LED
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
130 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
LED voltmeters are a cheap source of 7 segment displays and can easily be repurposed.<br /> | ||
<br /> | ||
PHOTO OF MULTIPLEXED DISPLAYS<br /> | ||
<br /> | ||
<!--more--><br /> | ||
<br /> | ||
<h3> | ||
Hardware</h3> | ||
<br /> | ||
<div> | ||
The hardware for this project can be bought from http://www.buyincoins.com/item/26010.html ("New 4 Digit 4.5-30V Stm8s003 Master Control Two Lines Red LED Digital Voltmeter") or http://www.buyincoins.com/item/26011.html ("4 Digit 4.5-30V Stm8s003 Master Control Two Lines Blue LED Digital in any way). Please note that I'm not associated with the seller in any way.</div> | ||
<br /> | ||
<br /> | ||
The original hardware was designed as a 4-digit voltmeter using STM8S003F3P6 MCU. The front looks like this:<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://3.bp.blogspot.com/-iFPcGzMI3so/Uhg9OJ19luI/AAAAAAAABaM/8upOZP0jfds/s1600/Original+Hardware+(front,+alternate).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="http://3.bp.blogspot.com/-iFPcGzMI3so/Uhg9OJ19luI/AAAAAAAABaM/8upOZP0jfds/s320/Original+Hardware+(front,+alternate).jpg" width="320" /></a></div> | ||
<br /> | ||
<br /> | ||
<div> | ||
The back looks like this:</div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://4.bp.blogspot.com/-kmCX5zvN1Rk/UhgsudDqmcI/AAAAAAAABZI/TaaDUcG2NMY/s1600/Original+Hardware+(back,+type+1).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="http://4.bp.blogspot.com/-kmCX5zvN1Rk/UhgsudDqmcI/AAAAAAAABZI/TaaDUcG2NMY/s320/Original+Hardware+(back,+type+1).jpg" width="320" /></a></div> | ||
<br /> | ||
<br /> | ||
<div> | ||
Or possibly like this:</div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://1.bp.blogspot.com/-Hxq-tDEs_r8/UhgsuHtytdI/AAAAAAAABZA/c8Mhtk5VDnE/s1600/Original+Hardware+(back,+type+2).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="http://1.bp.blogspot.com/-Hxq-tDEs_r8/UhgsuHtytdI/AAAAAAAABZA/c8Mhtk5VDnE/s320/Original+Hardware+(back,+type+2).jpg" width="320" /></a></div> | ||
<br /> | ||
<br /> | ||
<div> | ||
The board is powered by providing between 3.5V and 30V between the red (positive) and black (negative) wires. A voltage regulator provides 3.3V to the STM8S chip which drives the LEDs. I sacrificed a voltmeter to try to recreate the schematic of the original hardware as best I could:</div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://4.bp.blogspot.com/-Y5LU7JeE8xs/UhgqRRBU93I/AAAAAAAABYw/LpIhZgF6sS4/s1600/voltmeter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://4.bp.blogspot.com/-Y5LU7JeE8xs/UhgqRRBU93I/AAAAAAAABYw/LpIhZgF6sS4/s400/voltmeter.png" width="400" /></a></div> | ||
<br /> | ||
<div> | ||
<br /></div> | ||
Step by step photo tutorial:<br /> | ||
<br /> | ||
<b>Step 1. </b>Orient the voltmeter face down with the chip on the left hand side. Desolder resistors R3 and RX. Solder a wire in hole 1 (marked with a square), trim and strip the loose end, and solder to the left hand pad under resistor RX. Solder two more wires into holes 4 and 5 of header HV. These connect to pins 4 (NRST) and 18 (SWIM) and are used in programming the STM8S chip.<br /> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://2.bp.blogspot.com/-T4PuVSdne08/Uhg-WNtBEmI/AAAAAAAABa8/XPo041Dwk_s/s1600/hack2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="http://2.bp.blogspot.com/-T4PuVSdne08/Uhg-WNtBEmI/AAAAAAAABa8/XPo041Dwk_s/s320/hack2.jpg" width="320" /></a></div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<br /> | ||
<b>Step 2. </b>Solder a wire to the pad marked "IN" next to the red wire that carries the positive voltage. Apply flux to the very bottom pin on the left hand side the chip and very carefully solder to a length of solid core hookup wire. These two wires connect to pins 19 and 20 and carry the I2C SCL and SDA signals, respectively.<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://3.bp.blogspot.com/-5SY2c6PxHKI/Uhg-cwK9-hI/AAAAAAAABbE/8G5cIjKTBbU/s1600/hack3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="http://3.bp.blogspot.com/-5SY2c6PxHKI/Uhg-cwK9-hI/AAAAAAAABbE/8G5cIjKTBbU/s320/hack3.jpg" width="320" /></a></div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<br /></div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<br /></div> | ||
<b>Step 3. </b>Add shrink wrap and hot glue for strain relief. Solder pin headers to the loose ends of the wires. Bada bing!<br /> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
</div> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://4.bp.blogspot.com/-VfC7Mc2bsy4/Uhg-i6piPoI/AAAAAAAABbM/OkIJsNZY0SI/s1600/hack4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="203" src="http://4.bp.blogspot.com/-VfC7Mc2bsy4/Uhg-i6piPoI/AAAAAAAABbM/OkIJsNZY0SI/s320/hack4.jpg" width="320" /></a></div> | ||
<br /> | ||
<br /> | ||
<br /> | ||
<div> | ||
The schematic of the hacked hardware looks like this:</div> | ||
<br /> | ||
<br /> | ||
<div class="separator" style="clear: both; text-align: center;"> | ||
<a href="http://2.bp.blogspot.com/-kQAv8L7y7b0/UhgqRGGiRNI/AAAAAAAABYs/1SHji2cuu-Q/s1600/voltmeter-hack.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://2.bp.blogspot.com/-kQAv8L7y7b0/UhgqRGGiRNI/AAAAAAAABYs/1SHji2cuu-Q/s400/voltmeter-hack.png" width="400" /></a></div> | ||
<div> | ||
<br /></div> | ||
<br /> | ||
<br /> | ||
<h3> | ||
Firmware</h3> | ||
<br /> | ||
I adapted a similar project documented on this blog page: http://www.ba0sh1.com/hacking-a-cheap-led-voltmeter/ and in this github repository: https://github.com/baoshi/I2C-LED to modify the voltmeter into an I2C display device. The majority of the source code goes into bit banging the I2C slave protocol, as the original I2C pins are occupied by the LED. With full compiler optimization I2C clock up to 50kHz is supported.<br /> | ||
<br /> | ||
A emulation layer for the "Adafruit 4-Digit 7-Segment Display Backpack" http://www.adafruit.com/products/878 is also implemented. Original Adafruit Arduino demo codes are used for testing. Note that in order to run the Arduino code, the I2C clock needs to be reduced to 50 kHz.<br /> | ||
<h3> | ||
<br />Reprogramming</h3> | ||
<br /> | ||
STM8S discovery<br /> | ||
<br /> | ||
The free KickStart edition of "IAR Embedded Workbench for STMicroelectronics STM8" was used for development. STM8S/A Standard Peripherals Library (STM8S_StdPeriph_Driver V2.1.0: stsw-stm8069.zip from the http://www.st.com STM8 firmware page) was also needed.<br /> | ||
<br /> | ||
For one of the voltmeters, I had difficulty programming the MCU it had Read-out Protection activated. I couldn't figure out how to reset the option byte using IAR Embedded Workbench, but it was straightforward to do using STVD.<br /> | ||
<br /> | ||
<h3> | ||
Resources</h3> | ||
<br /> | ||
<br /> | ||
Github repository https://github.com/t0mpr1c3/I2C-LED<br /> | ||
<br /> | ||
connectors 3x4 pin female header, 4way male on ribbon cable, strip board<br /> | ||
<br /> | ||
||||||<br /> | ||
|ffff|<br /> | ||
|ffff|<br /> | ||
|ffff|<br /> | ||
|mmmm|<br /> | ||
||||||<br /> | ||
<br /> | ||
<br /> | ||
STM8S discovery as programmer<br /> | ||
<br /> | ||
Plan: use as temperature displays for brewery controller<br /> | ||
<br /> | ||
2 different layouts<br /> | ||
<br /> | ||
<br /> | ||
<br /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters