[TriEmbed] Trail Traffic Counter Update and Lessons Learned

Charles McClelland chip at mcclellands.org
Tue Nov 26 13:38:57 CST 2013


To all, 

I am sorry I missed last month’s meeting where there was apparently some good discussion on approaches to this project.  I am hoping my travel schedule will allow me to make the December 2nd meeting.  I have done a fair bit of work since my last note and wanted to share some progress and lessons learned (and perhaps get some more good ideas from this group).

1) Features:  In talking to my friends from the local parks and trail managers from bike clubs, it became clear that using the EEPROM on the ATTiny was not user-friendly enough for them.  In addition, they wanted real time date and time logging not just a running millis() count.  So I added a micro-SD card for data logging and a real time clock.  Since the micro-SD card was an SPI bus device, I switched from the 1307 I2C real time clock to the fancy (and expensive) DS3234 based clock which could sit on the SPI bus and had temperature compensation which is important since this device was intended for outdoor use.  This decision, in turn, forced me to abandon the ATTiny for the Arduino Pro Mini.

2) SPI bus frustrations - I lost a fair bit of hair trying to get both the real time clock and the Micro-SD card reader to co-exist on the SPI bus.  I found out that in addition to the chipselect wire, I also had to change SPI Mode as each device has a favorite mode for SPI communications.  The Mode is selected in the SD-Card library itself so I missed the fact that is was switching to MODE0 each time I called a function from that library.  I chose not to use a library for the real time clock (just SPI) so I was able to change it in my code as I called the two devices.

3) Battery life.  For version 3, my goal was to get to a full week running on standard batteries.  I believe I have achieved this and here are some of the trials and successes:
	- Moved away from the 7805 voltage regulator.  Initially I tried this pin-compatible alternative that is 85% efficient and does not require external capacitors.  Eventually, I chose to simply use the regulator built into the Pro Mini board.
	- Changed from 18650 LiON batteries to 4 AA alkaline batteries in series.  Not sure if this is any better than 3 AA batteries so I plan to test that next.  Thoughts?
	- Moved from 5V to 3.3V - this helped on two fronts.  1) The micro SD card is a 3.3V device so I eliminated some components. and 2) I was able to use the voltage regulator on the Pro Mini for more of my battery pack’s useful life
	- Put in a switch to turn off the LED - it turned out that the indicator LED I was using for setup / testing was a major drain - added a latching push button switch to turn it off for normal use

4) Sleep mode - I played with this but was disappointed.  It turns out that the millis() count is stopped in all but the lightest sleep mode.  This was a real problem before I moved to the real time clock but I could also not get the interrupt working consistently with the piezo sensor (too transient a signal?).  May revisit but it looks like I hit my goal for battery life without this step.

5) Sensor - I heard there was discussion about using an accelerometer instead of a piezo for sensing movement.  I would be interested in this but have a concern about using a $10 for the most exposed part of the system.  I recently bought a lot of 10 piezos from eBay for $6 and my expectation is that this is the component which will get the most wear and abuse.  I am looking at a few alternatives to the basic piezo - a larger version, one with a mass attached (as I am looking for low frequency signal), and perhaps a vibration switch which could solve my interrupt problems.  Would be interested in any thoughts folks have on this.

I will plan to bring the board to the next meeting.  I have a trail manager in Connecticut who is asking to be a beta tester so I plan to send him one and once I get his input.  Then, I hope to move to move to a PCB design and avoid the extra cost of the breakout boards.  If anyone is interested, happy to share sketches and designs.   Also, if there is a local park or community who wants to get some hard data on trail use, I would be happy to hook them up in return for their input on the design.

Thanks again for everyone’s help.

Chip





On Nov 26, 2013, at 1:00 PM, triembed-request at triembed.org wrote:

> Send TriEmbed mailing list submissions to
> 	triembed at triembed.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> or, via email, send a message with subject or body 'help' to
> 	triembed-request at triembed.org
> 
> You can reach the person managing the list at
> 	triembed-owner at triembed.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of TriEmbed digest..."
> 
> 
> Today's Topics:
> 
>   1. Joint IEEE/Triangle Amateur Robotics and Triangle Embedded
>      Computing meeting THIS Monday 12/2 (free pizza) (Pete Soper)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 25 Nov 2013 22:27:12 -0500
> From: Pete Soper <pete at soper.us>
> To: triembed at triembed.org, 	Triangle Amateur Robotics
> 	<trianglerobotics at yahoogroups.com>
> Subject: [TriEmbed] Joint IEEE/Triangle Amateur Robotics and Triangle
> 	Embedded Computing meeting THIS Monday 12/2 (free pizza)
> Message-ID: <52941510.2050205 at soper.us>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Spread the word. Profs: tell your students. Students: tell your profs 
> about the joint meeting Monday of next week, starting with free pizza 
> and soft drinks in the Engineering Building One lobby (courtesy of the 
> IEEE). There will be a presentation about Raspberry Pi by Ruth Suehle 
> and Tom Calloway, authors of "Raspberry Pi Hacks." Bring your show and 
> tell gadgets.
> 
> Additional details and map here: http://triembed.org/
> 
> -Pete
> 
> 
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> TriEmbed mailing list
> TriEmbed at triembed.org
> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> 
> 
> ------------------------------
> 
> End of TriEmbed Digest, Vol 6, Issue 10
> ***************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20131126/4eb71b6f/attachment.htm>


More information about the TriEmbed mailing list