code for split-flap display

Overview

split-flap

3D-files here: https://www.prusaprinters.org/prints/69464-split-flap-display

General

The display's electronics use one esp01 as the master and up to 16 arduinos as slaves. The esp handles the webinterface and communicates to the units via I2C. Each unit is resposible for setting the zero position of the drum on startup and displaying any letter the master send its way.

Assemble everything according to the instruction manual.

PCB

Gerber files are in the pcb folder. You need one per unit. Populate components according to the instruction manual on prusaprinters.

Unit

Each split-flap unit consists of an arduino nano mounted on a custom pcb. It controls a 28BYJ-48 stepper motor via a ULN2003 driver chip. The drum with the flaps is homed with a KY003 hall sensor and a magnet mounted to the drum.

Upload the arduino sketch "unit.ino" in the unit folder to each unit's arduino nano. Before that set the offset with the "eeprom write offset" sketch.

set zero position offset

The zero position (or blank flaps position in this case) is attained by driving the stepper to the hall sensor and step a few steps forward. This offset is individual to every unit and needs to be saved to the arduino nano's EEPROM.

I wrote a simple sketch to set the offset. Upload the "EEPROM_Write_Offset.ino" sketch and open the serial monitor with 9600 baudrate. It will tell you the current offset and you can enter a new offset. It should be around 100. You may need to upload the "unit.ino" sketch and see if the offset is correct. Repeat until the blank flap is showing every time the unit homes.

set unit address

Every units address is set by a DIP switch. They need to be set ascending from zero in binary. This is how my 10 units are set, 1 means switch is in the up-position:

Unit 1 Unit 2 Unit 3 Unit 4 Unit 5 Unit 6 Unit 7 Unit 8 Unit 9 Unit 10
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001

ESP01

To upload the sketch to the ESP01 you need to install a few things to your arduino IDE.

To upload sketches to the ESP01 you can either use an Arduino https://create.arduino.cc/projecthub/pratikdesai/how-to-program-esp8266-esp-01-module-with-arduino-uno-598166 or you can buy a dedicated programmer. I highly recommend getting a programmer as it makes uploading programs onto the ESP01 much faster.

Open the sketch "ESPMaster.ino" in the ESPMaster folder, change your board to "Generic ESP8266 Module", choose the correct COM-port and click Tools->ESP8266 LittleFS Data Upload. This uploads the website onto the ESP01's file system.

change sketch values

Modify the sketch where it says // REPLACE WITH YOUR NETWORK CREDENTIALS const char* ssid = "SSID"; const char* password = "12345678901234567890"; and insert your network's credentials.

Also change the timeoffset to your timezone: #define TIMEOFFSET 7200 It is defined as offset in seconds from GMT.

final upload

Now you only need to upload the sketch and you are done. Stick the ESP01 onto the first unit's PCB and navigate to the IP-adress the ESP01 is getting assigned from your router.

Comments
  • ESP01 communication with unit not working / how to debug

    ESP01 communication with unit not working / how to debug

    Dear David, first of all thanks for sharing your great design! I am in progress of making a version with laser-cut flaps out of 0.8 mm black acrylic with cut-plot letters - I will share those files when I've got them working.

    However, I can't get the ESP01 communicate with the unit. I debugged the unit and put in some additional output via serial console and have the unit working properly and go to all letters fine. I put in some more serial message into unit to see if unit gets any messages from the ESP - receiveLetter in the unit never fires.

    So perhaps you do have a hint on how to debug the ESP01; I am not sure how to see the output of #serial on the IDE (while it is plugged into the unit board).

    Thanks in advance for any hints.

    opened by rkuerbitz 4
  • Connecting and sending first text but not more

    Connecting and sending first text but not more

    Hi, Finished the project. Thank you very much for your effort to share it. Great documentation for a beginner like me.

    I can connect to 10 digit unit with ip address of ESP01. I can send the first text message. But when I send a second message nothing happens. When I check the packets sent and received to esp01 from the router I see the packages sent. When I cut the power and power on again all digits turn to show blank flap than I see the last message (the message which lost) I sent before cutting the power. So, for a new message on split flap I need to cut power and re connect it. The clock shows up but it does not changing the minute digit. I think this is also related to my problem.

    Could the community please share their opinions about the my problem?

    Thank you in advance.

    opened by diablex2 3
  • return false missing in FlapFunctions

    return false missing in FlapFunctions

    Hi Dave, my compiler from the Arduino IDE moans if the return false; is missing in the translateLetterToInt function is missing. Mine looks now like this:

    //translates char to letter position
    int translateLettertoInt(char letterchar) {
      for (int i = 0; i < FLAPAMOUNT; i++) {
        if (letterchar == letters[i]) {
          return i;
        }
      }
      return false; //ADDED
    }
    
    opened by Klimbim1 3
  • unit.ino not compiling when #define test uncommented

    unit.ino not compiling when #define test uncommented

    Hi Dave,

    First let me congratulate you for that exellent project! I am still building the clock, as parts arrive step by step from China. I tried to upload the unit.ino file to my chinese Arduino Nanos, which worked after I switched to "ATmega328P (Old Bootloader) in "Tools" -> "Processor". Upload went fine. But as soon as I uncomment Line 6: "#define test" it will not compile anymore and is throwing the following error:

    Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"
    ...\split-flap-master\unit\unit.ino: In function 'void loop()':
    
    unit:134:36: error: cannot convert 'String' to 'int' for argument '1' to 'void rotateToLetter(int)'
    
         rotateToLetter(currentCalLetter);
    
                                    ^
    
    exit status 1
    
    cannot convert 'String' to 'int' for argument '1' to 'void rotateToLetter(int)'
    

    Seems to be some sort of type conversion error. Could you have a look at it? I don't get it at the moment. It seems that you want to be able to show these sequence: " ", "Z", "A", "U", "N", "?", "0", "1", "2", "9" but on the other hand the function rotateToLetter() seems to only take in integers (probably the numer of the tile which contains the desired letter?

    Best Regards and many thanks!

    Sergio

    opened by sergios100 3
  • [Nano Every]

    [Nano Every] "'ADCSRA' was not declared in this scope"

    So i accidentally bought an "Arduino Nano Every" instead of a regular "Arduino Nano" which apparently uses a different chip (ATMega4809).

    When i try to upload/verify the "unit" sketch im getting the following error:

    D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino: In function 'void loop()': unit:99:23: error: 'ADCSRA' was not declared in this scope byte old_ADCSRA = ADCSRA; ^~~~~~ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:99:23: note: suggested alternative: 'ADC_t' byte old_ADCSRA = ADCSRA; ^~~~~~ ADC_t unit:116:5: error: 'TWCR' was not declared in this scope TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^~~~ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:116:5: note: suggested alternative: 'TWI0' TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^~~~ TWI0 In file included from C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Interrupts.h:8:0, from C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/ArduinoAPI.h:29, from C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/Arduino.h:23, from D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:8: unit:116:16: error: 'TWEN' was not declared in this scope TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:116:16: note: suggested alternative: 'TWI0' TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ unit:116:28: error: 'TWIE' was not declared in this scope TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:116:28: note: suggested alternative: 'TWI0' TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ unit:116:40: error: 'TWEA' was not declared in this scope TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:116:40: note: suggested alternative: 'TWI0' TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ unit:116:52: error: 'TWINT' was not declared in this scope TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ D:\3D Print\SplitFlap\split-flap-master\unit\unit.ino:116:52: note: suggested alternative: 'TWI_t' TWCR = bit(TWEN) | bit(TWIE) | bit(TWEA) | bit(TWINT); ^ C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/Common.h:71:25: note: in definition of macro 'bit' #define bit(b) (1UL << (b)) ^ Using library Wire at version 1.0 in folder: C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire Using library Stepper at version 1.1.3 in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries\Stepper Using library EEPROM at version 2.0 in folder: C:\Users\49160\Documents\ArduinoData\packages\arduino\hardware\megaavr\1.8.7\libraries\EEPROM exit status 1 'ADCSRA' was not declared in this scope

    Is there a way to rewrite / adapt the code for this processor by maybe "just" chaning the variable names of the registers or will this be a futile attempt and im better of just buying a regular Nano instead?

    Greetings from Germany.

    opened by it-escher 2
  • Unit Frame Assembly Missing Holes for M3 nuts

    Unit Frame Assembly Missing Holes for M3 nuts

    First, thank you so much for this project. I've had to learn Arduino and how to order custom PCBs, so this great.

    In the instructions, section 5.2.2 says "Push two M3 nuts diagonally in the back of the frame. Use a screw to pull the nut if necessary."

    I think this is to mount the stepper motor, but there are no holes in the unit frame for the M3 nuts under the stepper motor.

    opened by ThomDyson 2
  • V2 version idea: ESP32 with A4988

    V2 version idea: ESP32 with A4988

    ESP32 has more than 21 GPIO pins needed for 10 flaps version, so with single MCU you could do all the work. Unless I am missing something.

    Tie A4988 DIR pin to make it only spin in one way.

    2 pins per flap: STEP and hall sensor output. 1 pin for ENA on all A4988 drivers.

    Additionally: add 12V LED strip support to illuminate the flaps and LDR to auto change the brightness.

    opened by Oxmaster 1
  • Last 3 digits won´t spin correctly

    Last 3 digits won´t spin correctly

    Hello,

    i have build your amazing splitflap... but i have a problem with the 3 last digits of my splitflap. As you can see in the video, all flaps are calibrating, after that the 5 middle ones start rotating till they display the correct time. But while the 5 middle ones are rotating, the last 3 start rotating until they get a timeout. https://youtu.be/CSe2SAsITus

    I have no idea what´s going on here. Tried to switch the nanos, the units, the cables but i couldn´t get it right? Anyone have a idea what i can test here?

    opened by NoI3ody 4
  • replace I2C with SPI Daisy Chain

    replace I2C with SPI Daisy Chain

    Hi Dave,

    at frist awesome project. and i think i will build it after christmas.

    i have an idea for ESP -> Arduino Nano communication. you get the I2C addresses via DIP Switches. my idea, the same method as with the ws2812b. a kind of SPI daisy chain. you connect ESP -> split flap 0 -> split flap 1 ......

    problem is, you need to have two SPI Interfaces on the MCU. so thats not possible with the Nano, but maybe another Board like Nucle-G031.

    but with my idea you don´t need the DIP Switches and the Display is not limited to 16 Segments.

    so what do you think? do you see any problems?

    opened by instaibil 0
  • shortage of C5

    shortage of C5

    Hey Dave, thanks for this cool project. I'm not an electronics expert, especially when it comes to soldering SMT elements, that's why I wanted to order these assembled from JLCPCB. However, they are in shortage of "CA45-A-10V-22μF-K" (C5). Can this be replaced with something similar? Can you recommend? Thanks!

    opened by lewpaw 4
Display array is a board that sets 6 ST7735 display with a resolution of 80x160px in a linear array sharing the clock, data, rs, backlight pins together

The display array is a board that sets 6 ST7735 display with a resolution of 80x160px in a linear array sharing the clock, data, rs, backlight pins together, and leaving individual access to the cs lines of each display, This board allows you to display images with a resolution of 480x160px.

Josue Alejandro Gutierrez 70 Dec 19, 2022
split89 keyboard - a 3d printed 89 key split TKL keyboard base powered by ATmega32U4 Pro Micro controllers with QMK Configurator support.

split89 keyboard - a 3d printed 89 key split TKL keyboard base powered by ATmega32U4 Pro Micro controllers with QMK Configurator support. This keyboar

null 54 Jan 7, 2023
keyball is split keyboard has 100% track ball

keyball Keyball is split keyboard has 100% track ball Firmware build guide Keyball46 have separate firmwares for each of PCBs w/ trackball and w/o tra

null 145 Dec 26, 2022
An extremely basic Python script to split word-based data into high and low byte files.

An extremely basic Python script to split word-based data into high and low byte files. This is for use in programming 16 bit computer ROMs.

null 2 Dec 2, 2022
A rosbag2 recorder node that backs up split files to an external location during recording

System Data Recorder (SDR) A lifecycle node and executable for recording topic data to a rosbag2 bag, while simultaneously copying the split bag files

Open Robotics 5 Aug 31, 2022
Monitor based on perf_event: split-lock, irq-off, profile, task-state, watchdog, kmemleak, kvm-exit, mpdelay

基于perf的监控框架 基于libperf和libtraceevent库实现简单的监控框架,提供比perf更灵活的特性。 数据不落盘。 数据过滤,基于tracepoint的过滤机制,减少数据量。 数据实时处理并输出。不需要存盘后再处理。 基于perf_event_open系统调用。 虽然比perf更

null 23 Dec 20, 2022
A split-screen menu page

split_screen_menu A split-screen menu page Getting Started ###isMobileLayout retun bool SplitScreenMenu menu Widget initialRoute String? initPage Widg

Chans 4 Feb 19, 2022
Send messages to a LED Matrix display through Telegram. Inspired by a tweet from Smarter Every Day

Send messages to a LED Matrix display through Telegram. Inspired by a tweet from Smarter Every Day

Brian Lough 23 Oct 8, 2022
Lotus 1-2-3 R4D Display Driver for DOSEMU

Lotus 1-2-3 R4D Display Driver for DOSEMU2 This is a WIP display driver for Lotus 1-2-3 R4D to enable support for arbitrary text resolutions in DOSEMU

Tavis Ormandy 112 Dec 2, 2022
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

null 19 Oct 15, 2022
Using the LilyGo EPD 4.7" display to show OWM Weather Data

LilyGo-EPD-4-7-OWM-Weather-Display Using the LilyGo EPD 4.7" display to show OWM Weather Data Version 2.72 Improved Icon shapes and positioning Adjust

G6EJD 13 Apr 2, 2021
VGA/TV display on Raspberry Pico

PicoVGA - VGA/TV display on Raspberry Pico

Miroslav Nemecek 115 Jan 3, 2023
A tiny external monitor for PC using STM32 and ST7789. Connects to PC over USB and displays the captured screen on ST7789 (240x240) display.

STM32 Tiny Monitor A super tiny monitor for your PC, suitable for your pet ant. A python script sends the captured screen over USB to the STM32 microc

Avra Mitra 69 Dec 27, 2022
A Flutter Web Plugin to display Text Widget as Html for SEO purpose

SEO Renderer A flutter plugin (under development) to render text widgets as html elements for SEO purpose. Created specifically for issue https://gith

Sahdeep Singh 103 Nov 21, 2022
Fully Featured Time Circuits Display from Back to the Future

Time Circuits Display This Time Circuits Display has been meticulously reproduced to be as accurate as possible to the one seen in the Delorean Time M

John 64 Dec 29, 2022
Next gen. of NekoCal: An open-source hackable and programmable e-paper display

NekoInk NekoInk is an open-source, programmable, and versatile E-paper display platform. It offers connectivity options to various type of E-paper scr

Wenting Zhang 51 Nov 16, 2022
A hacky e-ink display for Home Assistant sensors

This is a hacky PlatformIO project in which Home Assistant data is displayed in an e-ink display. Useful Links Display Hardware on Tindie Official Git

null 55 Sep 21, 2022
PicoQVGA - Minimalistic QVGA Display on Raspberry Pico

Minimalistic QVGA Display on Raspberry Pico with resolution 320x240/8bit, suitable as tutorial to PIO and DMA.

Miroslav Nemecek 18 Dec 28, 2022
Remote Arduino Uno-based TFT graphical display for VSR Mini Mega Alternator Regulator

VSMMAR_Remote_Display Remote Arduino Uno-based TFT graphical display for VSR Mini Mega Alternator Regulator This project is an optional accessory for

null 1 Nov 6, 2021