BTTF Time Clock Trouble (wheelchair halloween costume)

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

Howdy all,

I'm a volunteer with Magic Wheelchair. We make halloween costumes for kids who use wheelchairs. We're building a Back to the Future DeLorean costume for one of our kids, which is how I stumbled across the Teensy-powered BTTF Time Circuit Clock project.

I'll admit, I'm a complete newbie to projects like this. But I bought all the hardware, a breadboard, and a soldering iron, and I've been teaching myself how to build circuits. It's going slowly but well! I've learned to solder, I've run some basic code on the Teensy 2.0, and I've done a number of tutorial projects using the Teensy and the 7-segment LED displays.

But now I'm trying to put together the BTTF clock circuit, and I'm absolutely stumped on something. Looking at this diagram:

Image

... I can't figure out for the life of me how I'm supposed to connect the Chronodot, the 74HC138 3-to-8 line decoder, and the Teensy to each other. I've got the 7-segment LED displays and their backpacks assembled, and they're all wired up (on my breadboard) for power and data. But the left side of the diagram (the SDA and SCL traces and the two blue traces labeled "Select" coming from the left side of the 3-to-8 line decoder) have me completely befuddled. The fact that the Chronodot doesn't appear anywhere on this diagram also has me stumped.

Does anyone have an idea of how to connect the Teensy to the Chronodot to the 3-to-8? I know I'm jumping head-first into the deep end by selecting this as my first circuit-building project. If I was doing this for myself, I'd start simple and work my way up to this. But you try saying no to a kid who wants to be a DeLorean for halloween.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

The SDA and SCL signals go to pins that have the same names on the Teensy. Different versions of the Teensy put them in difference places though.. which one do you have?

Together, the SDA and SCL signals form what's called an 'I2C interface'.. bascially a way for different chips to talk to each other. SDA is the data line, and SCL is the clock line.. the chips use SCL to decide when to read and write signals on SDA.

The 3-to-8 multiplexer makes the SCL signal invisible to two rows of LED displays at any given time. The boards that can't see SCL don't pay any attention to what's happening on SDA, so their settings don't change. Only the row of displays that does see the SCL signal will accept new settings from the Teensy.

The multiplexer decides where to send the SCL signal based on the signals from two of its address pins (the blue wires). There are four possible combinations of two high/low signals, and the multiplexer uses those to select its output.

The code that tells the Teensy what to do puts those signals on general-purpose input/output (GPIO) pins 9 and 10. Those also live in different positions on different versions of the Teensy.

The ChronoDot is another I2C device, so it will connect directly to the Teensy's SDA and SCL pins.

User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

Mike, thank you! Your explanation is incredibly helpful. I'm using a Teensy 2.0, and the multiplexer I'm using is labeled 74LS138 (not sure if that differs massively from the model used in the original Time Circuit writeup).

If I understand you correctly, this is how the circuits should be laid out (pardon my scribbles and non-canonical color choices). Do I have it right?
Image

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

Yep, that looks good.

According to this pinout diagram from the PJRC website:

https://www.pjrc.com/teensy/card2a.pdf

The SDA and SCL signals will be on pins D0 and D1.
Wellington_p_funk wrote:the multiplexer I'm using is labeled 74LS138 (not sure if that differs massively from the model used in the original Time Circuit writeup).
Nope.. the chip's input voltage thresholds will be a little different, but not enough to matter for the signals that come from the Teensy.

User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

Mike, I really appreciate your help here! I would be completely stumped without it.

So, I connected everything as discussed and ran the sketch from the tutorial, and here's what I've got:
Image

The first row, corresponding to SCL0 going into the multiplexer, is dark. The second and third row are displaying a readout I don't recognize. I know the first-row LCDs are good (tested them a moment ago), so I assume they're just not receiving data. I also tested the Chronodot on a separate circuit, and it seems to be keeping time just fine.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

The middle row's '10.26' is the target date for the time jump.. October 26 1985. My guess is that the '10.13' on the bottom row is the current date in GMT time.

The fact that all three displays in the same row show the same output means they all have the same I2C address. You need to flip the displays over and add a blob of solder to connect the A0 pads of one display in each row, and the A1 pads for one display in each row. That way they'll each listen to a different set of commands from the Teensy.

You'll also want to swap the positions of the red and yellow jumpers at the 74LS138 multiplexer to put the target date on the bottom/yellow row of displays, and the current data on the middle/green row.

Also try replacing the white jumper from the 74LS138 to the top row of red displays. Your connections look right, so that row might not be getting SCK because of a glitch in the wiring.

User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

I GOOFED UP! Instead of shorting the A0 and A1 pads, I shorted the A1 and A2 pads. Now the time displays (on the right, A1 shorted) all work correctly, but the year displays (middle row, A2 shorted) don't show anything. Instead of trying to remove the solder from the A2 pads, is there a way to reconfigure the sketch to recognize these displays?

Image

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

Yes, you can do it in code, but clearing solder pads isn't too hard.

The best way to remove solder from a PCB is with solder wick:

https://www.adafruit.com/product/149

which pretty much sucks up the molten metal like a sponge. Personally, I use a chunk of zipcord (the multi-strand cable used in cheap extension cords.. it pulls apart like a zipper unzipping when you need to split the lines apart). Strip off about an inch of insulation, dip the strands in flux, set them on the joint, then heat the joint with your soldering iron. It's fast and easy once you've done it a few times.


To change the addresses in code, change this part of the setup() function like so:

Code: Select all

/*  OLD VERSION
  // Initialize all three displays on all three buses
  for(b=0; b<3; b++) {
    selectBus(b);
    for(m=0; m<3; m++) matrix[m].begin(0x70 + m);
  }
*/
  matrix[ 0 ].begin( 0x70 );
  matrix[ 1 ].begin( 0x74 );
  matrix[ 2 ].begin( 0x72 );

User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

Hoo boy...

So I got everything wired up correctly on the breadboard, and showing the correct time. (I fixed the problem above by removing the solder from the address pads, rather than changing the sketch.

Everything was working perfectly on the breadboard on the 17th:
Image

But somewhere in the process of transferring everything from the breadboard to my permanent boards, the Chronodot reset itself:
Image

Is there a way to reset the Chronodot once it's been permanently mounted to a perfboard?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

Yeah, you should be able to do that in software.

Start with our fork of RTClib:

https://github.com/adafruit/RTClib

and run the DS3231 example sketch (that's the chip the ChronoDot uses). That should set the ChronoDot to the current date and time along the way.

To go into more detail, the .adjust() function sets the clock. The example sketch calls that function in setup(), using date and time values that are automatially set by the compiler when it builds the firmware. Every time you reset the Teensy with that firmware, the ChronoDot will go back to the same time, but you should only need to do it once.

User avatar
Wellington_p_funk
 
Posts: 6
Joined: Wed Oct 11, 2017 10:45 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by Wellington_p_funk »

IT LIVES!

Image

Mike, I can't thank you enough for all your help. You've been an amazing resource, and I couldn't have gotten this done without you.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: BTTF Time Clock Trouble (wheelchair halloween costume)

Post by adafruit_support_mike »

Awesome. It looks great!

This is exactly why we're here.. our primary goal is to help people learn how to work with hardware and software. You did all the work, I just helped a bit with translation and debugging. You did a good job, so take the time to be happy about it. That rush of seeing a system work correctly for the first time is the payoff for all the work getting there.

You do realize we want to see photos of the final costume, yes? There's a whole section of our blog devoted to cosplay, and we love to see finished projects.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”