Wednesday, December 30, 2015

LCD Button Shield V2 for Arduino by Sparkfun

The LCD Button Shield from Sparkfun Electronics provides a 16x2 LCD screens along with a keypad consisting of 5 keys — select, up, right, down and left. With this shield you will be able to move through menus and make selections straight from one board attached to your Arduino without requiring a massive tower of shields.

The LCD Button Shield V2 works perfectly in 4-bit mode with the “LiquidCrystal” library found in the Arduino IDE.

 NOTE: The pin hook up used by this shield is different from the samples in the library.  
  The circuit used in Arduino library is usually wired as:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
   The circuit on the shield is  wired as:
 * LCD RS pin to digital pin 8
 * LCD Enable pin to digital pin 9
 * LCD D4 pin to digital pin 4
 * LCD D5 pin to digital pin 5
 * LCD D6 pin to digital pin 6
 * LCD D7 pin to digital pin 7
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

The keypad consisting of 5 keys are arranged in a voltage ladder connected to A0.  Each key press produces a unique value ranging from 0 to 1023.  Pressing multiple keys together will generate unique values as well.  When I wrote the demo program to test the shield I would use the serial monitor to see the analogue values read for each key then I adjusted my code to accept values ranging within +- 10 of the value read.

Here is a short video of the shield with the demo code below:




Here is a link to pick up one of these shields for your next project
https://www.sparkfun.com/products/13293

Monday, December 28, 2015

Adding Second Joystick to Joystick Shield for Arduino

Added a second joystick to the shield and use one for forward/back motion and the other for turning.  I find this setup gives better control.

Jeff Branson, from Sparkfun, saw my project on facebook and suggested I submit it to Sparkfun to be added to their project section.  I said I would if I could get some better quality joysticks, like the ones Sparkfun sells :-).   I should be receiving those this week and will build up a nicer version and also add some additonal control buttons.

Below is a video of me driving the redbot using the dual joystick conroller.


Code used in controller:

Code Running Redbot:


Thursday, December 17, 2015

Wireless Arduino Thumb Joystick Shield

This shield provides the necessary connections between the joystick and the Arduino so that it can read the joysticks X, Y and Switch readings on it's analog inputs.  I chose to mount the joystick on it's own proto shield instead of mounting it to the prototype area of my XBee shield,

Looking at the picture to the left you can see three yellow wires that connect to A0, A1 and A2.  These correspond to the VRx, VRy and SW outputs from the joystick.

In the video I mount the shield to an XBee Wireless shield then mount that to the Arduino that acts as the brain for this wireless joystick controller.  The XBee shield has it's serial switch set so that it looks for serial data D2 and D3, requiring the use of the Software Serial library, leaving the hardware UART on the arduino free for programming and debugging.

The Arduino program polls the status of the joystick every 40 ms (about 20 times a second) then transmits the X, Y and Switch readings over via the XBee wireless module to an XBee wireless module on a Sparkfun redbot.  The program on the Sparkfun Redbot receives the values then makes the necessary adjustment to the power and direction of it's left and right wheels causing the redbot to go forward, backwards or turn.

Software on controller:

Software on Redbot

Learn Arduino
http://goo.gl/5Uv71f





[UPDATE 3/19/2016]

Controlling with one joystick felt kinda squirelly so I added a second one then adjusted the programming so one joystick was used for forward/backwards and the other for left right. This gave it much more stability and made it more fun to drive.  Shortly after completing the build Jeff Branson with sparkfun sent me some better joysticks so I built a second shield.  Here is a video I shot part way into the second build:


Here is a video of the redbot in action using the new and improved dual joystick xbee controller!


Wednesday, December 16, 2015

Multiplexing Seven Segment Displays

Video explaining what multiplexing is, why we do it and how it is done.  Covers using the Arduino to handle the multiplexing and using a 7219.  Using the 7219 we can control up to 8 seven segment displays while using only 3 pins from the Arduino.  The 7219 also handles all refreshing of the display and requires no additional drivers on the common signal of each seven segment display.