Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Distance, temperature and humidity measurement - ATtiny861A

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
AlanGHosler

Bascom Member



Joined: 25 Jan 2011
Posts: 110

usa.gif
PostPosted: Tue Oct 29, 2013 11:18 pm    Post subject: Distance, temperature and humidity measurement - ATtiny861A Reply with quote

This program uses a Parallax ping, National Semiconductor LM34DZ and Honeywell HIH-4000-003 sensor to measure the distance (head space), temperature and humidity respectively in a septic holding tank. Elsewhere in this forum is programming for using a MaxDetect RHT03 to measure temperature and humidity. I like the Honeywell sensor when only a few points need to be monitored as I believe it provides a more accurate measurement of humidity and it is provided with a calibration sheet.

The attached program shows the use of Timer1 of the ATtiny861A in the 16-bit mode. I don't believe this is addressed in BASCOM 2.0.7.6.

Interestingly to me is that I could not get statements like "Reset PingLed" to work when accompanied by "PingLed Alias PINB.6." The program would compile but the LED would not flash. So I have used "SET PortB.6" which makes it somewhat more difficult to use this programming with other microcontrollers.

Mark provides me very useful comments on my programs - one of which is to make them more portable. I tried.

Contact me if you are interested the PCB or panel design for the project.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Wed Oct 30, 2013 12:50 am    Post subject: Reply with quote

thank you for sharing your project. good to see you finished it.
about Pingled : you made an alias to a PIN register.
That should be a PORT register.
If you write to a PIN register in the tiny861 you toggle the output pin. If that is what you want, you can best use TOGGLE portb.6
Do not forget that the data direction must still be set to output in order to make it work.

_________________
Mark
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1197
Location: France

france.gif
PostPosted: Sat Jul 20, 2024 9:27 am    Post subject: Reply with quote

Thank you very much for your project, I would like to to something to measure my rain water collector level.
Do you have the part number of your ping detector? 10 years after is it still the same ?

JP
Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2335

blank.gif
PostPosted: Sat Jul 20, 2024 11:51 am    Post subject: Reply with quote

Argh, my comments fell onto an 11 year old post, the TO should know by now the difference between aliasing PIN and PORT. LOL
Back to top
View user's profile
AlanGHosler

Bascom Member



Joined: 25 Jan 2011
Posts: 110

usa.gif
PostPosted: Thu Oct 24, 2024 7:48 pm    Post subject: Ping Part Number Reply with quote

Sorry for the long delay. I have been gone for several months. My sonic detector is a MaxBotix SCXL-MaxSonar WR/WRC MB7589.

It is still operating all these years after being in the head space of a septic tank.

Alan
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1197
Location: France

france.gif
PostPosted: Fri Oct 25, 2024 2:37 pm    Post subject: Reply with quote

hi Alan
Many thanks for your answers. I've found distributors in france. I haven't made any progress with my project yet, but it's next on my list.

JP Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum