Friday 27 December 2019

Stranger Things Message Wall Arduino project

I made a version of the message wall seen in the Netflix series 'Stranger Things'. Winona Ryder's character Joyce Byers receives messages from 'the Upside Down'. She hung Christmas lights on her living room wall and the lights lit up next to corresponding letters. The project was a modified version of Zach Hipps' YouTube version and the instructions at his website. I am indebted to him for the Arduino code and the .apk for the BT app.















I wanted to make a smaller version as Christmas gifts for my two daughters. I settled on a 12" x 12" box frame version.

Things you need for the project:

(a) WS2811 Addressable RGB LEDs. I got mine from an eBay seller. You need 28 but they come in strings of 50. There's about 10cm of wire between each LED. When you get them check the wiring diagram carefully. The associated diagrams I got with my lights were wrong. This took a while to figure out as I'll explain later.


(b) Arduino Uno. You can use an original or a clone.

(c) HC-05 Bluetooth Module.

(d) Jumper cables.

(e) 400 point bread board.

(f) 5V 1A power supply.

(g) Soldering iron and solder.

(h) Printout of the picture or a drawing/painting done by a willing accomplice. I used a 12" x 12" piece of scrap-booking wallpaper with a suitable retro rose pattern. This was then over-painted with an approximation of the strings of Christmas fairy lights.

(i) 12" x 12" (300mm x 300mm) box frames. You may have to modify these to get an adequate depth. I attached 6cm wide strips of 5mm MDF to each side. I filled any gaps with wood filler, rubbed them down with sandpaper and painted them.


Instructions.

(a) Cut a length of LEDs, for this project you need 28. There is one LED for each letter A to Z and two needed for blanks to match the bulbs seen in the TV show.

This is a good moment to check the three wires. They may well be different colours from those specified in the instructions received from the supplier. Identify the +5V cable, the GND cable and the DATA cable. If you look closely at each LED they are labelled. Also note the direction arrow on the DATA cable. If you wire them up in the wrong direction they won't work. They won't be damaged they just won't light up.

(b) Check that the LEDs work by running a program from the Fast LED library. See my blog post here.

(c) You may now now want to change a few settings on your HC-05 Bluetooth module. I was making two of these projects so I named one module 'STMW1' and 'STMW2'. Passcodes were changed from the default '1234' to '11' (obviously!) Instructions for changing AT command can be found in my blog post here.

(d) Load up the project Arduino code provided in the introduction to your Arduino. Remove the USB cable.

(e) Now start making the following wire connections. Do them in this order:

GND wire from LED string to GND on Arduino
DATA wire from LED string to Pin 5 on Arduino
+5V wire from LED string to 5V on Arduino.

TX on HC-05 to RX on Arduino
RX on HC-05 to TX on Arduino
GND on HC-05 to GND on Arduino
VCC om HC-05 to +3.3V on Arduino

(f) Power up the Arduino using a 5V 1A adaptor. The HC-05 Bluetooth module should be flashing fairly rapidly.

(g) Download the Android app. It's not available from the Google play store. You need to copy it into an appropriate file destination on your smartphone, then install it. You may have to look up how to do this for your own phone.

(h) Switch Bluetooth on on your smartphone. Pair up with the HC-05 module.

(i) Using the Android app send a message. Watch as each light lights up in sequence. If you try a sentence with spaces in such as 'help me', there should be a slightly longer pause in between the words.

(j) Fix your completed 12" x 12" 'picture' into your adapted box frame. Hot glue the Arduino and the HC-05 onto the back of the frame and box in using a piece of MDF cut to size. Screw down the back plate.

There's a video of the completed project here: https://www.youtube.com/watch?v=NrRv_ULy_Kk






Wednesday 18 September 2019

How to run Fast LED programs on addressable LEDs using Arduino

Fast LED is a library of programs for controlling addressable LEDs. Before using the libraries or working on writing your own code you need to know what LEDs you are using and how many of them will there be. Make a note of what pin, or pins will you be putting the LEDs onto.

Download the latest release of the Arduino IDE for your operating system. You may already have this.

Open Arduino.

In the 'Tools' menu navigate to 'Manage Libraries'. In the 'Filter your search' box type 'Fast LED'. You should get something like this:



Click on 'install', wait until it installs then from 'File' 'Examples' scroll down and 'Fast LED' should be down towards the bottom of the list. You can then select one of the Fast LED libraries for example 'ColorPalette'. Select this and the code opens in Arduino.

Among the first few lines are the ones to alter depending on your requirements:

#define LED_PIN     5
#define NUM_LEDS    50
#define BRIGHTNESS  64

#define LED_TYPE    WS2811

Change these to match the string of LEDs you are using. 

In my video example below, I'm using Pin 5, 22 LEDs, 100 brightness and a string of WS2811 addressable LEDs.




Wednesday 4 September 2019

How to control LED via Bluetooth and Arduino

I will cover how to set up Arduino, upload the code, test in serial mode, then test using Android app.

Things required:

1. Arduino Uno board
2. Jumper wires
3. HC-05
4. LED


1. Make the following connections:

Arduino                              HC-05
TX              ====>             TX
RX              ====>             RX
5V              ====>             VCC
GND           ====>             GND

LED short wire ====>       GND of Arduino
LED long wire ====>         pin 8 of Arduino

2. Temporarily remove the TX and RX from the HC-05.



3. Upload the following code:

------------------------------------------------------------------------------------------------------------------------------------
void setup() {
Serial.begin(9600);
 pinMode(8, OUTPUT); // put your setup code here, to run once:
 }

void loop() {
  // put your main code here, to run repeatedly:
 if(Serial.available()>0)
   {     
      char data= Serial.read(); // reading the data received from the bluetooth module
      switch(data)
      {
        case 'a': digitalWrite(8, HIGH);break; // when a is pressed on the app on your smart phone
        case 'b': digitalWrite(8, LOW);break; // when b is pressed on the app on your smart phone
        default : break;
      }
      Serial.println(data);
   }
   delay(50);

}
------------------------------------------------------------------------------------------------------------------------------------
4. Replace the TX and RX cables as above.

5. Open serial monitor in Arduino program.

6. Change Baud rate to 9600 and select 'no line ending'.

7. Enter a to turn LED on, enter b to turn LED off.


Using via Bluetooth app. I use Bluetooth Terminal

8. Swap the TX and RX cables around on the Arduino.

9. Pair up using Bluetooth app.

10. Enter a in app to turn LED on, enter b in app to turn LED off.

There is a video showing this in action here:


How to enter AT mode in HC-05 Bluetooth module

I will cover how to change password, name or mode (master or slave) in HC-05 Bluetooth module. 


Things required:

1. Arduino Uno board
2. Jumper wires
3. HC-05


1. Upload a blank program to your Arduino.

2. Make the following connections:

Arduino                              HC-05
TX              ====>             TX
RX              ====>             RX
VCC            ====>             VCC
GND           ====>              GND
HC-05 bluetooth module
HC-05


3. Before powering up the Arduino, the little button on the HC-05 should be pressed and then released a few seconds after powering up the Arduino..  

4. The HC-05 in now in AT mode and its LED will blink approximately once every 2 seconds.

5. Open serial monitor in the Arduino program. The Baud rate should be selected to 38400 and both nl and cr should be selected.

6. Check some AT commands:

Type AT and press enter
The response should be OK

AT+ROLE? and press enter
The response is 0 or 1
0- Slave
1- Master

AT+UART? and press enter
The response is Baud rate

AT+PSWD? and press enter
The response is 1234    // that is the password.

For changing the password, command is AT+PSWD="1587"  
This command will set the password to 1587
Note: you need the quotation marks around the number selected.

There are other AT commands available at this link: