{"id":18290245,"url":"https://github.com/danielkummer/nixon-pi","last_synced_at":"2025-08-23T05:33:24.415Z","repository":{"id":5081421,"uuid":"6243641","full_name":"danielkummer/nixon-pi","owner":"danielkummer","description":"Control ogilumen nixie tubes with raspberry pi and abiocard shield","archived":false,"fork":false,"pushed_at":"2015-07-15T21:04:46.000Z","size":14872,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-05T10:33:30.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"collectiveidea/json_spec","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielkummer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-16T12:03:44.000Z","updated_at":"2019-05-15T06:09:55.000Z","dependencies_parsed_at":"2022-07-09T01:47:54.382Z","dependency_job_id":null,"html_url":"https://github.com/danielkummer/nixon-pi","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/danielkummer/nixon-pi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielkummer%2Fnixon-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielkummer%2Fnixon-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielkummer%2Fnixon-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielkummer%2Fnixon-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielkummer","download_url":"https://codeload.github.com/danielkummer/nixon-pi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielkummer%2Fnixon-pi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745599,"owners_count":24813509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T14:10:00.525Z","updated_at":"2025-08-23T05:33:24.390Z","avatar_url":"https://github.com/danielkummer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NIXON-\u0026#928; :: The Raspberry Pi based Nixie Display\n\n\nThe Nixon-\u0026#960; Display consists of **Nixie Tubes** provided by [Ogilumen](http://www.ogilumen.com/), driven by a **Raspberry Pi Model B** with an **I/O expansion card** from [Axiris](http://www.axiris.be/).\nIt's driven by a multi-threaded ruby application consisting of I/O drivers, state machines, a sinatra based web app and json api connected by message queues.\n\nWhat started out as a private idea found it's way into a mini-project on a __LAB__ team event from [Namics](http://www.namics.com).\n\nMany thanks to all who contributed and hopefully will contribute to this project!\n\n--------------------------\n\n**Jump to**\n\n- [Components](#components)\n- [Case](#case)\n- [Installation](#installation)\n- [Service](#service)\n- [Web Server](#web_server)\n- [API](#api)\n\n--------------------------\n\n##\u003ca id=\"components\" name=\"components\"\u003e\u003c/a\u003eComponents\n\nThe following main components were used for assembly, not mentioning wiring and tools.\n\n### 1x Raspberry Pi Model B\n\n\u003cimg src=\"http://www.raspberrypi.org/wp-content/uploads/2012/04/Raspi_Iso_Blue.png\" width=\"400\" \u003e\n---\nThe [Raspberry Pi](http://www.raspberrypi.org/) is ideal for the project as it's a fully flegded mini computer which is capable of running all the things we need.\n\nA standard installation with Debian Wheezy is recommended.\nInstall Ruby using the tutorial on [elinux](http://elinux.org/RPi_Ruby_on_Rails)\nAlso, use the overclock to increase the processor speed, but keep it in a normal range unless you've got good cooling on the 5v power limiter/supply.\n\nHere's a condensed list of the commands:\n\n\tsudo apt-get install -y git curl zlib1g-dev subversion\n\tsudo apt-get install -y openssl libreadline6-dev git-core zlib1g libssl-dev\n\tsudo apt-get install -y libyaml-dev libsqlite3-dev sqlite3\n\tsudo apt-get install -y libxml2-dev libxslt-dev\n\tsudo apt-get install -y autoconf automake libtool bison\n\tcurl -L get.rvm.io | bash -s stable\n\n\n### 1x [Axiris](http://www.axiris.be/) I/O Card for Raspberry Pi\n\n\u003cimg src=\"http://www.axiris.be/en/images/stories/bcm2835/bcm2835_013_500.jpg\" width=\"400\" \u003e\n---\nBecause the Raspberry Pi only has [limited IO capabilites](http://elinux.org/RPi_Low-level_peripherals) the [Axisis I/O card](http://www.axiris.be/en/index.php?option=com_content\u0026view=article\u0026id=51:i2c-io-card-for-use-with-raspberry-pi-computer\u0026catid=14:io-cards\u0026Itemid=34) is the perfect addition to fully satisfy our needs. It adds:\n\n* a very high accuracy real-time clock based on the PCF2129A with CR2032 backup battery.\n* 8 quasi bidirectional I/O lines (PCF8574), 5V levels.\n* 8 12-bit ADC inputs (MAX11614EEE+), 0 - 4.096V range.\n* 16 output channels providing 12-bit pulse-width modulation (PWM) output channels at about 40 to 1000 Hz with LED drive capability, 10 mA source, 25 mA sink, 5 V levels.\n\nThe repository contains a modified driver to allow direct console output - without the need to start a telnet server in order to control the expansion card.\nHowever, you're still able to use the telnet server while developing - with it you can remotely execute the code with a live connection.\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/io_card.png\" width=\"400\" \u003e\n\n1 lowel left, 2 upper left\n\n1. IO Ports\n\t1. I/O channel 0\n\t2. I/O channel 1\n\t3. I/O channel 2\n\t4. I/O channel 3\n\t5. I/O channel 4\n\t6. I/O channel 5\n\t7. I/O channel 6\n\t8. I/O channel 7\n\t9. GND\n\t10. 5 V output\n2. timestamp input\n\t1. PCF2129A TS input\n\t2. GND\n3. ADC input\n\t1. Analog input 0\n\t2. Analog input 1\n\t3. Analog input 2\n\t4. Analog input 3\n\t5. Analog input 4\n\t6. Analog input 5\n\t7. Analog input 6\n\t8. Analog input 7\n\t9. GND\n\t10. 5 V output\n4. PWM8-PWM15\n\t1. PWM driver pin PWM8\n\t2. PWM driver pin PWM9\n\t3. PWM driver pin PWM10\n\t4. PWM driver pin PWM11\n\t5. PWM driver pin PWM12\n\t6. PWM driver pin PWM13\n\t7. PWM driver pin PWM14\n\t8. PWM driver pin PWM15\n\t9. GND\n\t10. 5 V output\n5. PWM0-PWM7\n\t1. PWM driver pin PWM0\n\t2. PWM driver pin PWM1\n\t3. PWM driver pin PWM2\n\t4. PWM driver pin PWM3\n\t5. PWM driver pin PWM4\n\t6. PWM driver pin PWM5\n\t7. PWM driver pin PWM6\n\t8. PWM driver pin PWM7\n\t9. GND\n\t10. 5 V output\n\n### 6x Nixie Duo Kits\n\n\u003cimg src=\"http://www.ogilumen.com/images/product_pics/n2xdp1.jpg\" width=\"400\" \u003e\n---\n\n[Ogilumen](http://www.ogilumen.com/) sells beautiful, compact and easy to assemble nixie tube kits containing two IN-12A tubes each.\nSome electronics are needed so we're able to drive them using the 12-bit PWM channels.\n\n**Electric diagram**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/nixie_duo_diagram.png\" width=\"400\" \u003e\n\n\n### 4x IN-13 Bar Graphs\n\n\n\u003cimg src=\"http://www.ogilumen.com/images/product_pics/IN-13a.jpg\" width=\"400\" \u003e\n---\n\nThe IN-13 Neon Bar Graphs sold by Ogilumen are a beautiful way to display a variable length glowing bar.\n\n**Electric diagram**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/bargraph_diagram.png\" width=\"400\" \u003e\n\n\n### 5x IN-1 Neon\n\n\n\u003cimg src=\"http://www.ogilumen.com/images/product_pics/n1a.jpg\" width=\"400\" \u003e\n---\nThe IN-1 Neon Lamps are simply a nice LED-alternative and they have a nice warm orange glow...\n\n**Electric diagram**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/lamp_diagram.png\" width=\"400\" \u003e\n\n\n## 1x 50 mA Nixie Tube Power Supply\n\n\u003cimg src=\"http://www.ogilumen.com/images/product_pics/smps1.jpg\" width=\"400\" \u003e\n---\n\nIn the end we need a power supply to drive all our high-voltage Nixie goodness. Luckly ogilumen provides us with a readily assembled power supply capable of providing all the power we need...\nIf you want to power everything with a 12V power supply, use a voltage divider and a modified micro-usb jack to power the raspberry pi.\n\n**Voltage divider electric diagram**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/voltage_divider_diagram.png\" width=\"400\" \u003e\n\n##\u003ca id=\"case\" name=\"case\"\u003e\u003c/a\u003e Case\n\nThe casing gives the nixon-pi a retro look - it should remind one of a sixties radio. A swiss carpentry manufactured the wooden casing - the rest was assembled by hand.\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/front_plate.png\" width=\"800\"\u003e\n\n## \u003ca id=\"installation\" name=\"installation\"\u003e\u003c/a\u003eInstallation\n\nAlthough nixon-pi can be packed as a gem it's currently suggested to install it by cloning the repository.\nThe master branch contains the newest production release.\n\n--------------------------\n\n##\u003ca id=\"service\" name=\"service\"\u003e\u003c/a\u003e Capistrano deployment\n\nThe easiest way to deploy nixon-pi is using the capistrano deploy script. It locally packs you application and sends it to your raspberry pi using sftp.\n\nEdit the the deploy.rb script to suit your needs. For a start, edit the target server\n\n\tserver 'nixonpi', :app, :web, :db\n\nor add an appropriate vhost entry.\n\nDeploy via\n\n\tcap deploy:setup \t#first time\t\n\tcap deploy\n\n\n\nwhich executes the following tasks\n\n- Normal application deployment \n- Links the database from shared/db/settings.db\tto your current release\n- Exports the foreman init script to a bluepill file called nixon-pi.pill\n- Symlinks the init script bluepill-init.sh to /etc/init.d/nixon-pi\n  You can control it with the \"start, stop, restart\" commands\n\nI recommend you add it to your runtime configuration, after the rabbitmq server is started\n\n\t#TODO add correct statement\n\tupdate-rc.d nixonpi   \n\nThe following restictions apply (at the moment):\n\n- The service must be run as root due to a limitation in the bluepill gem (no rights create directory under /var/run) \t\n\n##\u003ca id=\"service\" name=\"service\"\u003e\u003c/a\u003e The Service\n\nA telnet based client to drive nixie tubes via rest interface\n\n## Comand line options\n\n\tbin/nixon-pi -h\n\tUsage: nixon-pi [options]\n\t    -e env                           set the environment (default is development, others are test and production)\n\t    -m                               force the usage of the telnet mock interface\n\t    -p port                          set the webserver port (default is 8080)\n\t    -h, --help                       Display help\n\nThe application drops a .yml configuration file in the users home directory. Review and adjust if neccessary...\n\nUse foreman to start and stop the service and the web application.\n\n    foreman start\n    foreman start -f ./Procfile.production\n\n\nExport start and stop scripts using either\n\n     rvmsudo bundle exec foreman export bluepill ./config -f ./Procfile.production -a nixon-pi -u root -l /home/pi/nixonpi/shared/log\n\nor the capistrano deploy script.     \n\n\n**NOTE** Most probably the ctrl+c combination will not suffice to stop the webrick server started by sinatra. In this case use ctrl+z to stop\n\n### Controlling\n\nThe whole device is controlled via sinatra web application, see the example page at [server ip]:[port]\n\n## The Gem\n\nThe Nixon-\u0026#960; Service is packed as a standalone gem which can be run as a daemon.\n\n### Build\n\nBuild with\n\n    gem build nixon-pi.gemspec\n\n\n### Install\n\n    $ gem install nixie-berry-service\n\n\n### State machines\n\nThe service uses a state machine to handle local executions.\nGenerate state machine diagrams with the following command:\n\n\n\trake state_machine:draw FILE=./lib/nixonpi/state_machines/tube_state_machine.rb CLASS=NixonPi::TubeStateMachine\n\trake state_machine:draw FILE=./lib/nixonpi/state_machines/bar_state_machine.rb CLASS=NixonPi::BarStateMachine\n\trake state_machine:draw FILE=./lib/nixonpi/state_machines/lamp_state_machine.rb CLASS=NixonPi::LampStateMachine\n\n**Tube State Machine**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/TubeStateMachine_state.png\" width=\"400\"\u003e\n\n**Bar State Machine**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/BarStateMachine_state.png\" width=\"400\"\u003e\n\n**Lamp State Machine**\n\n\u003cimg src=\"https://dl.dropbox.com/u/23566127/nixon-pi_images/LampStateMachine_state.png\" width=\"400\"\u003e\n\n--------------------------\n\n#\u003ca id=\"web_server\" name=\"web_server\"\u003e\u003c/a\u003e Web Server\n\nThe Sinatra based web server exposes a json api to control the service as well as a simple web application. \n\nAs well as the service, the web application can be started using foreman.\nBefore you do however, be sure to set the RACK_ENV variable to the necessary environment.\n\nSet it for example in the .bash_profile file\t\n\n\tRACK_ENV=production\t\n\n--------------------------\n\n#\u003ca id=\"api\" name=\"api\"\u003e\u003c/a\u003e API\n\nAll api requests can be made as either .html or .json.\n**JSONP** is returned to support 3rd party apps.\n\n## Port\n\nThe web server port can be configured in the Procfile.production file inside your home directory.\n\n\tweb: thin start -p 80 -c web\t\n\n--------------------------\n\n## POST Requests\n\nPost requests to control the nixon-pi.\n\n### POST /tubes\n\nControl the IN-12A digit tubes.\nThe Tubes allow values from 0 to 9 including _ (Space) for no value.\n\n| Parameters | Values | Data Type | Description  | Required |\n| ---------- | ------ | --------- | ------------ | -------- |\n| state | time, free_value, animation, countdown | String | State of the state machine | * |\n| value | 0-9 or _ (Space) | String | Max. length 12 | * |\n| time_format | ex: \"%H%M%S\" | String | only in state \"time\" | |\n| animation_name | single_fly_in, count_from_to, switch_numbers | String |  | |\n| options |  | JSON | Advanced options hash | hash with the following keys: start_value, goto_target, goto_state |\n| initial_mode | true, false | Boolean | Load on startup | |\n\n### POST /lamps\n\nControl the IN-1 neon tubes.\nThe neon tubes can either be turned on or off - they're like orange LEDs.\n\n| Parameters | Values | Data Type | Description  | Required |\n| ---------- | ------ | --------- | ------------ | -------- |\n| state | free_value, animation | String |  State of the state machine  | * |\n| values | Array of 0 or 1 | Array of Integer | Max. length 5 | * |\n| animation_name | single_fly_in, count_from_to, switch_numbers | String |  | |\n| options |  | JSON |Advanced options hash | hash with the following keys: start_value, goto_target, goto_state |\n| initial_mode | true, false | Boolean |Load on startup | |\n\n### POST /bars\n\nControl the IN-13 bargraph tubes.\nThe bargraphs are a linear display to visualize a value between 0 (off) and 255 (full width).\n\n| Parameters | Values | Data Type | Description  | Required |\n| ---------- | ------ | --------- | ------------ | -------- |\n| state | free_value, animation | String | State of the state machine | * |\n| values | Array of 0 to 255 | Array of Integer |Max. length 4 | * |\n| animation_name | ramp_up_down | String | | |\n| options |  | JSON | Advanced options hash | hash with the following keys: start_value, goto_target, goto_state |\n| initial_mode | true, false | Boolean |Load on startup | |\n\n### POST /say\n\nSynthesize text to speech.\n\n| Parameters | Values | Data Type | Description  | Required |\n| ---------- | ------ | --------- | ------------ | -------- |\n| value | Hello World | String | TTS String | * |\n\n### POST /power\n\nControl the high-voltage power supply.\n\n| Parameters | Values | Data Type | Description  | Required |\n| ---------- | ------ | --------- | ------------ | -------- |\n| value | 0 or 1 | String | Turn on or off the high voltage power supply | * |\n\n### POST /scheduler\n\n--------------------------\n\n## GET Requests\n\nGet requests to get information about the nixon-pi.\n\n### GET /info/:target.:format\n\nGet information about the current state of a specified state machine.\n\n| Parameters | Values |\n| ---------- | ------ |\n| :target | tubes, bars, lamps, power |\n| :format | html, json |\n\n**Example:**\n\n\twget http://localhost:3000/info/tubes.json\n\nReturns:\n\n\t{\n\t    \"info\": {\n\t        \"animation_name\": \"single_fly_in\",\n\t        \"options\": {},\n\t        \"last_value\": \"214740\",\n\t        \"last_state\": \"animation\",\n\t        \"state\": \"time\",\n\t        \"last_time\": \"2013-01-16T21:47:40+01:00\"\n\t    },\n\t    \"message\": \"tubes set to\",\n\t    \"success\": true\n\t}\n\n\n### GET /info/:target/:id.:format\n\nGet information about the current state of a specified state machine.\n\n| Parameters | Values |\n| ---------- | ------ |\n| :target | state machine |\n| :id | numeric identifier |\n| :format | html, json |\n\n**Example:**\n\n\twget http://localhost:3000/info/lamp/0.json\n\nReturns:\n\n\t{\n\t    \"value\": 0,\n\t    \"last_state\": \"startup\",\n\t    \"state\": \"free_value\",\n\t    \"last_value\": 0,\n\t    \"message\": [\n\t        \"lamp0 set to\"\n\t    ],\n\t    \"success\": true\n\t}\n\n\n### GET /info/hw.:format\n\nGet hardware information about the Raspberry-Pi I/O expansion card.\nInformation include:\n\n* RTC - Real time clock\n* IO  - GPIO driver\n* ADC - Analog digital converter driver\n* PWM - Pulse width modulation driver\n\n\n| Parameters | Values |\n| ---------- | ------ |\n| :format | html, json |\n\n**Example:**\n\n\twget http://localhost:3000/info.json\n\nReturns:\n\n\t{\n\t    \"info\": {\n\t        \"rtc\": \"1\",\n\t        \"io\": \"1\",\n\t        \"adc\": \"1\",\n\t        \"pwm\": \"1\"\n\t    },\n\t    \"message\": \"Hardware information\",\n\t    \"success\": true\n\t}\n\n### GET /command/:target.:format\n\nGet a json containing all available commands for a specified target.\n\n| Parameters | Values |\n| ---------- | ------ |\n| :target | tubes, bars, lamps, power, say |\n| :format | html, json |\n\n**Example:**\n\n\tcurl http://localhost:3000/command/tubes.json\n\nReturns:\n\n\t{\n\t    \"state\": null,\n\t    \"value\": null,\n\t    \"time_format\": null,\n\t    \"animation_name\": null,\n\t    \"options\": null,\n\t    \"initial_mode\": null\n\t}\n\n### GET /commands.:format\n\nGet a json of all available commands.\n\n| Parameters | Values |\n| ---------- | ------ |\n| :format | html, json |\n\n\nReturn a json of available commands and parameters.\n\n**Example:**\n\n\tcurl http://localhost:3000/commands.json\n\nReturns:\n\n\t{\n\t    \"tubes\": {\n\t        \"state\": null,\n\t        \"value\": null,\n\t        \"time_format\": null,\n\t        \"animation_name\": null,\n\t        \"options\": null,\n\t        \"time\": null,\n\t        \"initial_mode\": null\n\t    },\n\t    \"bars\": {\n\t        \"state\": null,\n\t        \"values\": null,\n\t        \"animation_name\": null,\n\t        \"options\": null,\n\t        \"time\": null,\n\t        \"initial_mode\": null\n\t    },\n\t    \"lamps\": {\n\t        \"state\": null,\n\t        \"values\": null,\n\t        \"animation_name\": null,\n\t        \"options\": null,\n\t        \"time\": null,\n\t        \"initial_mode\": null\n\t    },\n\t    \"power\": {\n\t        \"value\": null,\n\t        \"time\": null\n\t    },\n\t    \"say\": {\n\t        \"value\": null,\n\t        \"time\": null\n\t    },\n\t    \"message\": \"Available commands\",\n\t    \"success\": true\n\t}\n\n--------------------------\n\n## DELETE Requests\n\nDelete saved values.\n\n### DELETE /schedule/:id\n\nDelete a saved schedule.\n\n| Parameters | Values |\n| ---------- | ------ |\n| :id | id of an existing schedule |\n\n\n**Example**\n\n    curl -X DELETE http://localhost/schedule/1\n\nReturns:\n\n\t{\n\t\t\"success\":true,\n\t\t\"message\":\"Schedule deleted\"\n\t}\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkummer%2Fnixon-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielkummer%2Fnixon-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkummer%2Fnixon-pi/lists"}