Monday, March 18, 2019

Arduino Uno running a MSGEQ7 and a LCD

I Have an Arduino Uno running a MSGEQ7 and a LCD.  It is sampling each frequency twice for 14 samples each channel.  The MSGEQ7 control pins are connected to D2 and D3.


Here is a video of it working.

Friday, March 8, 2019

Arduino UNO with 64x32 LED Array Displaying Analog Data

Arduino UNO with 64x32 LED Array Displaying Analog Data

I am working on a book titled "Arduino Audio Projects" and one of the projects I am creating is to display the outputs of a MSGEQ7 on the 64x32 LED matrix.  As a starting point, the first step is to display the status of A4 and A5 while running the matrix.


Video displaying the Analog inputs A4 and A5



I have successfully added a MSGEQ7 to the Arduino UNO!

Here is the first video with a MSGEQ7 added.


I rotated the display by changing the software!


Here is how to modify the MSGEQ7 shield so its control pins do not interfere with the RGB Hat.


The code is at: https://github.com/bobdavis321/Arduino-Audio-Projects

Monday, February 18, 2019

P3 64x32 HUB75E LED matrix panels with FM6126A Chip

I purchased a P3 (3mm LED spacing) 64 by 32 HUB75E Panel on eBay.  Needless to say it does not work with a "normal" HUB75 interface.  HUB75E adds a row select called "E" that ties to A4 to get the panel working.  That make 32 row selections possible.  Otherwise noise on that pin would cause garbage to come up on the display once in a while.

Here is a picture of the HUB75 connector from someone else on the Internet.  Note the "E" pin in the middle right of the pin listing.

So far I can only get it to turn all white or half white.  I am working on my own code since all the drivers out there are insanely complex!

 This picture shows the mod to connect E (Located between B and G2) to A4, using the lower yellow jumper wire.  The upper yellow jumper is for the clock to go to D8 or to D11 for use with the Mega.

This is the first video of it starting to work:


Here is a video of THREE 64x32 panels working with an Arduino UNO.


This video shows three panels with different text and background colors.


This is a picture of the display with some different color backgrounds.




The FM6126A Spec sheet tells how the chip is not just a normal shift register.  This was translated from the Chinese manual with google translate.  Basically the number of clock pulses while the LE (Latch Enable) is high tells the shift register what to do.  Three clock pulses are required to latch and display the data.  No clock pulses resets the display.  That explains why most demo programs come up with a blank display.

Instruction         LE     Instruction Description
---------------        ---        ----------------------------
RESET_OEN      0-1     Soft reset signal
DATA_LATCH 3         latches 16 bit data to the output
--                       4~10    Reserved
WR_REG1        11       Write configuration register 1
WR_REG2        12       Write configuration register 2

Remark: The length of LE refers to the number of rising edges of CLK when LE is high. As shown in the figure below, the length of the first LE signal is 3, which is the "Data_Latch" command.

Here is two of the panels working with a Raspberry Pi after running resetmatrix.py


This is the Raspberry Pi VU meter demo program;

This is the back side of one of the LED panels;

My Arduino code is now compatable with the Adafruit demos!

Here is the Youtube Video:


Now some pictures of the demo's running, the first two are called "Plasma"


This is the "Test Shapes" demo:

// 128x32 Uno LED panel driver
// Fast Clock Mod
// 3/4/2019 by Bob Davis

// #define A   A0  // Port D assignments
// #define B   A1
// #define C   A2
// #define D   A3
// #define E   A4
// #define CLK 8 // Port B assignments 
// #define OE  9
// #define LAT 10

int C12[16] = {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int C13[16] = {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0};

#define MaxLed 128
byte BGC1=0x04;  // Background
byte FGC1=0x1C;  // Foreground
byte BGC2=0x20;  // Background
byte FGC2=0xE0;  // Foreground

#define PIXEL_PORT PORTD  // Port the pixels are connected to
#define PIXEL_DDR  DDRD   // D2-D7
#define ROW_PORT   PORTC  // Port the rows are connected to
#define ROW_DDR    DDRC   // A0-A5
#define CLK_PORT   PORTB  // Port the Clock/LE/OE are connected to
#define CLK_DDR    DDRB   // D8-D10

char text1[]="ARDUINO UNO RUNS        ";
char text2[]="TWO 64X32 PANELS        ";

// This font from http://sunge.awardspace.com/glcd-sd/node4.html
byte font[][7] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ascii 32
0x00,0x00,0xfa,0x00,0x00,0x00,0x00, // !
0x00,0xe0,0x00,0xe0,0x00,0x00,0x00, // "
0x28,0xfe,0x28,0xfe,0x28,0x00,0x00, // #
0x00,0x34,0xfe,0x58,0x00,0x00,0x00, // $
0xc4,0xc8,0x10,0x26,0x46,0x00,0x00, // %
0x6c,0x92,0xaa,0x44,0x0a,0x00,0x00, // &
0x00,0xa0,0xc0,0x00,0x00,0x00,0x00, // '
0x00,0x38,0x44,0x82,0x00,0x00,0x00, // (
0x00,0x82,0x44,0x38,0x00,0x00,0x00, // )
0x10,0x54,0x38,0x54,0x10,0x00,0x00, // *
0x10,0x10,0x7c,0x10,0x10,0x00,0x00, // +
0x00,0x0a,0x0c,0x00,0x00,0x00,0x00, // ,
0x10,0x10,0x10,0x10,0x10,0x00,0x00, // -
0x00,0x06,0x06,0x00,0x00,0x00,0x00, // .
0x04,0x08,0x10,0x20,0x40,0x00,0x00, // /
0x7c,0x8a,0x92,0xa2,0x7c,0x00,0x00, // 0
0x00,0x42,0xfe,0x02,0x00,0x00,0x00, // 1
0x42,0x86,0x8a,0x92,0x62,0x00,0x00, // 2
0x84,0x82,0xa2,0xd2,0x8c,0x00,0x00, // 3
0x18,0x28,0x48,0xfe,0x08,0x00,0x00, // 4
0xe4,0xa2,0xa2,0xa2,0x9c,0x00,0x00, // 5
0x3c,0x52,0x92,0x92,0x0c,0x00,0x00, // 6
0x80,0x8e,0x90,0xa0,0xc0,0x00,0x00, // 7
0x6c,0x92,0x92,0x92,0x6c,0x00,0x00, // 8
0x60,0x92,0x92,0x94,0x78,0x00,0x00, // 9
0x00,0x6c,0x6c,0x00,0x00,0x00,0x00, // :
0x00,0x6a,0x6c,0x00,0x00,0x00,0x00, // ;
0x00,0x10,0x28,0x44,0x82,0x00,0x00, // <
0x28,0x28,0x28,0x28,0x28,0x00,0x00, // =
0x82,0x44,0x28,0x10,0x00,0x00,0x00, // >
0x40,0x80,0x8a,0x90,0x60,0x00,0x00, // ?
0x4c,0x92,0x9e,0x82,0x7c,0x00,0x00, // @
0x7e,0x90,0x90,0x90,0x7e,0x00,0x00, // A
0xfe,0x92,0x92,0x92,0x6c,0x00,0x00, // B
0x7c,0x82,0x82,0x82,0x44,0x00,0x00, // C
0xfe,0x82,0x82,0x82,0x7c,0x00,0x00, // D
0xfe,0x92,0x92,0x92,0x82,0x00,0x00, // E
0xfe,0x90,0x90,0x80,0x80,0x00,0x00, // F
0x7c,0x82,0x82,0x8a,0x4c,0x00,0x00, // G
0xfe,0x10,0x10,0x10,0xfe,0x00,0x00, // H
0x00,0x82,0xfe,0x82,0x00,0x00,0x00, // I
0x04,0x02,0x82,0xfc,0x80,0x00,0x00, // J
0xfe,0x10,0x28,0x44,0x82,0x00,0x00, // K
0xfe,0x02,0x02,0x02,0x02,0x00,0x00, // L
0xfe,0x40,0x20,0x40,0xfe,0x00,0x00, // M
0xfe,0x20,0x10,0x08,0xfe,0x00,0x00, // N
0x7c,0x82,0x82,0x82,0x7c,0x00,0x00, // O
0xfe,0x90,0x90,0x90,0x60,0x00,0x00, // P
0x7c,0x82,0x8a,0x84,0x7a,0x00,0x00, // Q
0xfe,0x90,0x98,0x94,0x62,0x00,0x00, // R
0x62,0x92,0x92,0x92,0x8c,0x00,0x00, // S
0x80,0x80,0xfe,0x80,0x80,0x00,0x00, // T
0xfc,0x02,0x02,0x02,0xfc,0x00,0x00, // U
0xf8,0x04,0x02,0x04,0xf8,0x00,0x00, // V
0xfe,0x04,0x18,0x04,0xfe,0x00,0x00, // W
0xc6,0x28,0x10,0x28,0xc6,0x00,0x00, // X
0xc0,0x20,0x1e,0x20,0xc0,0x00,0x00, // Y
0x86,0x8a,0x92,0xa2,0xc2,0x00,0x00,  // Z
};

void setup() {
  PIXEL_DDR = 0xFF;  // Set all pixel pins to output
  ROW_DDR = 0xFF;    // Set all row pins to output
  CLK_DDR = 0xFF;    // Set all CLK/LE/OE pins to output

  PORTB=0;
  // Send Data to control register 11
  for (int l=0; l<MaxLed; l++){
    int y=l%16;
    PORTD = 0x00;
    if (C12[y]==1) PORTD=0xFC;
      if (l>MaxLed-12){ PORTB=7; PORTB=6; }
      else{ PORTB=1; PORTB=0; }
    }
  PORTB=0;
  // Send Data to control register 12
  for (int l=0; l<MaxLed; l++){
    int y=l%16;
    PORTD = 0x00;
    if (C13[y]==1) PORTD=0xFC;
      if (l>MaxLed-13){ PORTB=7; PORTB=6; }
      else{ PORTB=1; PORTB=0; }
    }
  PORTB=0;
}

void loop() {
  for (int c=0; c<600; c++){
    if (c > 000){BGC1=0x04; BGC2=0x20; FGC1=0x1C; FGC2=0xE0;}
    if (c > 200){BGC1=0x08; BGC2=0x40; FGC1=0x1C; FGC2=0xE0;}
    if (c > 400){BGC1=0x10; BGC2=0x80; FGC1=0x1C; FGC2=0xE0;}
    // Select the Row
    for (int r=0; r<16; r++){
      for (int l=0; l<MaxLed; l++){
        int y=l%8; // remainder after division
        int pd1 = BGC1;
        int pd2 = BGC2;
        if (y < 6){
          if ((font[text1[l/8]-32][y] >> 8-r/2) & 0x01==1) pd1=FGC1;
          if ((font[text2[l/8]-32][y] >> 8-r/2) & 0x01==1) pd2=FGC2;
          PORTD=pd1+pd2;
        }
        if (l<MaxLed-3) {PORTB=1; PORTB=0;}
        else {PORTB=7; PORTB=6;}
      }
      PORTC=r;  // Update row
      PORTB=0;
    }
  }
}

Wednesday, February 13, 2019

More Thyroid problems

DISCLAIMER: I am not a doctor nor do I play one on TV, but the docs have sure seen a lot of me. If you have a medical problem see a doctor.

My latest CAT scan showed some more problems with my liver. I researched it and found out that some people with thyroid problems also develop liver problems. Then I found out that some people have problems with their thyroid medicine. So I tried reducing, then eliminating my thyroid medicine and discovered that I felt much better.

About that time I was having my car worked on and struck up a conversation with a guy that was in the shops waiting room.  I mentioned about stopping taking synthroid.  He asked if the pill was yellow.  I thought that was a really strange question, but the pill is yellow. He said that some people are allergic to the yellow die like in Mountain Dew. I have known for years that I cannot drink Mountain dew!

Eventually my doctor tried a dosage of synthroid that did not have the yellow die, but unfortunately the side effects were the same.

I do fairly well without synthroid by taking supplements like "Thyroid Activator".  It contains kelp and Irish moss.  My blood tests showed that the levels of free T3 and T4 are within .1 of being normal.  My TSH was 12 however, so the doctors want me on something.

My Synthroid / Levothyroxine Symptoms:
Bloating, Nausea, Headache, and Dizziness.
Bending at the waist is painful.
Muscles cramp and bones ache all over.
Loss of energy, Exhaustion, Need to rest.
No BM, (hemorrhoids from trying) No Appetite.
Difficulty standing (Legs feel like rubber).
No restful sleep, wake up feeling exhausted.

Friday, February 8, 2019

Trying to decide where to go to next? New processor?

I am trying to decide what to build next.  Amoung the options is "Arduino Audio Projects".  Should I use a different processor?  This is what I have collected so far:
There is an STM32/Nucleo 64 board.
There are two ESP6266 processors (Only one analog pin)
There are an Arduino UNO, DUO and MEGA.
There is an Orange (and I have several Raspberry processors)
There is a TEENSY 2.0 (Should have gotten one with more pins)
There is one board where I forgot the processor name!

Then there are all of these LCD screens (and there are more).
Don't even ask me to explain what all of these LCD's are!

I also have a collection of addressable LED arrays, signs, and strips.

Would "Arduino Audio projects" be a worthwhile book?

Should I start writing about another processor/board?

Tuesday, January 1, 2019

Dynex 37L150A11 Power Supply and Inverter Repair

I was given a Dynex 37 inch LCD TV to repair or sell parts out of.  The first most obvious problem is the power supply needed two new 1000 uF 35 volt capacitors.  Those capacitors were bulging with some black ooz coming out of the top of one of them.

The second problem is that there are two CCFL tubes that are dim or out.  This causes the OZ964 based inverter to shut off after a couple of minutes.  The standard solution is a 5K resistor to power and a LED to ground.  Attach the center of the two to pin 4 or pin 10 depending on what web site you visit.  Using pin 5 as power and attaching the led to pin 4 resulted in a dim picture.  Using pin 10 was also dim.  I changed to a high efficiency green LED to get good brightness. That green LED is a 2.2 volt device when most LED's are 1.8 volt devices.  If you use a 2.4 volt device the screen gets too bright and starts flashing likely because of an over current condition.


Here is a picture of the other side of the inverter board showing the model number.

By the way you should check all of the transformer outputs for shorts first.  Also 2 of the transformers (top one and third one down) will have a different reading because they use different driver transistors for some reason.

This mod did not last.  After a few weeks the screen brightness started flickering then went dim.  Next I tried the load resistor idea.  I tested the CCFL tubes with a small 2 tube driver.  It only lit the tubes dimly, but, with it I could clearly see tube 2 was not lighting at all.  However, when I had bypassed the safety shutdown, tube 4 or 5 was also not working.  That might indicate there is a bad transformer.

I attached a 470K resistor from CCFL output 2 to ground.  The TV blinked on and off.  I added two more resistors so there were three 470K resistors in series.  That worked for 10-20 minutes until smoke started rolling off the resistors.  Apparently you need about 160-220K rated for at least 5 watts to do this trick.

Next I tried linking two of the outputs together.  I used a 1K resistor from CCFL 2 to the other outputs one at a time.  I discovered that trick works for every other output.  Apparently there are two phases and crossing them causes the TV to shut down.  But, linking two outputs together through a 1K resistor, seems to work for now.  I will keep you updated on this option and how it lasts.

This modification has lasted for a few months now.


Wednesday, December 19, 2018

Raspberry Pi Controlled Humanoid Robot

I am rebuilding the humanoid robot from a few years back, but this time it has a Raspberry Pi controlling it via a PCA9685 controller.

Here is the video:


At one point he fell apart and had to be rebuilt.

I crunched the code, now it is much shorter.

# PCA9685 Servo controller for 16DOF humanoid
#
# 01234567890 = select servo 0-15
# Z = Center all servos
# -,+ = Decrease, increase servo
# Range is 20-90-160
# q=quit

import curses
import RPi.GPIO as GPIO
import time
from SunFounder_PCA9685 import Servo

# Turn on instant key response
key = curses.initscr()
#curses.cbreak()
key.keypad(1)
key.nodelay(1)

# Set default positions
s=[90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90]
sservo=0
r=[90,70,70,90,90,90,90,90,90,90,90,90,90,90,90,90]
l=[90,90,90,90,90,110,110,90,90,90,90,90,90,90,90,90]
w=[90,90,90,90,90,90,90,90,70,120,120,20,90,90,90,90]
f=[90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90]

# Set up servos
myservo = []
for i in range(0, 16):
        myservo.append(Servo.Servo(i))  # channel 1
        Servo.Servo(i).setup()

while True:
    char = key.getch()
    if char == ord('q'):
        break
    elif char == ord('1'):
        sservo=1
    elif char == ord('2'):
        sservo=2
    elif char == ord('3'):
        sservo=3
    elif char == ord('4'):
        sservo=4
    elif char == ord('5'):
        sservo=5
    elif char == ord('6'):
        sservo=6
    elif char == ord('7'):
        sservo=7
    elif char == ord('8'):
        sservo=8
    elif char == ord('9'):
        sservo=9
    elif char == ord('0'):
        sservo=0
    elif char == ord('!'):
        sservo=11
    elif char == ord('@'):
        sservo=12
    elif char == ord('#'):
        sservo=13
    elif char == ord('$'):
        sservo=14
    elif char == ord('%'):
        sservo=15
    elif char == ord(')'):
        sservo=10

    elif char == ord('r'):
        for i in range (0,16):
          s[i]=r[i]
    elif char == ord('l'):
        for i in range (0,16):
          s[i]=l[i]

    elif char == ord('w'):
        for i in range (0,16):
          s[i]=w[i]
     
    # Zero servos (90 degrees)
    elif char == ord('z'):
       for i in range (0,16):
           s[i]=90

    elif char == ord('-'):
        for i in range (0,16):
          if (sservo==i):
            if (s[i]>20) : s[i]=s[i]-2
                 
    elif char == ord('='):
        for i in range (0,16):
          if (sservo==i):
            if (s[i]<120 :="" i="" p="" s="">           
    print sservo
    # Send info to servos
    for i in range (0,16):
            myservo[i].write (s[i])

    time.sleep(0.1)

# Close down properly
curses.nocbreak()
key.keypad(0)
curses.echo()
curses.endwin()
# GPIO.cleanup()


Tuesday, December 11, 2018

An idea of how to make a 3D TV set.

Has anyone ever tried taking two LCD screens, placing them one over the other and using a common backlight to make a 3D TV?  Since every TV channel is now 4 channels they could easily broadcast an offset image on two sequential channels to come up with a 3D image.  I am not sure the backlight would be able to penetrate both screens or how that would react to having two screens in front of it.

Friday, November 30, 2018

DIY 6 DOF Robotic Arm Project

I have been building a 6 DOF Robotic arm by reverse engineering the ones found on eBay.  The only new part is the lazy Susan at the base.  That base looks a lot better than the ones on eBay.  All the other parts were laying around left overs from my Humanoid robotics projects.



Here is a video of it running with a Raspberry Pi.


This video is of a Raspberry Pi running it with a PCA9685 controller.


Here is the Arduino powered setup video, YouTube has made it difficult to embed a video....

Friday, November 9, 2018

I am building a 5DOF Humanoid Robot hand


I recently purchased a 5 DOF metal humanoid robot hand.  It comes with instructions but they are written in translated English.  Also some of the pictures are out of date as parts have changed since they were taken.
This is the eBay ad.

Here are the parts that were supplied to make the fingers.  There are some spare parts included with the kit.


Here is the thumb and the fingers once assembled.


This is the frame assembled, the rods on the right are two parts that are screwed together.

This is what it looks like with the servos installed.  Some of the threaded rod lengths are off 1mm from the instructions.


This is the top view of the assembly.  Note that the metal rod holder for holding down the wire ties is "D" shaped and does not look like what is in the instructions.

The next step is to add the wire ties. Screws go into the heads of the wire ties and clamps hold the other end.

Here is the back side with the wire ties in place. 

Here is the first video using an Arduino:

This is a second video this time using an Arduino with an array:

This next video is of an Arduino Uno running two hands.

Now we have a Raspberry Pi running two hands working with a PCA9685 Driver.


Monday, November 5, 2018

Shure Wireless Microphone Repair

I recently had to replace the power switch in a Shure wireless microphone.  If your microphone will not turn on, try replacing the switch.  It might be bad and still "click" when you press the button!  When I tested the last one with a volt meter it was about 500 ohms when pressed.

You need to remove the two screws that hold the battery holder in place and remove the battery holder.  Then remove the three piece power switch panel as well.

Then you need to remove the "C" clip that holds the guts inside the shell.  Small needle nose pliers can sometimes get the clip out.

Then all the guts should come out of the microphone.  There is an additional part or two to remove and the piece that fits around the on off switch was missing.

Here is a picture of the new on off switch.  I soldered it using the head mounted magnification lenses.


This picture shows all of the guts.

Wednesday, October 3, 2018

Rebuilding my CNC with T Slot aluminum and Fully Supported Linear Rails Part 2

I have been rebuilding my CNC with T Slot aluminum and Fully Supported Linear Rails.  Now I am testing it with a Laser to see its accuracy.  I built my own laser by buying the laser, the housing, the heat sink and the controller separately.  Its a 2 watt laser but the power is throttled back to just burn the material.

Here is the video on youtube:


The accuracy is greatly improved!  The X axis used to have some play in it but now it is right on the money.

The fan power pin on the laser controller is backwards from all of the other connectors.  You will need 5-9 volts on the analog connector to turn the laser on.  The blue trimmer sets the laser power.

How much has the continuously supported rails improved the CNC?  Check out the next two pictures for before and after accuracy.  Pay particular attention to the right side of the R and D.
After upgrade result:


Monday, September 17, 2018

2018 Lancaster NY Hamfest

The 2018 Lancaster NY Hamfest is over.  It might be the last one for me this year unless I go to the one in Elmira NY.

This is my display. I had already sold some stuff!
 This was a really neat home made 811 tube RF amplifier.
 This vendor had lots of antique radio's.
More of the same vendor stuff.
 How is this for a beautiful radio?  Its a "Scott Tuner" but not HH Scott!
 Here is a couple of beautiful Heathkit radio's.
  This is what the hamfest looked like from half way down one isle.
.