Skip to the content
PCBKitNew board
2 layersLSaber1, the printed circuit board in 3D

IOT Lightsaber Wall Light

Copper layers
2
Thickness
1.6 mm
Parts
21
Nets
59
Pads
149
Tracks, vias
112, 0
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
28 Nov 2021
Updated
1 May 2023

Overview

LSaber1 is an open-source printed circuit board by jondurrant, from the jondurrant/LSaber1 repository on GitHub, published under the MIT licence. It is a 2-layer board with 21 parts on 59 nets, routed with 112 tracks and 0 vias.

Its parts include 7 resistors, 5 connectors, 3 ICs, 1 capacitor and 1 diode. It belongs with the home automation and IoT boards and the ESP8266 and RP2040 boards of this library.

README

README.md

LSaber1

IOT Saber Wall Light based on Raspberry PI Pico, ESP-01S and WS2812 LEDs.

PIR and Switch activated wall light. Works as a group able to turn each other on and off via MQTT hub topics.

Hardware

  • Raspberry Pico
  • ESP-01S (1Mb) running ESP-AT 2.1
  • WS2812 144 LED strip
  • AM312 PIC
  • RGB CC LED
  • Resistors and Caps as in Schema
  • 5Amp 5Volt power supply
  • 5 Amp Fuse and 100C Thermal Fuse
  • M2 inserts for scew fixing of PCB to case and pommel onto case

Schema

A circuit diagram is available in KICAD format. Included in PCB folder.

Warning: The LEDs will draw 4Amps of current. You should assure yourself that the circuit and wiring can safely deliver that current.

ESP-01S

I got very cheap pack of ESP-01S but they came with 1Mb flash. Latest version of ESP-AT, version 2.2, requires 2MB.

Fortunatly Jandrassy has built a working 2.1 firmware for 1MB. This is on github at: https://github.com/jandrassy/WiFiEspAT

To reliably upload the firmware to ESP-01S requires the RST IO0 to get pulled to zero and the released. Some further inform on how to do this at: https://blog.tiga.tech/flashing-esphome-firmware-to-esp-01s/

I used the RPI 4 to upload the firmware and the esptool.py. I had to drop frequency to 40m and change upload mode to dout in the download.config file. Then use the command esptool.py --port /dev/ttyS0 write_flash @download.config

Case

Case is 3D printed in PLA. I've modelled the case and wall mounts for the case in OpenSCAD. The model and SLA files available in the 3dmodels folder.

Blade

Blade is a 20mm x 3mm x 1000mm OPAL Acrylic Tube. You can find these on ebay, though I found ebay quite expensive. Bought mine from The Clear Plastic Shop in the UK.

Software

C++ - For Raspberry PICO

Python - Management Software

  • TwinThingPyMQTT - Python version of IOT Library, including TwinMgr which is how the management software talks to all the devices.
  • Python3
  • dotmap
  • numpy
  • paho-mqtt
  • pandas
  • PyMySQL
  • pyOpenSSL
  • SQLAlchemy
  • twinThing
  • mysql Db
  • emqx using Mysql authentication
  • Joern Weissenborn LCARS - LCARS Look and feel

Python Test Code

Some test code to interact with the api are included in py/test folder. They expect some environment variables to point to the MQTT hub and credentials.

  • MQTT_USER - Username and Client Id to connect to MQTT
  • MQTT_PASSWD - Password to authenticate against MQTT
  • MQTT_HOST - Hostname of MQTT server
  • MQTT_PORT - Port that MQTT is listen on, normally 1883

Build and Deploy

##Clone project ''' git clone --recurse-submodules https://github.com/jondurrant/LSaber1 ''' main.cpp include "Credentials.env" for the Wifi AP name and passwd, MQTT Host, Port, Username and password. I've not included this file in the repo. Please create one looking something like this:

C++
#define SID "SID"
#define PASSWD "PWD"

#define MQTTHOST "IP"
#define MQTTPORT 1883
#define MQTTUSER "jon"
#define MQTTPASSWD "PWD"

To build C++:

bash
mkdir build
cd build
cmake ..
make
make install (only work if you used my config setup in the Pico Intro course as does SWD upload of code direct from make).

For more on how I use a Raspberry PI to build, deploy code and debug the Pico see my course on Udemy

Python Management Deployment

I have included a Docker file to build an image for the management software. It manipulates the Python path to include the right libraries, along with loading some from requirements.txt.

EMQX

Setup EMQX using mysql authentication and acl. The TwinThingPyMQTT repo include the DDL to create the required tables.

Lights authenticate using the MAC address of the device for Client Id, Username and Password. They will require permissions within EMQX to access:

text
[
	{
	  "topic": "GRP/ALL/TPC/#",
	  "action": "sub",
	  "access": "allow"
	},
	{
	  "topic": "TNG/$CLIENTID/#",
	  "action": "pubsub",
	  "access": "allow"
	},
	{
	  "topic": "GRP/saber/TPC/#",
	  "action": "pubsub",
	  "access": "allow"
	}
]

The Management software will need access to:

text
[
	{
	  "topic": "GRP/ALL/TPC/#",
	  "action": "sub",
	  "access": "allow"
	},
	{
	  "topic": "TNG/$CLIENTID/#",
	  "action": "pubsub",
	  "access": "allow"
	},
	{
	  "topic": "GRP/saber/TPC/#",
	  "action": "pubsub",
	  "access": "allow"
	},
	{
	  "topic": "GRP/saber/TWIN/RES",
	  "action": "sub",
	  "access": "allow"
	},
	{
	  "topic": "GRP/saber/TWIN/GET",
	  "action": "pub",

Parts

21
QtyValueFootprintReferences
392RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3, R4, R5
210RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2
2Conn_01x03_MaleConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ4, J5
2Screw_Terminal_01x02TerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ1, J2
110KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7
1330RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6
1CPCapacitor_THT:CP_Radial_D10.0mm_P5.00mmC1
1ESP-01v090ESP8266:ESP-01U2
1Fuse 5AFuse:Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_OpenF1
1LED_RCGBLED_THT:LED_D5.0mm-4_RGB_Wide_PinsD1
1PicoMCU_RaspberryPi_and_Boards:RPi_Pico_SMD_THU1
1SPARKFUN_LOGIC_LEVEL_CONVERTERBoards:SPARKFUN_LOGIC_LEVEL_CONVERTERU3
1Screw_Terminal_01x03TerminalBlock:TerminalBlock_Altech_AK300-3_P5.00mmJ3

The 18 most common of 21 parts.

Questions

What parts does the LSaber1 use?

21 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the LSaber1 KiCad files?

From the jondurrant/LSaber1 repository on GitHub, at the commit this page was made from: the board is pcb/LSaber-1.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the LSaber1 design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers28.3 × 39.8 mmLevelShifter, the printed circuit board in 3D

    LevelShifter

    gusmanb/logicanalyzer

    24 channel, 100Msps logic analyzer hardware and software

    21 parts5.1kGPL-3.0
  • 2 layers171.2 × 72.9 mmAmiga gfxcard before pour, the printed circuit board in 3D

    Amiga gfxcard before pour

    mntmn/amiga2000-gfxcard

    MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog

    21 parts1k
  • 2 layers93.9 × 46 mmRectifier, the printed circuit board in 3D

    Rectifier

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    21 parts990GPL-3.0
  • 2 layers45.5 × 42.9 mmEsphome han reader, the printed circuit board in 3D

    Esphome han reader

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    21 parts915
  • 2 layers31.8 × 14.5 mmEsp prog, the printed circuit board in 3D

    Esp prog

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    21 parts744MIT
  • 2 layers23.5 × 15.8 mmQuiverAttachPCB, the printed circuit board in 3D

    QuiverAttachPCB

    Arrow-air/project-quiver

    Project Quiver documentation, designs, and project artifacts.

    21 parts617CERN-OHL-S-2.0
  • 2 layers69.9 × 41.3 mmHeaterMeterLCD, the printed circuit board in 3D

    HeaterMeterLCD

    CapnBry/HeaterMeter

    HeaterMeter and LinkMeter Arduino BBQ Controller

    21 parts557MIT
  • 2 layers161.3 × 111.8 mmDoj, the printed circuit board in 3D

    Doj

    kelu124/echomods

    Open source ultrasound processing modules and building blocks

    21 parts463