Posted on Leave a comment

IR Remote Controlled Laser Cat Toy

IR Cat Toy

The IR Remote Controlled Laser Cat Toy is now complete. I used an Arduino UNO, IR remote, IR receiver, Laser Diode and two servos to create an IR remote controlled laser cat toy.

WARNING!
Lasers can cause permanent eye damage, ensure that you follow these safety measures:
Only use a low-Wattage laser i.e. 5mw or less.
Never shine a laser at a reflective surface.
Never shine a laser in to anyone’s eyes i.e. Cats, Dogs, Jedi’s, Humans etc.

Wiring Schematics:

Arduino Project source code:

#include <IRremote.h>
#include <Servo.h>
int IRPin = 11;
const int ServoXPin = 9;
const int ServoYPin = 10;

int XValue;
int YValue;
int X_Pos = 90;
int Y_Pos = 90;

IRrecv irrecv(IRPin);
decode_results results;
Servo ServoX;
Servo ServoY;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn();
  ServoX.attach(ServoXPin);
  ServoY.attach(ServoYPin);
  ServoX.write(X_Pos);
  ServoY.write(Y_Pos);
}
void loop()
{
  if (irrecv.decode(&results))
  {
    int value = results.value;
    Serial.println(value);
    switch (value)
    {
      case 25245: //Keypad button "Vol +"
        Serial.println("Move Up");
        Y_Pos = Y_Pos - 15;
        ServoY.write(Y_Pos);
    }
    switch (value)
    {
      case -22441: //Keypad button "Vol -"
        Serial.println("Move Down");
        Y_Pos = Y_Pos + 15;
        ServoY.write(Y_Pos);
    }
    switch (value)
    {
      case 8925: //Keypad button "Pre Track"
        Serial.println("Move Left");
        X_Pos = X_Pos + 15;
        ServoX.write(X_Pos);
    }
    switch (value)
    {
      case -15811: //Keypad button "Next Track"
        Serial.println("Move Right");
        X_Pos = X_Pos - 15;
        ServoX.write(X_Pos);
    }
    irrecv.resume();
  }
}

Don’t forget, cats can get easily frustrated when playing with a Laser as they can not actually catch it. Make sure you switch over to a toy they can catch.

For the full parts list please visit my project on Arduino’s Project Hub:
https://create.arduino.cc/projecthub/woodwarddigital/ir-control-laser-cat-toy-de65e6

Please contact me if you have any comments or suggestions: [email protected]

Posted on Leave a comment

May the 4th be with you

May the force be with you

The 4th of May, is the day when it is completely normal to geek out and celebrate Star Wars!

This year I used an Ardunio Uno to play “The Imperial March” and display “May the 4th be with you!” on an LCD display.

Wiring schematics:

Ardunio Uno Wiring diagram

Project source code:

// Script Name: May the 4th be with you - 2021
// Created By: Woodward.Digital
// Credit to: Nick James, https://gist.github.com/nicksort for The Imperial March code
// Website: https://woodward.digital
// Email: [email protected]

#include <LiquidCrystal.h>

// Set pins for LCD interface
// Details the pin on the LCD = the Arduino pin
const int rs = 12;
const int en = 11;
const int d4 = 5;
const int d5 = 4;
const int d6 = 3;
const int d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
 
// Initialize all the notes for the Imperial March
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
const int b = 466;
const int cH = 523;
const int cSH = 554;
const int dH = 587;
const int dSH = 622;
const int eH = 659;
const int fH = 698;
const int fSH = 740;
const int gH = 784;
const int gSH = 830;
const int aH = 880;
int counter = 0;

// Set the pin for the buzzer
const int buzzerPin = 9;

void setup() {
lcd.begin (16,2); //Initialize the LCD
lcd.home ();
pinMode(buzzerPin, OUTPUT);
}
 
void loop() {
delay(1000);
lcd.setCursor(0,0);
lcd.print("May the 4th");
lcd.setCursor(0,1);
lcd.print("Be with you!");

//Play first section
firstSection();

//Play second section
secondSection();

//Variant 1
beep(f, 250);  
beep(gS, 500);  
beep(f, 350);  
beep(a, 125);
beep(cH, 500);
beep(a, 375);  
beep(cH, 125);
beep(eH, 650);

delay(500);

//Repeat second section
secondSection();

//Variant 2
beep(f, 250);  
beep(gS, 500);  
beep(f, 375);  
beep(cH, 125);
beep(a, 500);  
beep(f, 375);  
beep(cH, 125);
beep(a, 650);  
 
delay(650);
delay(10000);
}
 
void beep(int note, int duration)
{
//Play tone on buzzerPin
tone(buzzerPin, note, duration);

delay(duration); 
 
//Stop tone on buzzerPin
noTone(buzzerPin);
 
delay(50);
 
//Increment counter
counter++;
}
 
void firstSection()
{
beep(a, 500);
beep(a, 500);    
beep(a, 500);
beep(f, 350);
beep(cH, 150);  
beep(a, 500);
beep(f, 350);
beep(cH, 150);
beep(a, 650);
 
delay(500);
 
beep(eH, 500);
beep(eH, 500);
beep(eH, 500);  
beep(fH, 350);
beep(cH, 150);
beep(gS, 500);
beep(f, 350);
beep(cH, 150);
beep(a, 650);

delay(500);
}
 
void secondSection()
{
beep(aH, 500);
beep(a, 300);
beep(a, 150);
beep(aH, 500);
beep(gSH, 325);
beep(gH, 175);
beep(fSH, 125);
beep(fH, 125);    
beep(fSH, 250);

delay(325);
 
beep(aS, 250);
beep(dSH, 500);
beep(dH, 325);  
beep(cSH, 175);  
beep(cH, 125);  
beep(b, 125);  
beep(cH, 250);  

delay(350);
}

// Credit to: Nick James, https://gist.github.com/nicksort for The Imperial March code

For full parts list please visit: https://create.arduino.cc/projecthub/woodwarddigital/may-the-4th-be-with-you-325946

Please contact me if you have any comments or suggestions: [email protected]

Posted on Leave a comment

Arduino UNO SMD Missing Drivers

Arduino UNO SMD

With Arduino being an open-source electronics platform, their PCB designs freely available which means it is possible to get a generic Arduino board for much less than the branded boards.

Like when I purchased a 4WD chassis. Which also came with an unbranded Arduino UNO SMD. What’s the difference with Arduino UNO SMD?

The Arduino UNO SMD, uses a surface mount version of the ATmega328P instead of the though hole version.

Arduino UNO SMD

But I noticed when I came to use the board that I wasn’t able to communicate with the board via the Arduino IDE.

When I opened Device manager to double-check I was connecting using the correct COM port, it became clear that there was a missing driver as it was showing as “USB Serial”.

Device Manager

For any missing drivers that Windows isn’t able to automatically find and install, and it isn’t clear where to get the drivers from as this was an unbranded board.

The first step is to find the Hardware IDs of the device by right-clicking on the device > Details and Selecting Hardware IDs. In this instance I could search for the Hardware ID and see that it was for a “CH340 Serial to USB Adapter” which had the Hardware ID “USB\VID_1A86&PID_7523”.

Hardware IDs

It turns out it is very common for the generic Arduino UNO SMD’s to require this driver. For convenience please see below for a download of the driver.

To install this driver, right-click on the missing device and select “update driver”. Then select “browse my computer for drivers” and select the folder where you have downloaded and extracted the above download.

Install Wizard
Install Wizard

Once installation is complete the device is ready to use.


Please get in touch if you have any comments or suggestions via email: [email protected]

Posted on Leave a comment

Arduino – Elegoo Starter kit

Arduino Digital Thermometer

Arduino is an open-source electronics platform. It is a perfect way to make an introduction to electronics and coding, a good way to get started is with a starter kit like the Elegoo Starter kit contains everything you need.

You might think that there is just one type of Arduino broad. No, there are tons the choice can be overwhelming, an official branded board currently costs around £23. With Arduino being an open-source electronics platform, they make their PCB designs freely available, so it is possible to get a generic Arduino board for much less.

I choose the ELEGOO UNO R3 Project Super Starter Kit as a good all-around kit at a low price, it has everything you need to get started and is great for beginners young and old who are interested.

Amazon Affiliate Link (Paid) – ELEGOO UNO R3 Project Super Starter Kit: https://amzn.to/2QUPxKt

ELEGOO UNO R3 Project Super Starter Kit

The included instructions and tutorials which are included on the disk are also available to download, by visiting: https://www.elegoo.com/pages/arduino-kits-support-files

Before you get started you will also need to install the Arduino IDE which is available for Windows, Mac or Linux. Arduino IDE Download: https://www.arduino.cc/en/software

You will quickly find yourself with a good understanding of the basics of electronics and coding by experimenting with an Arduino.

Arduino Digital thermometer
Digital thermometer
Joystick controlled servo motor
Joystick controlled servo motor

As this kit contains a wide variety of components, you can browse the Arduino Project Hub for more ideas and free tutorials.

Arduino Project Hub: https://create.arduino.cc/projecthub