Welcome! Log In Create A New Profile

Advanced

Hot Tub

Posted by ugine 
Hot Tub
April 27, 2013 09:14AM
Here is a suggestion from Bruce:
Firstly, please forgive me lack of knowledge.

I am looking to build a Hot Tub controller. (ideally written in some form of Basic)
It requires the following I/O
5 Outputs for relays
3 ADC
8 I/P lines (switches)
4 digit LED 7 segment display

I was looking at using the Raspberry PI with some form of I/O board and came across the BV212, but then after reading about the ByPic language thought I might be able to use BV500 instead.
Am I correct in this thought ??

Looking through the docs/tutorials I see details about driving a 7 seg display, would this still be possible if I connected the BV212 or does it use the same I/O lines ??
Re: Hot Tub
April 27, 2013 09:26AM
sounds like an interesting project. The low cost MX1 (BV500) has 21 I/O but the 7 segment display will take quite a few of those. You will not need a BV212. I suggest the following:

1) BV500_T_k3 (Kit3). This will do the ADC and I/O
2) BV4513 LED 7 Segment display only needs two wires. Or use the MAX display controller with a little bit of code you can get these on eBay very cheap - but they come from China so take a while.
3) 8 way relay board (or 5 if you can find one), plenty on eBay or see this page for some ideas.

Wiring:
RA0 ADC0
RA1 ADC1
RB0 ADC2
--------
RB1 RLY0
RB2 RLY1
RB3 RLY2
RB4 RLY3
RB5 RLY4
RB6 in-0
RB7 in-1
--------
RB8 SCL - to 7SEG
RB9 SDA - to 7SEG
--------
RB10 in-2
RB11 in-3
RB12 in-4
RB13 in-5
RB14 in-6
RB15 in-7

This still leaves a couple of lines spare. Some other points:
1) The relays cannot be driven directly from the microcontroller, so a relay board will be needed, be sure you get the opto-iosolated type as they will work from 3.3V which is the output from the microcontroller.
2) Power is supplied by the USB to serial converter but you will need to power the board when running stand alone so some kind of 5V power supply will be needed.
3) The USB to serial will not power all the relays at once, the power supply needs to be at least 500mA



Edited 1 time(s). Last edit at 07/15/2014 06:29AM by jimeer.
Re: Hot Tub
April 27, 2013 11:07AM
Thanks for the ideas.

Sorry did I miss the fact that the BV500 has ADC built-in or are you suggesting that I interface a number of ADC.s to those lines ?

I had already obtained Maxim 7219 & 7221 in an attempt to interface to the current 7 Seg display, but was trying to use a Make Controller, which now appears to be defunked.

When it talks about I2C is that another term for SPI connections ?
Re: Hot Tub
April 27, 2013 11:36AM
1) The BV500 has built in ADC.
2) The code for interfacing the MAX is here
3) No I2C and SPI are different, the MAX uses SPI and the BV4513 uses I2C
Re: Hot Tub
May 21, 2013 10:45PM
OK, so the parts have arrived and I have put them together, the BV500 works fine and I can load the Rookie code and perform simple bits of code.

I changed the design slightly so instead of using 8 input lines I have used a 74HC148, which I then connected the GS output to an Interrupt input and will then read the 3 encoded lines (A0,A1,A2)to workout which switch was pressed, so saving a few I/O ports.
I also wired up the MAX7219 so that I could use the SPI and the code you pointed me to,
BUT reading the page I feel a few bits are missing or over looked (or I'm not seeing it)

in the code how are RB13 & RB14 configured ?

Are spi_init and spi_data commands or missing functions and where are they documented ?

"dim g" (appears to be the value to be displayed) but I can't makeout where it is or should be set?

and what function should I be calling to activate the display ?
Re: Hot Tub
May 22, 2013 07:39AM
Bruce,
The documentation for SPI is here.
RB13 & 14 are configured when you run spi_init() - you can look at the rookie code to confirm this.
To get the display going type test_max()
Sorry, only registered users may post in this forum.

Click here to login