Showing posts with label DIY. Show all posts
Showing posts with label DIY. Show all posts

Sunday, January 31, 2021

Raspberry Pi Digital Clock, written in Python programming language

This was challenging for me to get into Python programming and setting Raspberry Pi to my own needs. I know this is overkill but also this is a path for future projects for example info display which can display time, the temperature in your place, and maybe turn on lights in the living room and the list goes on and on.

Saturday, January 2, 2021

MiniPRO TL866xx universal programmer Linux installation.

The TL866A universal programmer is a chip programmer that allows us to write or read chip memory such as microcontrollers, EEPROM memory, etc. This very popular device, unfortunately, comes with software only for the Windows operating system. But there is an open-source alternative that allows the use of this device on the Linux operating system, thanks to David Griffith and his project on GitLab.

Basic commands and using PICkit 2 on Linux!

Now that we have the software installed and ready to use, it is time to get familiar with the basic commands to successfully load the program into the microcontroller. So let's get started!

Install PICkit 2 Development Programmer / Debugger on Raspberry Pi OS.

To install PICkit 2 Development Programmer / Debugger on Raspberry Pi OS, we are gonna first prepare our system by installing dependencies, download source code for PICkit 2 command-line application, compile it, and at the end verify test installation.

Friday, January 1, 2021

Install PICkit 2 Development Programmer / Debugger on Debian 10 Buster 64-bit.

To install PICkit 2 Development Programmer / Debugger on Debian 10 Buster 64-bit, we need to install library packages for i386 architecture. That we can do with Multiarch. What is Multiarch? Multiarch lets us install library packages from multiple architectures on the same machine.

Wednesday, December 30, 2020

Split-rail linear power supply DC/15-0-15V.

Simple linear split-rail power supply for experiments with low power amplifiers and audio signals. This project is very easy to make and does not require a lot of time to make. But here you are working with mains voltage so you have to be very careful. 
So, if you are following along you are doing so at your own risk.

Saturday, January 13, 2018

Power supply unit, variable triple output


Today I finished the project, which I started a few months ago. Three channel desktop power supply with the adjustable output voltage. In the future, I would like to add control of the current limit, but I will talk about it on another occasion.

Thursday, January 11, 2018

Peak voltage detector for a sine wave generator


I recently built a 1kHz sine waveform generator, the device works great, has adjustable amplitude and is suitable for testing audio amplifiers and for repairing them. So I thought it would be nice if I could install a small panel voltmeter to display the output voltage.

Tuesday, January 9, 2018

Arduino, two channel voltmeter with thermometer

This is my new Arduino project, a two-channel voltmeter with a thermometer.


This device uses Arduino's 10-bit analog-to-digital converter, software oversampled to 12-bit and every four measurements are added to the average value. This measured value is printed on the display every 300 milliseconds.

Saturday, January 3, 2015

RC Filter Calculator (low-pass and high-pass)

RC Filter Calculator Here is simple RC filter calculator for calculatie cut-off frequency of a low-pass and high-pass rc filter:

RC Filter Calculator v1.0
R = Ohm
C = Fahrad
f = Hertz

low-pass filter is a filter that passes signals with a frequency lower than a certain cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency.
high-pass filter is an electronic filter that passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency.

More about low-pass and high-pass filer can be found on wikipedia.

LM317 Constant Voltage and Constant Current Calculators

LM317 Calculator Here is two simple calculator's for calculating constant voltage and constant current with LM317 voltage regulator.

LM317 Constant Voltage Calculator v1.0
R1 = Ohm
R2 = Ohm
V = Volt

LM317 Constant Current Calculator v1.0
R = Ohm
I = Amps

Tuesday, April 15, 2014

Send IR commands with Arduino

Sending IR commands from the Arduino is quite simple. It is necessary to connect the IR LED on a specific Arduino pin and write a program to send IR commands. In this example, I connected the IR LED on the Arduino digital pin 2 and wrote a simple sketch to send IR commands by NEC protocol.
Sending commands is very simple, all you need to do is call the function "sendCode (94, 248)". The first number is the address of the device in this case YAMAHA AV receiver and the second number is the command in this case POWER.

More information about NEC protocol can be found at: SB-Projects: IR Remote Control NEC protocol.

Sketch for sending NEC IR commands
// *********************************************************
// Program: NEC PROTOCOL INFRARED REMOTE SENDER
// Version: 1.0
// Author: Elvis Baketa
// Description: 
// *********************************************************

// definitions of constants
#define pulseTime 560         // duration of carrier pulse
#define irLed 2               // ir led connected to digital pin 2
#define YAMAHA 94             // device address byte
#define STANDBY 248           // device command byte

// standard Arduino setup routine
void setup()
{
  pinMode(irLed, OUTPUT);     // set irled pin as output
  digitalWrite(irLed, LOW);   // turn of ir led
  
  // send test command to turn on/off yamaha av receiver
  sendCode(YAMAHA, STANDBY);
}

// standard Arduino loop routine
void loop()
{  
}

// routines to create a carrier pulse
void carrierPulse(unsigned int duration)
{
  for(int i=0; i < (duration / 35); i++)
    {
      digitalWrite(irLed, HIGH);   // set irled to high
      delayMicroseconds(13);       // duration of high pulse
      digitalWrite(irLed, LOW);    // set irled to low
      delayMicroseconds(13);       // duration of low pulse
    }
}

// routines for sending code
void sendCode(byte addressByte, byte commandByte)
{
  // preparing the code for sending
  unsigned long code = 0;
  
  code = addressByte;
  code = code << 8;
  code = code | addressByte ^ 0xFF;
  code = code << 8;
  code = code | commandByte;
  code = code << 8;
  code = code | commandByte ^ 0xFF;
  
  // start sending code
  // send AGC pulse approximate to 9ms
  carrierPulse(16 * pulseTime);
  
  // space pulse approximate to 4.5ms
  delayMicroseconds(8 * pulseTime);
  
  // send bits one by one, MSB first
  for (int i=31; i>=0; i--)
    {
      if (bitRead(code, i))
      {
        carrierPulse(pulseTime);
        delayMicroseconds(3 * pulseTime);
      }else{
        carrierPulse(pulseTime);
        delayMicroseconds(pulseTime);
      }
    }
    
    // send stop bit
    carrierPulse(pulseTime);
}

Saturday, April 5, 2014

Initialize VFD display using Arduino

In this article I will describe how to initialize display from a faulty DVD player. DVD player, VCR and other consumer electronics use vacuum fluorescent display (VFD) for displaying different information and we can can control it using Arduino or any other microcontroller. Most of us electronics technician in our workshops have a faulty device from which we can make use of valid parts for new projects and devices.
From a faulty DVD player I took VFD display and a power source. I used the power source to power the VFD display and Arduino.

Picture of VFD and the power source

VFD display module which I took from a faulty DVD player uses PT6312 controller, for which I found on the internet datasheet. According the datasheet PT6312 is a controller for a vacuum fluorescent display (VFD) packaged in a 44 pin plastic housing. PT6312 is functionally compatible with the μPD16312. To communicate with the Arduino I used DAT, CLK and STB lines from module and connect on Arduino digital pins 2, 3 and 4.

Sketch for initialize VFD module
// *********************************************************
// Program:  VFD display control (PT6312)
// Version:  1.0
// Author:  Elvis Baketa
// Description: 
// *********************************************************

#define DAT 2
#define CLK 3
#define STB 4

#define displayMode 0x01         // 5 digits, 16 segments
#define dataSettings 0x40        // Data write & read mode settings
#define incrementAddress 0x40    // Increment address after data has been written
#define fixedAddress 0x44        // Fixed address
#define addressSettings 0xC0     // Address settings command
#define startAddress 0x00        // start address of ram memory
#define endAddress 0x09          // end address of ram memory
#define displayControl 0x8F      // Display settings ON/OFF

// standard Arduino setup routine
void setup()
{
  // initialize vfd display
  initDisplay();
  // send some data to display
  updateFixedAddress(startAddress, 0b01110111);
}

// standard Arduino loop routine
void loop()
{
}

// routines for sending commands
void sendCommand(unsigned int command, boolean data)
{
  digitalWrite(CLK, HIGH);
  digitalWrite(STB, LOW);
  
  for(int i = 0; i < 8; i++)
  {
    if(bitRead(command, i) & 0x01)
    {
      digitalWrite(DAT, HIGH);
    }else{
      digitalWrite(DAT, LOW);
    }
    digitalWrite(CLK, LOW);
    digitalWrite(CLK, HIGH);
  }
  
  if(data) digitalWrite(STB, HIGH);
}

// routines for sending data
void sendData(unsigned int data, boolean last)
{ 
  for(int i = 0; i < 8; i++)
  {
    if(bitRead(data, i) & 0x01)
    {
      digitalWrite(DAT, HIGH);
    }else{
      digitalWrite(DAT, LOW);
    }
    digitalWrite(CLK, LOW);
    digitalWrite(CLK, HIGH);
  }
  
  if(last) digitalWrite(STB, HIGH);
}

// routines for set ram address
void setAddress(unsigned int address, boolean data)
{
  sendCommand(addressSettings | (address & 0x1F), data);
}

// routine cleaning of display memory
void clearDisplay()
{
  sendCommand(incrementAddress, true);
  setAddress(startAddress, false);
  for(int i = 0; i <= endAddress; i++)
  {
    sendData(0x00, false);
  }
  digitalWrite(STB, HIGH);
}

// routines for initialize display
void initDisplay()
{
  delay (200);
  
  // define communication pins
  pinMode(DAT, OUTPUT);
  pinMode(CLK, OUTPUT);
  pinMode(STB, OUTPUT);
  
  // clear display ram memory
  clearDisplay();
  
  // set display mode to 5 digits, 16 segments
  sendCommand(displayMode, true);
  // set display on and maximum dimming
  sendCommand(displayControl, true);
}

// routine to update fixed memory addresses
void updateFixedAddress(int address, int data)
{
  sendCommand(fixedAddress, true);
  setAddress(address, false);
  sendData(data, true);
}