navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
AvrFreaks
Gameboy Dev
FLOZz' blog
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)

Tricolor USB alert

Last update: Thu Jun 5 22:25:41 2025
5-traffic_light_colors.png

Software

Firmware

See my dedicated page about V-USB: USB without Arduino
Basic code explanation for this project is the firmware source of the chapter Keyboard : Receiving data from host as a HID (no driver). I will list here only relevant details added to the basic design.

Windows software

Who said C# programming ? http://www.codeproject.com/Tips/530836/Csharp-USB-HID-Interface

Hardware

level-conversion-with-zener.gif
Wiring: http://vusb.wikidot.com/hardware using the 3.6v zener diode design, so it allows the micro controller to run at 5V.
On the diagram the pins are:
  1. Vcc (5v)
  2. D-
  3. D+
  4. GND

IMPORTANT: I failed many time at this design (at least twice) before understanding what I did wrong. So follow these rules:
  • USB data is 3.3v but as stated in the V-USB wiki use 3.6v zener diodes (3.3v is doomed to fail)
  • If you use the sample codes from V-USB be careful to use the same pins as them, especially for D- which uses an interrupt. If you change the pin, mind changing the interrupt that is associated. All is done in the usbconfig.h file, read it carefully, it will save you hours of problem solving.
  • Some people pullup the D+ with a 1 MOhm resistor, I don't and it still work so ignore this
  • MCU : Attiny2313 running at 12MHz (ext crystal)
  • Board: Rapide2313 that I made and had still lying around. Not a great success this board in terms of silking, plus a few minor issues, but it works.

TricolorUsbSignal-basic.png
Basic diagram: signal leds will be replace by big 1cm diameter leds and driven by a transistor each, that will be the only change (see USB without Arduino for details)


Documentation

  • All the USB documentation http://www.usb.org/developers/hidpage/
  • usb without arduino
  • Links to tutorials http://www.avrfreaks.net/forum/tut-hard-soft-c-usb-tutorial-v-usb-attiny
  • All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
    electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2025])