sandclock2

The topic on number crunching

sandclock2

Postby rayveth » Fri Feb 03, 2017 4:50 pm

A lovely project, build it , programmed it and enjoyed its working.
Everything fitted perfectly.
mouted 2 stripes of tape from the sandplatform to the baseplate for picking up protection, preventing it from falling apart.
One annoying thing is the dutycycle of 1 minute.
This should be adjustablle (ex 5 min) or selected pushbutton.
Mirror or upside down writing could be an option too.
Ray
This was my review
Now I have tryed to alter the program I have some knoledge about C but not enough!
I asumed the repeattime is build in this part:

switch (auto_mode.state)
{
case 0:
{
auto_mode.vib_millis = millis();
vib_turn_on();

auto_mode.state = 1;

break;
}

case 1:
{
if ((millis() - auto_mode.vib_millis) >= (vib_period_s * 1000))
{
if (auto_mode.drawn_min != pcf2129_info.dt.minute)
{
auto_mode.drawn_min = pcf2129_info.dt.minute;

vib_turn_off();
auto_mode_draw_dt();
pen_lift_up();
pen_set_resting();

auto_mode.state = 2;
}
}

break;
}

case 2:
{
if (pcf2129_info.dt.second >= (60 - vib_period_s))
{
auto_mode.state = 0;
}

break;
}
}
}
Buid in a little counter in case 2: like :
int q;

case 2:
{
if (pcf2129_info.dt.second >= (60 - vib_period_s))
{ q = q +1 }
if ( q==6 )

{
auto_mode.state = 0;
}

break;
}
So this does not work,tryed som different setup's but still no result.

Can Anyone help me out
Regards Ray
rayveth
 
Posts: 1
Joined: Fri Feb 03, 2017 4:26 pm

Re: sandclock2

Postby crlMidi » Mon Feb 27, 2017 5:26 pm

I liked the sand clock so much, I connected a second Arduino (by I2C) to chime the quarters and the hours using the tune library. You can use your own melodies and the program will calculate the timing so the quarter chimes begin at the right time so they end before the vibration starts (based on the default 5 second setting, but you can change the timings). The hours strike as soon as the corresponding bytes reach the second Arduino.

I've attached a zip file with all the information.

To get the times, I soldered a 6-conductor ribbon connector to the shield. The usual Arduino stackable headers are too tall, but if you haven't already started assembly, alternative plug-and-socket solutions can be found. The ribbon (and connectors I added for the sand tray) come out through a slot I cut in the back-plate (see photo).

Sketch sandclockBigBen.ino is a version with a few lines of added code that simply send the bytes for hours and minutes to the the Arduino running BigBenIC2.ino. In response to a complaint about the noise, sketch sandclockBigBen15min.ino vibrates and writes in the sand only every 15 minutes (or whatever you want to program).

If I were to take this further, I'd add a permanent pretty time display, and as proposed by others, some switches that let you turn on the sandclock mechanism only when you want to show it off to admiring visitors. I haven't worked out how to extract the complete time data, nor how to take control using switches or a rotary encoder. We don't want to ask for anything that would increase the price, but the sand clock really needs some breakout and input facilities so people can do their own thing.

Slightly off-topic: The second Arduino is powered from the first. However, during testing I was not happy about having a ground loop via the I2C ground return and the USB cables, specially if the connection is long. This could lead to difficulties an Arduino beginner might have trouble with. I2C isolators are cheap enough, but not when mounted on a little PCB ready to go. An alternative would have been to declare a soft serial port and use a music MIDI interface (NB the specified opto-isolators are too slow & I use the 6N136 from HP).

It would be fun to use a little xylophone and some actuators to do the chimes. More in the spirit of the project would be a single actuator that moves around the xylophone.

Finally, in response to some comments elsewhere, a few years ago I bought some plexiglass, polishing materiel and the special glues on the web (the supplier was plexiglas-shop.com, which also provides advice on machining, etc.).
Attachments
Chimes1.zip
Contains BigBenI2C.ino, sandclockBigBen.ino and sandclockBigBen15min.ino. The Eagle schematic is Chimes1.sch with the corresponding png. I've added a few photos.
(345.69 KiB) Downloaded 26 times
crlMidi
 
Posts: 3
Joined: Tue Feb 16, 2016 3:28 pm


Return to Microcontrollers & Embedded

Who is online

Users browsing this forum: No registered users and 1 guest