Hardware


Shell Lab L4 is programmable LED spotlight / tower lamp controller with USB/serial interface

Characteristic:

● 4 PWM modulated NPN-MOS to driver high power LED lamps
● independently configurable between each channel: power, blink frequency, counter
● RGB each channel is independently adjusted from 0~255
● blinking effect (freq adjustable from 0.1~20Hz, 0 for static)
● not limited to LED, other PWM modulated devices are available: DC-motors, heating wires...
● 2 meters length of USB cable
● interactive serial console with ASCII command, online manual embedded
● programming language is not limited (Python recommended)
● quick test with Testbench App (with various demo codes)
● pip install mcush library (support windows/linux/mac) and write scripts easily

Use cases:

● prototype design
● fault/exception indication in product/software cycle test
● indication in assembly line, green for PASS and red for FAIL
● experiment progress indication
● kanban/placard indication
● interactive game design
● educational experiment design
● outdoor case, auto indicator
● system integration for industrial equipment
● art creativity
● stage light control
● landscape light control
● DIY toy
● shop sign for advertisement

Customize:

● customize PCB and case
● customize firmware for module integration
● switch to bluetooth communication, for mobile control
● RS232 interfaced

Attention:

● commands in lamp mode are very similar to L1 signal lamp, easy for replacement
● NMOS driver board needs 12~24V DC power

Software

Serial Communication FAQ
C Programming FAQ

Serial command:

=>light --help
usage: light [-i index] [-r] [-s] [-p power] [-f freq] [-c counter]
options:
 -i/--idx        index param
 -r/--reset      reset channel(s)
 -s/--sync       sync all channels
 -p/--power      PWM modulation 0~100 %
 -f/--freq       0~20 Hz(default 1)
 -c/--counter    blink down-counter
=> 

Example:

(after poweron and self-test, all channel outputs are disabled)
set #0 lamp 100% power, no blink:
=>light -i0 -p100 -f0 -c -1
=> 
set #1 lamp 50% power, 5Hz, blink 10 cycles and set off:
=>light -i1 -p50 -f5 -c10
=> 
cancel the cycle limit for #1, blinks forever:
=>light -i1 -c -1
=> 
set all channels synchronized
=>light -s
=> 

Python API:

Install: sudo pip3 install mcush
Upgrade: sudo pip3 install -U mcush
class ShellLabSpotLight(mcush.Mcush.Mcush):
    def light(self, index=None, power=None, freq=None, count=None, reset=None, sync=None):
        # lower level serial command
    
    def reset(self):
        # state reset

    def sync(self):
        # keep all channels phase synchronized

Examples:

import mcush
from mcush.linkong.ShellLab import ShellLabSpotLight
s = ShellLabSpotLight('COM10')  # fill the actual serial port
s.light(index=0, power=100, freq=2)  # set #0 maximum power and blink in 2Hz

Download:

Shell Lab Testbench Application


CH341 VCP Driver(Windows)


Application

Strips blink/breathe effect

Tower lamp blink effect


Configured as sensor/key triggered blink/beep alarm
# this script runs in ShellLab Testbench Application
fcfs = Utils.FCFS()

fcfs.appendFile("init", '''\
delay
gpio -p0.4 -i
test -p0.4 load /c/stop
load /c/alarm
''')

fcfs.appendFile('stop', '''\
e 0
s -i0 -c1
s -i1 -c1
s -i2 -c1
s -i3 -c1
load /c/pre_check
''')

fcfs.appendFile('alarm', '''\
e 1
s -i0 -p100 -f1 -c -1
s -i1 -p100 -f1 -c -1
s -i2 -p100 -f1 -c -1
s -i3 -p100 -f1 -c -1
s -s
load /c/post_check
''')

fcfs.appendFile('pre_check', '''\
delay 100
test -p0.4 load /c/pre_check
delay 100
test -p0.4 load /c/pre_check
load /c/alarm
''')

fcfs.appendFile('post_check', '''\
delay 100
test -n -p0.4 load /c/post_check
delay 100
test -n -p0.4 load /c/post_check
load /c/stop
''')

s = ShellLabSpotLight(PORT)
s.fcfsFormat()
s.fcfsProgram(fcfs.generate())
s.port.write('reboot\n')
Code effect