«Hackable Electronic Badge Guest (blue, #20000); Staff (white, #20100); Speaker (black, #20200) Energize your events by using the Badges to store and ...»
Web Site: www.parallax.com Office: (916) 624-8333
Forums: forums.parallax.com Fax: (916) 624-8003
Sales: firstname.lastname@example.org Sales: (888) 512-1024
Technical: email@example.com Tech Support: (888) 997-8267
Hackable Electronic Badge
Guest (blue, #20000); Staff (white, #20100); Speaker (black, #20200)
Energize your events by using the Badges to store and distribute schedules,
identify participants, share contact info, and play interactive games. In educational environments, Badges encourage hands-on activities, creativity, and collaboration while studying electronics and programming.
Hack your Badge! Use our open-source programming tools and example code in C, Spin, and Propeller Assembly to try out a variety of example programs that use all of the Badge’s features, and let your Badge share contact information with other Badges. For software and example code downloads, visit www.parallax.com/badge.
Key Specifications Features Voltage requirements: USB 5V standard, or Propeller 8-core microcontroller, 64 KB
3.7 VDC rechargeable Li-ion battery EEPROM and 5 MHz crystal oscillator (included) 128 x 64 OLED display Communication: USB for programming and 3-axis accelerometer (±1.5 g) for charging orientation and motion detection Programming current: 40 mA typical Two-way infrared communication Charging current: USB host 90 mA max, Two super-bright, tri-color RGB LEDs USB charger 540 mA max Six passive touch-buttons with status LEDs, Dimensions: 4 x 2.75 in (102 x 70 mm) plus 1 special OSHW logo touch-button Operating temp range: 32 to 158 °F (0 to Stereo audio and composite video out +70 °C) USB port for programming and charging Application Ideas Convenient on/off push switch Interactive ID Badge for conferences, 3.6 V Li-ion battery included (#752-00011) hackathons, and maker spaces
Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 1 of 12 Quick Start Guide Your Badge comes complete with a rechargeable battery, lanyard, and pre-loaded code that will demonstrate some of the built-in features. Let’s get started!
Installing the Battery
• Only use a 3.7 V, 800 mAh rechargeable Li-ion battery; one is included with your Badge.
• Match the plus (+) symbols on the battery and the back of the Badge and insert.
Running the Test Code
• Press the on/off button on the right hand side of the Badge.
• Follow the prompts on the Badge’s screen to demonstrate its features.
Wearing your Badge
• Attach the included lanyard by clipping each end to a slot in the top of the Badge.
• Wear the badge around your neck, but heed the cautions below to prevent short circuits!
Stashing your Badge
• Turn off the Badge using the pushbutton on the right-side edge of the board.
• If you are going to pack your Badge in a toolbox, backpack, or purse, put the Badge back its original bubble envelope with the lanyard left out. This will protect your Badge from scratches and from making contact with conductive items.
Recharging the Battery
• To recharge the battery included with your Badge, connect the Badge to a USB port or USB charger with a standard USB Micro B cable (Parallax #805-00016).
• If you are using an external battery charger, follow the manufacturer’s instructions.
• For using batteries other than the one included with your Badge, see sections (14) Battery on page 9, and (15) Battery Type Select on page 10.
Hacking your Badge
• Read through the remainder of this guide to learn more about all of your Badge’s features.
• Programming your Badge requires a USB Micro B Cable (Parallax #805-00016).
• Find free software, example code, tutorials, and open-source files: www.parallax.com/badge Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 2 of 12 Description
Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 4 of 12 (1) OLED Display The 0.96” OLED screen features a high-contrast graphics display with 128x64 pixels. Pixels are white on a dark background. The screen has a built in SSD1306 display driver, which the Propeller controls directly by SPI protocol on pins P18 through P22.
(Marie Gertrude Rand Ferree (October 29, 1886 – June 30, 1970) was an American research scientist who is known for her extensive body of work about color perception.) (2) Blue LEDs The Badge includes a blue LED beside each of the 6 round touch pads. Instead of using 6 I/O, or an
extra multi-channel led driver component, these LEDs are controlled by Charlieplexing (Charlieplexing:
https://en.wikipedia.org/wiki/Charlieplexing.) Charlieplexing is a technique that allows for control of more LEDs with fewer I/O pins by taking advantage of the one-way current flow properties of diodes (including Light Emitting Diodes), along with the tri-state properties of the Propeller I/O pins. It also saves battery power!
This image is taken from the actual Badge schematic, and represents a typical Charlieplex layout. Each Propeller I/O pin (labeled here P6 through P8) can be in any of 3 user-controlled states: HIGH (3.3 V output), LOW (0 V output), or INPUT (does not output anything, like a closed door). And, LEDs will only allow current to flow from the positive Anode (A) side to the negative Cathode (K) side; the “Forward direction.” Now, imagine if we set P6 to INPUT, P7 to HIGH, and P8 to LOW. Which LED will light? The answer can only be D704, as that is the only LED positioned in such a way to allow the current flow from P7 to P8.
This lookup table shows the required state of the Propeller I/O pins to illuminate each LED:
Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 5 of 12 So this is all good… We can light one LED at a time! But how do we light more LEDs simultaneously, like in the Badge demo code?
The answer is that we don't actually light the LEDs simultaneously. We switch them on and off fast enough to trick the human eye into believing they are on simultaneously.
When Propeller code switches each LED on and off at least 50 times a second (50 Hz), flickering should not be noticeable and the LEDs will appear to be permanently on. (For the Propeller this switching speed is no problem as each I/O could switch faster than 5 MHz.) This explains that low-power benefit. Each LED consumes approximately 10mA when lit. If all the LEDs were continuously powered on together, they could consume 60 mA together. But, with Charlieplexing we only light one LED at a time, so total current consumption at any instant in time remains only 10 mA!
(3) Multicore Propeller Microcontroller System 8-core Propeller microcontroller • 64 KB I2C EEPROM for non-volatile program and data storage •
3.3 V, 250 mA voltage regulator •
5.00 MHz crystal oscillator • The Propeller provides the 64 KB EEPROM’s I2C clock through I/O pin P28, and communicates with its I2C data line through I/O pin P29. The EEPROM’s lower 32 KB contains the program image that the Propeller loads on reset. The upper 32 KB can be used for non-volatile data storage. The Propeller microcontroller can multiply the 5.0 MHz crystal oscillator signal by up to 16x for a system clock frequency of 80 MHz.
(4) Prototyping Areas The Badge features two mini prototyping areas for users to add their own circuits! The labels on the bottom of the Badge include short pin names to help identify each IO pin. The holes are spaced at 0.1” pitch, suitable for standard 0.1” headers (#451-04001) or sockets for easy experimentation. Or, you may solder components or cables directly to the board.
Prototyping Areas - Back
The white bars between the through-holes indicate that those holes are electrically joined. Each row has ground (GND), supply voltage (3.3V or USB 5V), pair of holes connected to the I/O pin labeled at the end of the row, and a pair of connected holes labeled “PROTO”. The PROTO holes simplify the building of new circuits, as is demonstrated in the PROJECTS section below.
Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 6 of 12 With the exception of P11, which does not have any other function on the Badge, the other IO pins are dual function. That is they are already connected to certain features on the Badge, as well as being available on the prototype area. These should therefore be used with care, and the user does have the option of cutting traces if certain Badge features are not required in-place of using a custom add-on!
For example: P9 is also connected to the audio left channel (AUDL) at the 3.5mm jack socket. You should refer to the schematic diagram for full details of each connection and any additional on-board components, such as pull-up, pull-down or series resistors.
The last row labeled “I2C” is also an exception. This provides access to an I2C bus, which is connected to the Propeller at P28 (I2C SCL) and P29 (I2C SDA). This last row has ground (GND), SCL, SDA, followed by 3 connected “PROTO” holes. The I2C bus is also connected to the Badge EEPROM and ACCELEROMETER, and can support additional user devices. Both the I2C SCL and SDA connections are pulled up to 3.3 V using 2.2 kΩ resistors included on the Badge.
(5) On/Off Button Press the pushbutton on the right side of the Badge once to switch on, press again to switch off. When you use this button to power off and on the Badge, the Propeller will reset then reload and restart its program from EEPROM. During power-off state, the battery can still be charged if a USB cable is connected. This will be indicated by the blue charge-status (CHG) led.
TIP! To help with debugging, the screen state will persist when the Badge is turned off with a USB cable connected.
(6) Battery Charger Circuit The Badge has a built-in battery charge management circuit which is specially designed for Li-ion batteries. When a suitable power source is connected to the USB port, charging will start and stop automatically as required. The Badge will charge automatically whether it is switched on or off. The maximum charge rate is 90 mA (8 hours) while connected to a computer USB port, or up to 540 mA (2.5 hours) while connected to a dedicated USB power supply. While charging, the blue charge-status led (CHG) will turn on. See sections (14) Battery on page 9, and (15) Battery Type Select on page 10 for important information.
CAUTION! THE BATTERY CHARGER CIRCUIT MAY GET HOT WHILE
RECHARGING YOUR BATTERY!
(7) Infrared Communications The infrared transmitter is directly driven by Propeller I/O pin P24. It should be modulated at 36 kHz to work with the Infrared Receiver. It can also work with modulation schemes for other receivers. Use it to transmit to other Badges or to various infrared receivers such as TVs, cameras, LCD shutter glasses, and printers.
The infrared receiver, connected to Propeller I/O pin P23, includes a built-in 33 kΩ pull-up resistor and drives the I/O pin low when it receives a signal. It can receive signals from devices that transmit an infrared signal modulated at 36 kHz, including signals from the Infrared Transmitter on the same Badge, on another Badge, or from many TV and camera remotes.
Copyright © Parallax Inc. Hackable Electronic Badge (#20000, #20100, #20200) v1.0 9/17/2015 Page 7 of 12 (8) USB Port
The USB Micro B connector serves several functions:
Load programs from the computer into the Propeller microcontroller • Run-time serial-over-USB communication with a terminal, • Supply 5 V power input from a computer or portable USB boost charger (You may power the • badge via USB with or without a battery installed.) The USB Port is input current-limited to between 450 mA and 500 mA. This prevents any unexpected responses from USB 2.0 ports to current draws from motors, wiring mistakes, etc. For charging, the USB Port is current limited to 100 mA when connected to a computer, or 540 mA when connected directly to a USB charger.
(9) Accelerometer The 3-axis accelerometer (Freescale MMA7660FC) senses motion up to ±1.5 g. It is connected to the common I2C bus on P28 & P29. An interrupt signal on P4 can be user-programmed to change state in certain conditions, such as tap and shake detection, or for a change in orientation. To configure the interrupt output, refer to the MMA7660FC datasheet settings IPP (open-drain / push-pull) and IAH (active high / active low). Data rate is configurable from 1 to 120 samples per second.
(10) Resistive OSHW logo Touch-button The Open Source Hardware Logo is a fancy version of the other resistive touch-buttons, described below in more detail. This one is connected to P5 through a 100 kΩ ESD protection resistor. For future customization, the 100 kΩ resistor has unused plated through-holes on either side of it. They are marked P5A and P5B on the back of the Badge, and marked with an S (for source) on the front of the Badge at the side which is connected to the Open Source logo.
(11) Resistive Touch-buttons P15 through P17 and P25 through P27 are connected to resistive touch-buttons. Each button is a signal pad with ground pads on either side, and connected through a 100 kΩ ESD protection resistor to the I/O pin. When the buttons are not in use, they will not load the I/O pins. When touched, they will add negligible resistive loading.
To read the state of a button, set its I/O pin to a high output, immediately switch it to an input, and then measure the amount of time before the I/O pin falls low. If nothing is touching the pad, the parasitic capacitance of the I/O pin and the PCB will hold the input high for several milliseconds. Alternately, instead of measuring the fall time, measure the input state 1 millisecond after the pin was switched to an input.