Adafruit
Adafruit
Project #7: RGB LCD Shield – PIR Motion Sensor – Mk03
PIR Motion Sensor
This is a simple to use motion sensor. Power it up and wait 1-2 seconds for the sensor to get a snapshot of the still room. If anything moves after that period, the ‘alarm’ pin will go low.
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.
The alarm pin is an open collector meaning you will need a pull up resistor on the alarm pin. The open drain setup allows multiple motion sensors to be connected on a single input pin. If any of the motion sensors go off, the input pin will be pulled low.
We’ve finally updated the connector! Gone is the old “odd” connector, now you will find a common 3-pin JST! This makes the PIR Sensor much more accessible for whatever your project may need. Red = Power, White = Ground, and Black = Alarm.
Buzzer
This is a small 12mm round speaker that operates around the audible 2kHz range. You can use these speakers to create simple music or user interfaces.
This is not a true piezoelectric speaker but behaves similarly. Instead of a piezoelectric crystal that vibrates with an electric current, this tiny speaker uses an electromagnet to drive a thin metal sheet. That means you need to use some form of alternating current to get sound. The good news is that this speaker is tuned to respond best with a square wave (e.g. from a microcontroller).
LED
LED Yellow
LED Green
DonLuc1805Mk07
1 x RGB LCD Shield 16×2 Character Display
1 x Arduino UNO – R3
1 x ProtoScrewShield
1 x PIR Motion Sensor
1 x Buzzer
1 x LED Yellow
1 x LED Green
2 x Jumper Wires 2″ M/F
4 x Jumper Wires 3″ M/M
5 x Jumper Wires 6″ M/M
1 x Half-Size Breadboard
Arduino UNO
JST – Digital 6
BUZ – Digital 2
LEY – Digital 1
LEG – Digital 0
VIN – +5V
GND – GND
DonLuc1805Mk07a.ino
// ***** Don Luc ***** // Software Version Information // Project #7: RGB LCD Shield – PIR Motion Sensor - Mk03 // 5-3.01 // DonLuc1804Mk07 5-3.01 // RGB LCD Shield // PIR Motion Sensor (JST} // include the library code: #include <Adafruit_MCP23017.h> #include <Adafruit_RGBLCDShield.h> Adafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield(); #define GREEN 0x2 // PIR Motion Sensor (JST} const int buz = 6; // Buzzer const int MOTION_PIN = 2; // Pin connected to motion detector const int LED_Yellow = 1; // LED Yellow const int LED_Green = 0; // LED Green void loop() { // PIR Motion Sensor (JST} isJST(); delay(1000); // Clear RGBLCDShield.clear(); }
getJST.ino
void isJST(){ int proximity = digitalRead(MOTION_PIN); // PIR Motion Sensor if (proximity == LOW) // If the sensor's output goes low, motion is detected { // Motion Detected digitalWrite(buz, HIGH); // Buzzer High digitalWrite(LED_Yellow, HIGH); // LED Yellow High digitalWrite(LED_Green, LOW); // LED Green Low // Display // Set the cursor to column 0, line 0 RGBLCDShield.setCursor(0,0); RGBLCDShield.print("Motion Detected!"); // Motion Detected! // Set the cursor to column 0, line 1 RGBLCDShield.setCursor(0, 1); RGBLCDShield.print("Buzzer On - Yel"); // Buzzer On } else { // Motion Off digitalWrite(buz, LOW); // Buzzer Low digitalWrite(LED_Yellow, LOW); // LED Yellow Low digitalWrite(LED_Green, HIGH); // LED Green High // Display // Set the cursor to column 0, line 0 RGBLCDShield.setCursor(0,0); RGBLCDShield.print("Motion Off!"); // Motion Off! // Set the cursor to column 0, line 1 RGBLCDShield.setCursor(0, 1); RGBLCDShield.print("Buzzer Off - Gr"); // "Buzzer Off } }
setup.ino
void setup() { // set up the LCD's number of columns and rows: RGBLCDShield.begin(16, 2); RGBLCDShield.setBacklight(GREEN); // Display // Set the cursor to column 0, line 0 RGBLCDShield.setCursor(0,0); RGBLCDShield.print("Don Luc"); // Don luc // Set the cursor to column 0, line 1 RGBLCDShield.setCursor(0, 1); RGBLCDShield.print("Motion Sensor"); // Motion Sensor delay(5000); // Clear RGBLCDShield.clear(); // PIR Motion Sensor (JST} pinMode(buz, OUTPUT); // Buzzer pinMode(MOTION_PIN, INPUT_PULLUP); // PIR Motion Sensor pinMode(LED_Yellow, OUTPUT); // LED Yellow pinMode(LED_Green, OUTPUT); // LED Green }
Don Luc
Project #7: RGB LCD Shield – Mk01
RGB LCD Shield
Project #7 – Mk01
ChronoDot
1 x RGB LCD Shield 16×2 Character Display
1 x Arduino Uno – R3
1 x ProtoScrewShield
1 x ChronoDot
4 x Jumper Wires 3″ M/M
1 x Half-Size Breadboard
A5
A4
GND
3.3V
DonLuc1804Mk07a.ino
// ***** Don Luc ***** // Software Version Information // 1.03 // DonLuc1804Mk07 1.03 // RGB LCD Shield // ChronoDot // include the library code: #include <Wire.h> #include <Adafruit_MCP23017.h> #include <Adafruit_RGBLCDShield.h> #include <RTClib.h> #include <RTC_DS3231.h> RTC_DS3231 RTC; #define SQW_FREQ DS3231_SQW_FREQ_1024 //0b00001000 1024Hz Adafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield(); #define GREEN 0x2 // ChronoDot char datastr[100]; void loop() { RGBLCDShield.clear(); timeChrono(); delay(2000); }
ChronoDot.ino
void setupChrono() { RTC.begin(); DateTime now = RTC.now(); DateTime compiled = DateTime(__DATE__, __TIME__); RTC.getControlRegisterData( datastr[0] ); } void timeChrono() { DateTime now = RTC.now(); DateTime isNow (now.unixtime() + 6677 * 86400L + 42500); // set the cursor to column 0, line 0 RGBLCDShield.setCursor(0,0); RGBLCDShield.print(isNow.year(), DEC); RGBLCDShield.print('/'); RGBLCDShield.print(isNow.month(), DEC); RGBLCDShield.print('/'); RGBLCDShield.print(isNow.day(), DEC); RGBLCDShield.print(' '); RGBLCDShield.print(' '); // set the cursor to column 0, line 1 RGBLCDShield.setCursor(0, 1); RGBLCDShield.print(isNow.hour(), DEC); RGBLCDShield.print(':'); RGBLCDShield.print(isNow.minute(), DEC); RGBLCDShield.print(':'); RGBLCDShield.print(isNow.second(), DEC); RGBLCDShield.print(' '); RGBLCDShield.print(' '); }
setup.ino
void setup() { // set up the LCD's number of columns and rows: RGBLCDShield.begin(16, 2); RGBLCDShield.print("Don Luc"); RGBLCDShield.setBacklight(GREEN); // set the cursor to column 0, line 1 RGBLCDShield.setCursor(0, 1); // print the number of seconds since reset: RGBLCDShield.print("ChronoDot"); delay(5000); // ChronoDot setupChrono(); delay(1500); //wait for the sensor to be ready }
Don Luc
Project #6: MicroView – Mk04
MicroView
Project #6 – Mk04
Trimpot – LED
1 x MicroView
1 x MicroView – USB Programmer
1 X Trimpot 10K with Knob
1 X Resistor 2.55k Ohm
1 X 3MM Low Current Red LED
6 x Jumper Wires 3″ M/M
1 x Half-Size Breadboard
05 pin – A2
08 pin – GND
11 pin – 2
15 pin – +5V
DonLuc1804Mk06d.ino
// ***** Don Luc ***** // Software Version Information // 3.01 // DonLuc1804Mk06 4.04 // MicroView // Trimpot - LED // include the library code: #include <MicroView.h> // Potentiometer int potPin = A2; // select the input pin for the potentiometer int ledPin = 2; // select the pin for the LED int potPot = 0; String cap = ""; void loop() { // Potentiometer isCap(); delay(500); uView.clear(PAGE); }
getPot.ino
void isCap(){ potPot = analogRead(potPin); // read the value from the sensor cap = "Pot: "; cap.concat(potPot); uView.setFontType(0); uView.setCursor(0,20); uView.print( cap ); uView.display(); }
setup.ino
void setup() { uView.begin(); // begin of MicroView uView.clear(ALL); // erase hardware memory inside the OLED controller uView.display(); // display the content in the buffer memory, by default it is the MicroView logo delay(1000); uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared. uView.setFontType(1); uView.setCursor(0,20); uView.print("Don Luc"); uView.display(); delay(5000); uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared. uView.setFontType(0); uView.setCursor(0,20); uView.print("TrimpotLED"); uView.display(); delay(5000); uView.clear(PAGE); // ledPin pinMode(ledPin, OUTPUT); digitalWrite(ledPin, HIGH); // turn the ledPin on }
Don Luc
Project #6: MicroView – Mk03
MicroView
Project #6 – Mk03
1 x MicroView
1 x DS18S20
1 x Resistor 1.65k Ohm
3 x Jumper Wires 3″ M/M
08 pin – GND
11 pim – 2
15 pin – +5V
DonLuc1804Mk05b.ino
// ***** Don Luc ***** // Software Version Information // 3.01 // DonLuc1804Mk05 3.01 // MicroView // OneWire // DS18S20 #include <MicroView.h> #include <OneWire.h> // Temperature chip i/o int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2 OneWire ds(DS18S20_Pin); // on digital pin 2 float temperature = 0; String tempZ = ""; void loop() { // Temperature chip i/o temperatu(); isTe(); uView.setFontType(1); uView.setCursor(0,20); uView.print("Don Luc"); uView.display(); delay(1000); uView.clear(PAGE); }
getTemperature.ino
float getTemp() { //returns the temperature from one DS18S20 in DEG Celsius byte data[12]; byte addr[8]; if ( !ds.search(addr)) { //no more sensors on chain, reset search ds.reset_search(); return -1001; } if ( OneWire::crc8( addr, 7) != addr[7]) { return -1002; } if ( addr[0] != 0x10 && addr[0] != 0x28) { return -1003; } ds.reset(); ds.select(addr); ds.write(0x44,1); // start conversion, with parasite power on at the end byte present = ds.reset(); ds.select(addr); ds.write(0xBE); // Read Scratchpad for (int i = 0; i < 9; i++) { // we need 9 bytes data[i] = ds.read(); } ds.reset_search(); byte MSB = data[1]; byte LSB = data[0]; float tempRead = ((MSB << 8) | LSB); //using two's compliment float TemperatureSum = tempRead / 16; return TemperatureSum; } void temperatu(){ temperature = getTemp(); } void isTe() { tempZ = ""; uView.setFontType(1); uView.setCursor(0,10); uView.print("Celsius"); uView.setCursor(0,30); tempZ.concat(temperature); tempZ.concat("C"); uView.print( tempZ ); uView.display(); delay(5000); uView.clear(PAGE); }
setup.ino
void setup() { uView.begin(); // begin of MicroView uView.clear(ALL); // erase hardware memory inside the OLED controller uView.display(); // display the content in the buffer memory, by default it is the MicroView logo delay(1000); uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared. uView.setFontType(1); uView.setCursor(0,20); uView.print("Don Luc"); uView.display(); delay(5000); uView.clear(PAGE); // erase the memory buffer, when next uView.display() is called, the OLED will be cleared. uView.setFontType(1); uView.setCursor(0,20); uView.print("OneWire"); uView.display(); delay(5000); uView.clear(PAGE); uView.setFontType(1); uView.setCursor(0,20); uView.print("DS18S20"); uView.display(); delay(5000); uView.clear(PAGE); }
Don Luc
Adafruit – Half-Size Breadboard
Adafruit: 64
Description
This is a cute half size breadboard, good for small projects. It’s 2.2″ x 3.4″ (5.5 cm x 8.5 cm) with a standard double-strip in the middle and two power rails on both sides. You can pull the power rails off easily to make the breadboard as thin as 1.4″ (3.5cm) and stick it onto an Arduino protoshield. You can also cut these in half with a saw to create 2 tiny breadboards, or “snap” these breadboards together either way to make longer and/or wider breadboards.
Technical Details
Dimensions:
- 2.2″ x 3.4″ (5.5 cm x 8.5 cm)
- 9.7mm(0.38in) thick, including sticky foam on the bottom
- Weight: 38.9g (1.27oz)
Don Luc
Adafruit – RGB LCD Shield Kit w/ 16×2 Character Display – Only 2 pins used! – Positive Display
Adafruit: 716
Description
This new Adafruit shield makes it easy to use a 16×2 Character LCD. We really like the RGB LCDs we stock in the shop both the RGB negative and RGB positive. Unfortunately, these LCDs do require quite a few digital pins, 6 to control the LCD and then another 3 to control the RGB backlight for a total of 9 pins. That’s half of the pins available on a classic Arduino!
With this in mind, we wanted to make it easier for people to get these LCD into their projects so we devised a shield that lets you control a 16×2 Character LCD, up to 3 backlight pins AND 5 keypad pins using only the two I2C pins on the Arduino! The best part is you don’t really lose those two pins either, since you can stick i2c-based sensors, RTCs, etc and have them share the I2C bus. This is a super slick way to add a display without all the wiring hassle.
This shield is perfect for when you want to build a stand-alone project with its own user interface. The 4 directional buttons plus select button allows basic control without having to attach a bulky computer.
The shield is designed for ‘classic’ Arduinos such as the Uno, Duemilanove, Diecimilla, etc. It uses the I2C pins at Analog 4 and Analog 5. It will also work perfectly with Arduino Mega R3’s which have the extra SDA/SCL I2C pins broken out. Earlier Mega’s have the I2C pins in a different location and will require you to solder two wires from the I2C pins on the shield and plug them into the different I2C locations at Digital 20 & 21. This shield will not fit easily on top of an Arduino Ethernet because of the Ethernet jack height. You can use a set of stacking headers to give the shield more ‘lift’ above the jack.
This product comes as a kit! Included is a high quality, USA-made PCB and all the components (buttons, header etc). This product comes with a 16×2 RGB positive. Assembly is easy, even if you’ve never soldered before and the kit can be completed in 30 minutes. Check the product tutorial page for assembly instructions before purchasing
Of course, we even wrote an easy-to-use Arduino library that you can easily add to your project. It acts just like the built in LiquidCrystal library, but automatically uses the shield pins. You can also easily query the 5 keypad buttons to get input through the library, so you get extra buttons without using any more pins. The buttons are automatically de-bounced inside the library.
At this time, the library and shield can control the RGB backlight of our character LCDs by turning each LED on or off. This means you can display the following colors: Red, Yellow, Green, Teal, Blue, Violet, White and all off. There is no support for PWM control of the backlight at this time, so if you need to have more granular control of the RGB backlight to display a larger range of colors, this shield can’t do that (the I2C expander does not have PWM output).
Technical Details
- Dimensions: 2.1″ x 3.2″
- Comes with a 16×2 RGB backlight LCD, positive display
- Plug and play with any Arduino ‘classic’ – UNO, duemilanove, diecimilla, etc as well as Arduino Mega R3.
- Uses only the I2C pins – Analog 4 & 5 on classic Arduinos, Digital 20 and 21 on Arduino Mega R3
- This board/chip uses I2C 7-bit address 0x20
- Mounting hole size is 2.5mm
Don Luc
Adafruit – ChronoDot – Ultra-precise Real Time Clock – v2.1
Adafruit: 255
Description
The ChronoDot RTC is an extremely accurate real time clock module, based on the DS3231 temperature compensated RTC (TCXO). It includes a CR1632 battery (not shown, but included in the product) which should last at least 8 years if the I2C interface is only used while the device has 5V power available. No external crystal or tuning capacitors are required.
The top side of the Chronodot now features a battery holder for 16mm 3V lithium coin cells. It should work fine for CR1620 – CR1632 batteries.
The DS3231 has an internal crystal and a switched bank of tuning capacitors. The temperature of the crystal is continously monitored, and the capacitors are adjusted to maintain a stable frequency. Other RTC solutions may drift minutes per month, especially in extreme temperature ranges…the ChronoDot will drift less than a minute per year. This makes the ChronoDot very well suited for time critical applications that cannot be regularly synchronized to an external clock.
The ChronoDot will plug into a standard solderless breadboard and also has mounting holes for chassis installation.
The I2C interface is very straightforward and virtually identical to the register addresses of the popular DS1337 and DS1307 RTCs, which means that existing code for the Arduino, Basic Stamp, Cubloc, and other controllers should work with no modification.
Technical Details
Dimensions (without battery):
- Length: 30.4mm/1.2in diameter
- Height: 14.1mm/0.55in
- Weight: 4 g
- This board/chip uses I2C 7-bit address 0x68
Don Luc
Adafruit – Panel Mount 100K potentiometer (Breadboard Friendly) – 100KB
Adafruit: 1831
Description
This potentiometer is a two-in-one, good in a breadboard or with a panel. Its a fairly standard linear taper 100K ohm potentiometer, with a grippy shaft. Its smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2″ apart with pin-points, so you can plug it into a breadboard or perfboard. Once you’re done prototyping, you can drill a hole into your project box and mount the potentiometer that way.
Technical Details
Dimensions:
- Body: 16mm / 0.6″
- Body Circumference: 50mm / 2″
- Shaft Length: 15mm / 0.6″
- Weight: 6g
- 100K ohm potentiometer, linear taper
- 100,000 Cycle Life
- Rotational Travel: 300 °
- Static Stop Strength: 90 oz-in
- Rotational Torque: 0.5 to 1.25 oz-in
Don Luc
Adafruit – Panel Mount 1K potentiometer (Breadboard Friendly) – 1K Linear
Adafruit: 1789
Description
This 1K potentiometer is a two-in-one, good in a breadboard or with a panel. Its a fairly standard linear taper 1K ohm potentiometer, with a grippy shaft. Its smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2″ apart with pin-points, so you can plug it into a breadboard or perfboard. Once you’re done prototyping, you can drill a hole into your project box and mount the potentiometer that way.
Technical Details
- 1K ohm potentiometer, linear taper
- 100,000 Cycle Life
- Power: 0.2W
- Rotational travel: 300 °
- Static Stop Strength: 90 oz-in
- Rotational Torque: 0.5 to 1.25 oz-in
Don Luc
Adafruit – Perma-Proto Quarter-sized Breadboard PCB
Adafruit: 1608
Description
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: its always crummy quality, with pads that flake off and no labeling. Then we thought about how people actually prototype – usually starting with a solderless breadboard and then transferring the parts to a more permanent PCB. That’s when we realized what people would really like is a proto board that makes it easy!
This proto-board is the PCB you always wish you had, but never realized it! We took the basic layout of a quarter-sized breadboard (basically, a ‘tiny’ breadboard plus power rails) and turned that into a beautiful PCB. The top side has a white silkscreen, and the same markings you’re familiar with, to make transferring components easy. The bottom has the 5-hole pad design that matches a classic breadboard, with 4 power bus lines on the sides, and no mask so you can easily cut traces when necessary. We used 1.2mm diameter drill holes so even parts with big leads will fit. All holes are thru-plated for strength – these wont peel off with rework. The finish is a gold plate – you won’t get oxidation like with bare copper perf! There are also two mounting holes so you can attach the PCB to your project box.
Once you use a Perma-Proto board, you’ll never go back!
Technical Details
- 15 rows of double 5-hole rows
- 4 power rails with positive/negative markings
- 1.7″ x 2.0″ (44mm x 55mm), 0.063″ thick FR4
- 1.2mm / 0.047″ drill holes
- 2 x 0.125″ or 3.2mm mounting holes 1.4″ apart
- Weight: 6g
Don Luc