November 23, 2024, 03:36:02 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Time/Date adapter for HC-8+ Option header

Started by leving, December 06, 2016, 07:27:31 AM

Previous topic - Next topic

leving

We talked long ago when I first purchased an HC-8 and you had mentioned you were working on a Time/Date adapter.  Have you made any headway with that?  I was hoping to use it to fully automate control of a large menorah project with LED light bulbs that I will try to get to flicker.   The plan was to program candle lighting times for years to come so that one only has to plug it in and the lights come on when required.  I am still working on getting all the parts together and like last year...I'll have it ready next year for sure.
Everyone will be happy.
Even if they must be held down kicking and screaming until they are.

JonnyMac

December 06, 2016, 09:48:58 AM #1 Last Edit: December 06, 2016, 11:43:52 AM by JonnyMac
The reality of the cost-to-build versus the demand for the module hit pretty hard, hence it's not availalbe. That said, there are plenty of off the shelf RTC modules with battery back-up that are easy to connect to the HC-8+. In fact the latest version of the HC-8+ (Rev F) has an I2C port to make connecting such devices even easier.

Here's an example:
-- https://learn.adafruit.com/adafruit-ds3231-precision-rtc-breakout/downloads

If you're an Amazon shopper, you can get two similar modules for $9:
-- https://www.amazon.com/gp/product/B014IYBGG0/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

When I get a module, I will write some code for the HC-8+ that will show you how to set the clock, and set timed events. I might even code a Menorah for my friend's Hanukkah party.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

December 06, 2016, 11:33:35 AM #2 Last Edit: December 06, 2016, 03:53:41 PM by JonnyMac
I've got a couple modules on order (from Amazon). The diagram below shows the connections, regardless of which module you go with (Adafruit module shown in my illustration).

Option #1 = 3.3V
Option #4 = SDA
Option #5 = SCL
Option #6 = GND

Option #4 is the A0 pin; Option #5 is the SCL pin. It's important to note that the A0 and SM switches must be in the OFF position.

This connection scheme will work with any HC-8+. For those with Rev F boards, the I2C port can be used (the module runs at 3.3V or 5V, so either connection is legal).

Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Here are the connections to the Amazon module -- this is the one I have on order. This module also contains an extra EEPROM. It looks like the EEPROM is assigned to addres %111 (7) so it shouldn't collide with the Propeller EEPROM if you connect this to the Rev F I2C header. I will verify over the weekend when I have the module.

The object I'm working on is for the DS3231 (the RTC chip), so it will work with either device.


Jon McPhalen
EFX-TEK Hollywood Office

leving

I have a Rev C board.  Will that make a difference in the coding?  I bought it way back when I first thought up this grand plan for the huge menorah.
Everyone will be happy.
Even if they must be held down kicking and screaming until they are.

JonnyMac

No -- I will code it to work on the OPTION port which is available on all boards.

Since the HC-8+ only has 8 outputs, the Shamash candle is tied to output 1. My RTCs are supposed to arrive today and I already wrote an object for the DS3231 (was close to the DS1307 so it was easy). I'll post date/time enabled Menorah code in the next couple days.
Jon McPhalen
EFX-TEK Hollywood Office

leving

I was planning on the Shamash and candle one both being together.  Makes sense since both will always be on together.
Everyone will be happy.
Even if they must be held down kicking and screaming until they are.

JonnyMac

Sorry this took so long -- it was trickier than I thought. It is presently setup to run for Burbank, CA. You will need to look up the sunset times for your city (there is a web link in the code).

This program is an automated Menorah, but has the tools for setting the clock, and monitoring the date/time and acting on it (to the second).

I hope you find this interesting and useful. Again, it's a bit tricky so do take some time to study it and post any questions you have here.

Happy Hanukkah!
Jon McPhalen
EFX-TEK Hollywood Office

leving

Thank you.  I have the HC-8 along with the DS3231 chips I got from Amazon on the workbench and now with the code I'm ready to go.  I hope to have the brains assembled and ready by the end of January and definitely have a 15-20' automated Menorah ready for next year.   Still pondering whether to build LED lights or just use 102v LED Edison lights off the shelf but, I think that is another post ;) as either will have to do the ol'candle flicker. 

This should silence the folks that expect my yard to be as beholding now as it is during Halloween. :o
Everyone will be happy.
Even if they must be held down kicking and screaming until they are.

JonnyMac

Hanukkah doesn't start until Saturday evening, so you could always do something small this year.
Jon McPhalen
EFX-TEK Hollywood Office