Initial release

This commit is contained in:
Kujiu 2020-12-26 18:19:24 +01:00
parent d693cae6b5
commit dabf591f3a
Signed by: kujiu
GPG Key ID: ABBB2CAC6855599F
9 changed files with 27552 additions and 2 deletions

250
3dparts/lithophane.scad Normal file
View File

@ -0,0 +1,250 @@
litho_height = 100;
litho_width = 70;
litho_support = 5;
middle_width = 15;
base_height = 35;
wall_width = 4;
panel_thick = 2;
tolerance = 1;
base_width = litho_width + 2*litho_support + 6*wall_width;
top_height = 20;
top_r1 = base_width;
top_r2 = 2*litho_support;
top_r3 = 2*litho_support;
module base() {
module baseform(width, height, cylinder_r, cylinder_offset) {
union() {
cube([width, width, height]);
translate([-cylinder_offset, -cylinder_offset, 0])
cylinder(r1=cylinder_r, r2=litho_support, h=0.75*height);
translate([width+cylinder_offset, -cylinder_offset, 0])
cylinder(r1=cylinder_r, r2=litho_support, h=0.75*height);
translate([-cylinder_offset, width+cylinder_offset, 0])
cylinder(r1=cylinder_r, r2=litho_support, h=0.75*height);
translate([width+cylinder_offset, width+cylinder_offset, 0])
cylinder(r1=cylinder_r, r2=litho_support, h=0.75*height);
}
}
module angle() {
difference() {
cube([
litho_support+3*wall_width,
litho_support+3*wall_width,
litho_height+base_height+wall_width+litho_support]);
translate([wall_width, 3*wall_width, base_height-litho_support])
cube([
wall_width,
litho_support+wall_width,
litho_height+2*litho_support+2*wall_width]);
translate([3*wall_width, wall_width, base_height-litho_support])
cube([
litho_support+2*wall_width,
wall_width,
litho_height+2*litho_support+2*wall_width]);
};
}
union() {
difference() {
baseform(
base_width,
base_height,
litho_support+2*wall_width, -litho_support);
translate([
3*wall_width,
3*wall_width,
wall_width]
)
cube([
base_width-6*wall_width,
base_width-6*wall_width,
base_height]);
translate([
wall_width,
wall_width,
base_height-litho_support-wall_width]
)
cube([
base_width-2*wall_width,
base_width-2*wall_width,
base_height]);
translate([base_width/2-20, 3*wall_width, base_height/2-3]) rotate([90, 0, 0])
cylinder(r=10.25, h=4*wall_width, $fn=100); //power button
translate([base_width/2, 3*wall_width, base_height/2-9]) rotate([90, 0, 0])
cylinder(r=4, h=4*wall_width, $fn=100); //color button
translate([base_width/2, 3*wall_width, base_height/2+3]) rotate([90, 0, 0])
cylinder(r=4, h=4*wall_width, $fn=100); //mode button
translate([base_width/2+20, 3*wall_width, base_height/2]) rotate([90, 0, 0])
cylinder(r=4.25, h=4*wall_width, $fn=100); //power jack
translate([base_width/2-35, panel_thick, wall_width])
cube([42, 4*wall_width, base_height-litho_support-wall_width]);
translate([base_width/2+15, panel_thick, wall_width])
cube([12, 4*wall_width, base_height-litho_support-wall_width]);
}
// Four angles
angle();
translate([base_width, 0, 0]) rotate([0, 0, 90]) angle();
translate([base_width, base_width, 0]) rotate([0, 0, 180]) angle();
translate([0, base_width, 0]) rotate([0, 0, -90]) angle();
translate([0, 0, base_height+litho_height])
difference() {
cube([base_width, base_width, litho_support+wall_width]);
translate([wall_width, wall_width, -wall_width])
cube([
base_width-2*wall_width,
base_width-2*wall_width,
litho_support+3*wall_width]);
}
translate([
base_width/2-middle_width/2,
base_width/2-middle_width/2,
wall_width
]) cube([middle_width, middle_width, base_height+litho_height]);
// card supports
translate([18, base_width-45, wall_width])
difference() {
cube([35+2*panel_thick, 26+2*panel_thick, 3*wall_width]);
translate([panel_thick, panel_thick, wall_width])
cube([35, 26, 4*wall_width]);
translate([35-panel_thick, panel_thick+5, wall_width])
cube([4*panel_thick, 16, 4*wall_width]);
};
translate([18, base_width-60, wall_width])
difference() {
cube([16+2*panel_thick, 13+2*panel_thick, 3*wall_width]);
translate([panel_thick, panel_thick, wall_width])
cube([16, 13, 4*wall_width]);
};
}
}
module inside_plate(height) {
difference() {
cube([
base_width-2*wall_width-2*tolerance,
base_width-2*wall_width-2*tolerance,
height]);
translate([-wall_width, -wall_width, -height]) cube([
litho_support+4*wall_width,
litho_support+4*wall_width,
3*height
]);
translate([
base_width-litho_support-5*wall_width,
-wall_width,
-height])
cube([
litho_support+4*wall_width,
litho_support+4*wall_width,
3*height
]);
translate([
-wall_width,
base_width-litho_support-5*wall_width,
-height
]) cube([
litho_support+4*wall_width,
litho_support+4*wall_width,
3*height
]);
translate([
base_width-litho_support-5*wall_width,
base_width-litho_support-5*wall_width,
-height
]) cube([
litho_support+4*wall_width,
litho_support+4*wall_width,
3*height
]);
}
}
module separator() {
translate([wall_width+tolerance, wall_width+tolerance, base_height-litho_support-wall_width])
difference() {
inside_plate(wall_width);
translate([
base_width/2-wall_width,
base_width/2-wall_width,
-wall_width
]) cylinder(r=middle_width, h=3*wall_width);
};
}
module top() {
translate([0, 0, base_height+litho_height+2*wall_width])
union() {
translate([
wall_width+tolerance,
wall_width+tolerance, 0])
inside_plate(2*(litho_support-wall_width));
translate([0, 0, 2*(litho_support-wall_width)])
difference() {
translate([
base_width/2,
base_width/2,
top_height/2
]) cylinder(
h=top_height,
r1=top_r1,
r2=top_r2,
center=true,
$fn=100);
translate([
base_width/2,
-1.7*top_r1,
5.25*top_r1
]) sphere(r=5.5*top_r1, $fn=100);
translate([
-1.7*top_r1,
base_width/2,
5.25*top_r1
]) sphere(r=5.5*top_r1, $fn=100);
translate([
base_width/2,
base_width+1.7*top_r1,
5.25*top_r1
]) sphere(r=5.5*top_r1, $fn=100);
translate([
base_width+1.7*top_r1,
base_width/2,
5.25*top_r1
]) sphere(r=5.5*top_r1, $fn=100);
};
translate([
base_width/2,
base_width/2,
top_r3/2+top_height
]) sphere(r=top_r3);
};
}
base();
//separator();
//top();

17264
3dparts/lithophane_base.stl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8402
3dparts/lithophane_top.stl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
# lithophane_lantern

25
README.rst Normal file
View File

@ -0,0 +1,25 @@
Lithophane Lantern
==================
These files are under EUPL-1.2 license. You can use them as is, without
any guarantee.
The 100Ω resistor must be adapted in function of your WS2812 strip
and your level shifter board.
Each lithophane panel is 108x78mm including 4mm border and 3mm thickness.
Do not forget to create positive images, not negative ones.
You need :
- `2 push buttons <https://www.reichelt.de/de/en/miniature-push-button-on-0-5-a-24-vac-black-t-250a-sw-p19987.html>`_;
- `1 power button <https://www.reichelt.de/de/en/rocker-switch-round-1x-on-off-ws-r13-112-aaaa-p105442.html>`_;
- `1 WS2812 strip <https://www.reichelt.de/de/en/led-strip-digital-rgb-150-leds-5-m-ws2812b-opt-st4491-p260970.html>`_
(cut four strips of three leds for each lantern);
- `1 D1 Mini <https://www.reichelt.de/de/en/d1-mini-esp8266-v3-0-d1-mini-p253978.html>`_;
- 1 level shifter (sorry, I lost the link...);
- 2 resistors of 1kΩ;
- 1 resistor of 100Ω (must be changed in function of strip and level shifter);
- 1 capacitor of 1000µF.
Install ESP8266 boards in your Arduino software and WS2812FX library.

139
arduino/lithophane.ino Normal file
View File

@ -0,0 +1,139 @@
#include <WS2812FX.h>
#define BRIGHTNESS 150
#define SPEED 1000
#define LED_COUNT 12
#define LED_SEGMENTS 4
#define LED_PIN D1
#define MODE_PIN D6
#define COLOR_PIN D7
#define TIMER_COLOR 60000
#define TIMER_MODE 480000
unsigned long now = 0;
unsigned long last_mode = 0;
unsigned long last_color = 0;
volatile unsigned short current_mode = 0;
volatile unsigned short current_color = 0;
volatile unsigned short increment_mode = 0;
volatile unsigned short increment_color = 0;
volatile bool auto_mode = true;
volatile bool auto_color = true;
const uint32_t colors_cycle [8] = {
0x777777,
0xFF0000,
0xFF6900,
0xFFF900,
0x05B600,
0x10F8FA,
0x002AFF,
0xFFD0B9
};
const unsigned int modes_cycle [7] = {
FX_MODE_STATIC,
FX_MODE_COMET,
FX_MODE_BREATH,
FX_MODE_FIRE_FLICKER,
FX_MODE_FIRE_FLICKER_INTENSE,
FX_MODE_FIRE_FLICKER_SOFT,
FX_MODE_SCAN
};
const unsigned int speed_cycle [7] = {
1000,
200,
200,
200,
200,
200,
1000
};
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void ICACHE_RAM_ATTR changeModeInterrupt() {
bool color_state = digitalRead(COLOR_PIN);
if(color_state) {
auto_mode = true;
auto_color = true;
} else {
auto_mode = false;
}
increment_mode++;
}
void ICACHE_RAM_ATTR changeColorInterrupt() {
bool mode_state = digitalRead(MODE_PIN);
if(mode_state) {
auto_mode = true;
auto_color = true;
} else {
auto_color = false;
}
increment_color++;
}
void setup() {
int size = LED_COUNT/LED_SEGMENTS;
int seg=0;
pinMode(MODE_PIN, INPUT_PULLUP);
pinMode(COLOR_PIN, INPUT_PULLUP);
attachInterrupt(
digitalPinToInterrupt(MODE_PIN),
changeModeInterrupt, RISING);
attachInterrupt(
digitalPinToInterrupt(COLOR_PIN),
changeColorInterrupt, RISING);
ws2812fx.init();
ws2812fx.setBrightness(BRIGHTNESS);
for(seg=0; seg<LED_SEGMENTS; seg++) {
ws2812fx.setSegment(
seg,
seg*size, (seg+1)*size-1,
modes_cycle[current_mode], colors_cycle[current_color],
speed_cycle[current_mode], seg%2==1);
}
ws2812fx.start();
}
void loop() {
int size = LED_COUNT/LED_SEGMENTS;
int seg = 0;
now = millis();
ws2812fx.service();
if(auto_mode && now-last_mode>TIMER_MODE) {
increment_mode++;
}
if(auto_color && now-last_color>TIMER_COLOR) {
increment_color++;
}
if(increment_mode>0 || increment_color>0) {
if(increment_mode>0) {
last_mode = now;
}
if(increment_color>0) {
last_color = now;
}
current_mode = (current_mode + increment_mode) % (sizeof(modes_cycle)/sizeof(modes_cycle[0]));
increment_mode = 0;
current_color = (current_color + increment_color) % (sizeof(colors_cycle)/sizeof(colors_cycle[0]));
increment_color = 0;
ws2812fx.resetSegmentRuntimes();
ws2812fx.setBrightness(BRIGHTNESS);
for(seg=0; seg<LED_SEGMENTS; seg++) {
ws2812fx.setSegment(
seg,
seg*size, (seg+1)*size-1,
modes_cycle[current_mode], colors_cycle[current_color],
speed_cycle[current_mode], seg%2==1);
}
}
}

33
electronic/lithophane.pro Normal file
View File

@ -0,0 +1,33 @@
update=22/05/2015 07:44:53
version=1
last_client=kicad
[general]
version=1
RootSch=
BoardNm=
[pcbnew]
version=1
LastNetListRead=
UseCmpFile=1
PadDrill=0.600000000000
PadDrillOvalY=0.600000000000
PadSizeH=1.500000000000
PadSizeV=1.500000000000
PcbTextSizeV=1.500000000000
PcbTextSizeH=1.500000000000
PcbTextThickness=0.300000000000
ModuleTextSizeV=1.000000000000
ModuleTextSizeH=1.000000000000
ModuleTextSizeThickness=0.150000000000
SolderMaskClearance=0.000000000000
SolderMaskMinWidth=0.000000000000
DrawSegmentWidth=0.200000000000
BoardOutlineThickness=0.100000000000
ModuleOutlineThickness=0.150000000000
[cvpcb]
version=1
NetIExt=net
[eeschema]
version=1
LibDir=
[eeschema/libraries]

261
electronic/lithophane.sch Normal file
View File

@ -0,0 +1,261 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title "Lithophane"
Date "2020-12-16"
Rev "1.0"
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L MCU_Module:WeMos_D1_mini U1
U 1 1 5FDA6103
P 2300 2550
F 0 "U1" H 2300 1661 50 0000 C CNN
F 1 "WeMos_D1_mini" H 2300 1570 50 0000 C CNN
F 2 "Module:WEMOS_D1_mini_light" H 2300 1400 50 0001 C CNN
F 3 "https://wiki.wemos.cc/products:d1:d1_mini#documentation" H 450 1400 50 0001 C CNN
1 2300 2550
1 0 0 -1
$EndComp
$Comp
L Logic_LevelTranslator:TXB0104D U2
U 1 1 5FDA7E52
P 5450 2450
F 0 "U2" H 5450 1661 50 0000 C CNN
F 1 "TXB0104D" H 5450 1570 50 0000 C CNN
F 2 "Package_SO:SOIC-14_3.9x8.7mm_P1.27mm" H 5450 1700 50 0001 C CNN
F 3 "http://www.ti.com/lit/ds/symlink/txb0104.pdf" H 5560 2545 50 0001 C CNN
1 5450 2450
1 0 0 -1
$EndComp
$Comp
L Connector:Jack-DC JPW1
U 1 1 5FDABB24
P 900 950
F 0 "JPW1" H 957 1275 50 0000 C CNN
F 1 "Jack-DC" H 957 1184 50 0000 C CNN
F 2 "" H 950 910 50 0001 C CNN
F 3 "~" H 950 910 50 0001 C CNN
1 900 950
1 0 0 -1
$EndComp
$Comp
L Switch:SW_Push SWCOLOR1
U 1 1 5FDB160A
P 3250 3450
F 0 "SWCOLOR1" H 3250 3735 50 0000 C CNN
F 1 "SW_Push" H 3250 3644 50 0000 C CNN
F 2 "" H 3250 3650 50 0001 C CNN
F 3 "~" H 3250 3650 50 0001 C CNN
1 3250 3450
1 0 0 -1
$EndComp
$Comp
L Switch:SW_Push SWMODE1
U 1 1 5FDB2C4A
P 4200 3450
F 0 "SWMODE1" H 4200 3735 50 0000 C CNN
F 1 "SW_Push" H 4200 3644 50 0000 C CNN
F 2 "" H 4200 3650 50 0001 C CNN
F 3 "~" H 4200 3650 50 0001 C CNN
1 4200 3450
1 0 0 -1
$EndComp
$Comp
L Device:R RCOLOR1
U 1 1 5FDB35C6
P 3050 4000
F 0 "RCOLOR1" H 3120 4046 50 0000 L CNN
F 1 "1000" H 3120 3955 50 0000 L CNN
F 2 "" V 2980 4000 50 0001 C CNN
F 3 "~" H 3050 4000 50 0001 C CNN
1 3050 4000
1 0 0 -1
$EndComp
$Comp
L Device:R RMODE1
U 1 1 5FDB3E44
P 4000 4000
F 0 "RMODE1" H 4070 4046 50 0000 L CNN
F 1 "1000" H 4070 3955 50 0000 L CNN
F 2 "" V 3930 4000 50 0001 C CNN
F 3 "~" H 4000 4000 50 0001 C CNN
1 4000 4000
1 0 0 -1
$EndComp
$Comp
L Device:R RLED1
U 1 1 5FDB41CF
P 6700 1850
F 0 "RLED1" H 6770 1896 50 0000 L CNN
F 1 "100" H 6770 1805 50 0000 L CNN
F 2 "" V 6630 1850 50 0001 C CNN
F 3 "~" H 6700 1850 50 0001 C CNN
1 6700 1850
1 0 0 -1
$EndComp
$Comp
L Device:CP CPW1
U 1 1 5FDB4901
P 2450 1000
F 0 "CPW1" H 2568 1046 50 0000 L CNN
F 1 "1000µF" H 2568 955 50 0000 L CNN
F 2 "" H 2488 850 50 0001 C CNN
F 3 "~" H 2450 1000 50 0001 C CNN
1 2450 1000
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR0101
U 1 1 5FDDDA9E
P 1400 850
F 0 "#PWR0101" H 1400 700 50 0001 C CNN
F 1 "+5V" H 1415 1023 50 0000 C CNN
F 2 "" H 1400 850 50 0001 C CNN
F 3 "" H 1400 850 50 0001 C CNN
1 1400 850
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR0102
U 1 1 5FDDE2EA
P 1000 4150
F 0 "#PWR0102" H 1000 3900 50 0001 C CNN
F 1 "GND" H 1005 3977 50 0000 C CNN
F 2 "" H 1000 4150 50 0001 C CNN
F 3 "" H 1000 4150 50 0001 C CNN
1 1000 4150
1 0 0 -1
$EndComp
$Comp
L Switch:SW_DPST_x2 SWPW1
U 1 1 5FDB0C50
P 1950 850
F 0 "SWPW1" H 1950 1085 50 0000 C CNN
F 1 "SW_DPST_x2" H 1950 994 50 0000 C CNN
F 2 "" H 1950 850 50 0001 C CNN
F 3 "~" H 1950 850 50 0001 C CNN
1 1950 850
1 0 0 -1
$EndComp
Wire Wire Line
1200 850 1400 850
Connection ~ 1400 850
Wire Wire Line
1400 850 1750 850
Wire Wire Line
2150 850 2450 850
Wire Wire Line
6700 2000 6700 2150
Wire Wire Line
6700 2150 5850 2150
Wire Wire Line
1000 4150 1200 4150
Connection ~ 1200 4150
Wire Wire Line
5450 4150 5450 3150
Connection ~ 5450 4150
Wire Wire Line
5350 1650 5350 1750
Wire Wire Line
5550 850 5550 1750
Connection ~ 5550 850
Wire Wire Line
2450 1150 1200 1150
Wire Wire Line
1200 1050 1200 1150
Connection ~ 1200 1150
Wire Wire Line
1200 1150 1200 4150
Connection ~ 2450 850
Wire Wire Line
2450 850 2950 850
Wire Wire Line
1200 4150 2300 4150
Connection ~ 3050 4150
Wire Wire Line
3050 4150 4000 4150
Connection ~ 4000 4150
Wire Wire Line
4000 4150 5450 4150
Wire Wire Line
5450 4150 7650 4150
Wire Wire Line
2300 3350 2300 4150
Connection ~ 2300 4150
Wire Wire Line
2300 4150 3050 4150
Wire Wire Line
2200 1750 2200 1250
Wire Wire Line
2200 1250 2950 1250
Wire Wire Line
2950 1250 2950 850
Connection ~ 2950 850
Wire Wire Line
2950 850 5550 850
Wire Wire Line
2400 1750 2400 1650
Wire Wire Line
2400 1650 3650 1650
Wire Wire Line
2700 2250 5050 2250
Wire Wire Line
5050 2250 5050 2150
Wire Wire Line
2700 2750 4000 2750
Wire Wire Line
4000 2750 4000 3450
Connection ~ 4000 3450
Wire Wire Line
4000 3450 4000 3850
Wire Wire Line
4400 3450 4700 3450
Wire Wire Line
4700 3450 4700 1650
Wire Wire Line
3450 3450 3650 3450
Wire Wire Line
3650 3450 3650 1650
Connection ~ 3650 1650
Wire Wire Line
2700 2850 3050 2850
Wire Wire Line
3050 2850 3050 3450
Connection ~ 3050 3450
Wire Wire Line
3050 3450 3050 3850
Wire Wire Line
3650 1650 4700 1650
Connection ~ 4700 1650
Wire Wire Line
4700 1650 5350 1650
$Comp
L Connector_Generic:Conn_01x03 JSTLED1
U 1 1 5FEEAD87
P 8250 950
F 0 "JSTLED1" H 8330 992 50 0000 L CNN
F 1 "JST-SM 3 Pins" H 8330 901 50 0000 L CNN
F 2 "" H 8250 950 50 0001 C CNN
F 3 "~" H 8250 950 50 0001 C CNN
1 8250 950
1 0 0 -1
$EndComp
Wire Wire Line
5550 850 8050 850
Wire Wire Line
6700 950 8050 950
Wire Wire Line
6700 950 6700 1700
Wire Wire Line
7650 1050 8050 1050
Wire Wire Line
7650 1050 7650 4150
$EndSCHEMATC