PICAXE driver for JY-LKM1638 multi display module
Originally inspired by this thread http://www.picaxeforum.co.uk/showthread.php?18788-Worth-a-punt I thought the following may be useful for others.
Although not finished regarding the hardware, I thought the code may be useful for others who want to use the JY-LKM1638 module for their own projects http://club.dealextreme.com/forums/Forums.dx/threadid.936370
The JY-LKM1638 module uses serial comms to control all functions and is based on the TM1638 driver chip. The translated datasheet is available here https://docs.google.com/file/d/0B84N2SrJaybwZTgxYjM4ZmEtY2EyZi00YjVjLWIzOTctYTlhMjJkM2MxMTBl/edit
I could not find any code to drive this from a PICAXE so wrote my own serial comms. In this project I have used the module and an 08M2 to build a thermostat:
- Temperature measured and displayed to 0.1 deg C
- Maximum temperature recorded
- Minimum temperature recorded
- Set temperature from 0 - 99 deg C in 0.5 deg increments
- Adjustable brightness
- PICAXE reset from pushbutton
However the thermostat code is all in the Main loop. The subroutines are generic for controlling the JY-LKM1638 and could be incorporated easily for other purposes.
This is my first major PICAXE project and thanks to all the forum contributors on here. A lot of the code is based on forum posts from others. It is based on an 08M2, has used less than 50% program space and left some ordinary variables and an input pin free
Notes:
- Because I am using a DS18B20 to record 12bit temperatures and all the communications with the JY-LKM1638 is serial, the response from the pushbuttons appears sluggish at first, but you quickly get used to the delay (sub 0.5 second)
- The thermostat will be driving a mains heater so the output is via a relay, so no PID control here.
- I have only used one JY-LKM1638 module but the code should be easily modified to include STB1 - STB5 signals to drive an additional 5 more displays
- the lookup table only includes digits and a few characters. This could easily be extended to include pseudo characters to display text on the 7 segment displays
View attachment LKM1638 Temperature 1.pdf
View attachment TM1638 thermostat basic code.pdf
Originally inspired by this thread http://www.picaxeforum.co.uk/showthread.php?18788-Worth-a-punt I thought the following may be useful for others.
Although not finished regarding the hardware, I thought the code may be useful for others who want to use the JY-LKM1638 module for their own projects http://club.dealextreme.com/forums/Forums.dx/threadid.936370
The JY-LKM1638 module uses serial comms to control all functions and is based on the TM1638 driver chip. The translated datasheet is available here https://docs.google.com/file/d/0B84N2SrJaybwZTgxYjM4ZmEtY2EyZi00YjVjLWIzOTctYTlhMjJkM2MxMTBl/edit
I could not find any code to drive this from a PICAXE so wrote my own serial comms. In this project I have used the module and an 08M2 to build a thermostat:
- Temperature measured and displayed to 0.1 deg C
- Maximum temperature recorded
- Minimum temperature recorded
- Set temperature from 0 - 99 deg C in 0.5 deg increments
- Adjustable brightness
- PICAXE reset from pushbutton
However the thermostat code is all in the Main loop. The subroutines are generic for controlling the JY-LKM1638 and could be incorporated easily for other purposes.
This is my first major PICAXE project and thanks to all the forum contributors on here. A lot of the code is based on forum posts from others. It is based on an 08M2, has used less than 50% program space and left some ordinary variables and an input pin free
Notes:
- Because I am using a DS18B20 to record 12bit temperatures and all the communications with the JY-LKM1638 is serial, the response from the pushbuttons appears sluggish at first, but you quickly get used to the delay (sub 0.5 second)
- The thermostat will be driving a mains heater so the output is via a relay, so no PID control here.
- I have only used one JY-LKM1638 module but the code should be easily modified to include STB1 - STB5 signals to drive an additional 5 more displays
- the lookup table only includes digits and a few characters. This could easily be extended to include pseudo characters to display text on the 7 segment displays
View attachment LKM1638 Temperature 1.pdf
View attachment TM1638 thermostat basic code.pdf
Last edited: