Git Product home page Git Product logo

lowcostusbstatuslight's Introduction

LowCostUsbStatusLight

This repository provides the code basis and the step-by-step guide how to build a low-cost Arduino-based USB-controllable status light.

The build cost is around 10 €.

The LED hardware is based on cheap LED traffic lights with red/yellow/green LEDs available on a German online store called PEARL:

Name LED-Verkehrsampel,
batteriebetrieben, blinkt auf Knopfdruck
LED Verkehrsampel 4er-Set
Order code NC-2046-903 NC-2047-903
Price (as by 03/2022) 6,90 € per piece 19,99 € for 4, ~5,00 € per piece
Picture pearl_NC-2046-903 pearl_NC-2047-903

It's is a manually controllable, battery powered toy traffic light. We will remove the PCB, the battery and the push button. Basically every other cool-looking PCB or breadboard with three LEDs will do the trick.

As three LEDs alone will not work, there needs to be some microcontroller with USB connectivity and Arduino support.

Digistump's Digispark is an Attiny85 based microcontroller development board similar to the Arduino line, only cheaper, smaller, and a bit less powerful:

Digispark
digispark
Cost is around 2-5 €

The board has 6 I/O Pins where 2 are used for software-USB leaving us with 4 I/O pins for connecting the three LEDs. The Digispark comes preprogrammed with a bootloader which supports flashing via USB - no in-system programmer (ISP) required!

The communication is based on a virtual COM port via a virtual USB (V-USB) device. The software implementation uses DigiCDC - the Digispark USB CDC Serial Library.

The LEDs' anodes are connected to 5V VCC ("common anode"), whereas the cathodes are connected to individual microcontroller pins via individual current limiting resistors (e.g. 220 Ohms each). The LEDs can then be switched on by driving the microcontroller pins in the low state.

Pin Connection
D0 Yellow LED
D1 Red LED (and also the red on-board LED)
D2 Green LED

The application code is less than 100 lines, check out the Arduino sketch.

In order to control the LEDs via the virtual serial interface, connect to the serial port using a serial terminal (e.g. Arduino's Serial Monitor) or your favorite scripting or programming language (e.g. Python). The following single-character commands have been implemented:

Command Action
'r' Switch red LED off
'R' Switch red LED on
'y' Switch yellow LED off
'Y' Switch yellow LED on
'g' Switch green LED off
'G' Switch green LED on
'a' Switch all LEDs off
'A' Switch all LEDs on

Blinking sequences are currently not supported and need to be implemented on the sender side of the serial interface (e.g. your Python script).

Questions? Feel free to ask, also via twitter: @maehw

Please also let me know about your integrations...

lowcostusbstatuslight's People

Contributors

maehw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.