Stc-1000+

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Is there anything wrong with changing the pin assignments in the initial #DEFINE lines to use physically closer-together pins? I'd like to make a quick-connect cable and I could use fewer header pins that way.
 
It occurred to me that you could repurpose and STC1000 to do just about any single job that required one input and two outputs. Connect a hall effect flowmeter up to where the thermistor connects to and program the pic to watch the flow rate and alarm if it goes too high or too low. Instead of an alarm light/buzzer hooked to one of the relay outputs, you could hook a solenoid valve up and use the flow meter to automatically measure water into your HLT.

Hmmm.. There has got to me a lot of other uses besides temperature control..


At that point id just use the arduino to do all that.


Sent from my iPhone using Home Brew
 
get your hands dirty coding :)

I'm working on it... ;)

SDCC and GPUTILS loaded on my Linux partition. Did you use Code::Blocks or another IDE?

I've also got MPLAB loaded on the windoze partition but MPLAB is a hard piece of software for my non-programmer mind to understand...
 
Is there anything wrong with changing the pin assignments in the initial #DEFINE lines to use physically closer-together pins? I'd like to make a quick-connect cable and I could use fewer header pins that way.

You probably could. But I don't think I'll change

I'm working on it... ;)

SDCC and GPUTILS loaded on my Linux partition. Did you use Code::Blocks or another IDE?

I've also got MPLAB loaded on the windoze partition but MPLAB is a hard piece of software for my non-programmer mind to understand...

Make sure to get most recent versions of SDCC and GPUTILS, the ones included in your distribution might be too old.
I use eclipse, but I think you could use just about any editor.
 
You probably could. But I don't think I'll change



Make sure to get most recent versions of SDCC and GPUTILS, the ones included in your distribution might be too old.
I use eclipse, but I think you could use just about any editor.

I built both direct from source - they're the latest :)
 
And another update.

Ok, so true ramping between setpoints is just not possible. But I think I have been able to add an approximative ramping solution.
It adds up to 7 intermediate steps by dividing the duration of a step into 8 pieces and interpolate between the setpoints (much like how the interpolation of A/D lookup values work) when the current duration reaches one of those points.
The ramping should work 'good enough' no matter what the duration between the setpoints is, but will work best when when duration is a multiple of 8 (i.e. 8, 16, 24... hours)
For example, say that sp0 is 4.0 degrees (excuse me here, I'm thinking in C but it really doesn't matter) and sp1 is 8.0 degrees and dh0 is 24 hours. If ramping is enabled, then starting the profile, sp will be set to 4.0, after 3 hours (since 24/8=3), sp will be set to 4.5. After 6 hours 5.0 and so on.

The implication of this is that if you want to use pseudo ramping, but still still keep a constant temperature over some part of the profile, you'd need an extra setpoint that has the same value (i.e it really will try to ramp between two points with the same value).

Even though it is not true ramping, I think this will help with gradually lowering temperatures for lagering for example.

I have added a new config value under the 'set' menu, 'rP' (ramping), that can enable (set to 1) or disable (set to 0) the use of ramping. Ramping will be disabled by default.

I have just tested the code on my computer + I left my STC running ramping over night, and it seems to work, but it not really all that well tested yet.

I've pushed the change to the work branch if anyone is interested in trying it out.

Edit: I'll add a picture to maybe better illustrate how it works.

dfhkzc.png


This shows a profile where sp0 = 4.0, dh0 = 24, sp1 = 8.0, dh1 = 24, sp2 = 8.0, dh2 = 4, sp3 = 4.0
The blue dots indicate where sp is updated (each hour).
 
I *FINALLY* got the STC & Arduino, quickly tested both to ensure no DOA, and will flash tonight to start testing, but nickmv and atoughram are way ahead of me. :mug:
 
Alpha, I haven't had a chance to play with the STC since you added button acceleration. I just dropped the latest work commit on one.

The button acceleration is awesome. Perfect.

The ramping sounds great too. I should have time this afternoon to get 5 gallons of water into the dorm fridge and start a three day program with a few ramping tests in there.

Thanks again for all the hard work. The STC+ is pretty sweet.
 
Some questions for you Alpha:

1) If you are running a program, what happens if you go into the setup for that program (say Pr0) and look at the settings, but don't change them? It doesn't restart the program or anything like that does it?

2) Same scenario as above, but you make changes to Pr0. Does it restart the program or just incorporate the changes if it hasn't made it to the step you changed yet? What if you change the step it is currently on?

3) Regarding ramping, it can only change the set point once per hour correct? So a step from 60 to 70 in 1 hour wouldn't increment every 7.5 minutes, you'd just get a regular step from 60 to 70 on the hour?

4) If I ramp from 60 to 70 in 2 hours, I should get a set point change to 65 after one hour, right?

Edited to add: I guess the question in #4 is, how does it handle small increments not divisible by 8? I'm just curious, I do realize that people will probably not be ramping in increments of less than 12 or 24 hours when actually fermenting something.
 
Some questions for you Alpha:

1) If you are running a program, what happens if you go into the setup for that program (say Pr0) and look at the settings, but don't change them? It doesn't restart the program or anything like that does it?

2) Same scenario as above, but you make changes to Pr0. Does it restart the program or just incorporate the changes if it hasn't made it to the step you changed yet? What if you change the step it is currently on?

3) Regarding ramping, it can only change the set point once per hour correct? So a step from 60 to 70 in 1 hour wouldn't increment every 7.5 minutes, you'd just get a regular step from 60 to 70 on the hour?

4) If I ramp from 60 to 70 in 2 hours, I should get a set point change to 65 after one hour, right?

1. No, it doesn't.

2. No, it does not restart. It will use the change, if it hasn't reached that step yet. If you change duration for the step it is currently on, it should be used, but if you change setpoint it will not be updated as that point has already passed. Only, if you use ramping, then setpoint will be recalculated every hour. There is no validation or other handling of the user input even during running a profile and the values are the ones used directly by control, so you sort of need to know how the control works or it might be a bit confusing as to what will (or will not) happen when you change the values. This probably should be explained in a better user manual.

3. Yes. That is exactly correct. Setpoint will only update on the hour, even with ramping. Setpoint is stored in EEPROM, so to avoid excessive wear, it will only write once per hour. There are other reasons for this as well, but I won't bore you...

4. Yes.

Edit: Just saw, your edit... It should handle any duration decently, but there will be at most 7 intermediate 'steps'. It is an approximative solution, so there can be some rounding and truncation, but it should work 'good enough'. My reasoning is that even if true ramping is not possible, an approximation is better than nothing.
 
As for ramping...

Most people want it over a couple days, why not just keep the heating element unplugged, and change the temp to the start of the ramp period and let the fridge/freezer ramp up from insulation loss? I assume a chest freezer would probably do it over a day or so if its only a couple degrees.

Just a thought.

Thanks alpha, looking forward to this. No need for it right now, but will soon!
 
Regarding the pseudo ramping.

How did you come to choose 8 steps ? Maybe for future features, could you instead set
the ramping parameter to 0 or 8. That way, later if you can do more ramping steps, one
can set the parameter to say 10 or 7 or 14 and thus get that many intermediate steps.

I presume its about division by a general N...
 
Regarding the pseudo ramping.

How did you come to choose 8 steps ? Maybe for future features, could you instead set
the ramping parameter to 0 or 8. That way, later if you can do more ramping steps, one
can set the parameter to say 10 or 7 or 14 and thus get that many intermediate steps.

I presume its about division by a general N...

There is more than one reason. The number of steps need to be power of two, because I need to do shifts and not division. And 8 are the maximum I can do and still be sure that the 16 bit temperature accumulator won't overflow.
 
I have a long test with several ramps and steps running now.

It was going to be a pain to fit a 6 gal better bottle in that dorm fridge. Definitely possible, but a pain. I decided to be lazy and put a gallon glass jug full of star san in there.

I'll report on how it does.

It was really nice to program the settings with the button acceleration.
 
Every time I connect anything to nMCLR pin, the STC goes dead. I can have everything connected, plug in the Arduino, and it will flash the temp for about a second and then die. When I open the Serial Monitor, the same thing happens.

I really want to get this working, but it's doing this on all three of my STCs. What the hell am I doing wrong?

EDIT: Nevermind. For some reason, the sketch wasn't uploading to the board. I restarted, uploaded, and it worked great. Now I'm excited!
 
Found a bug in the ramping feature.

The settings were as follows:

Code:
Ramp Test 1					
Setting	Temp	Setting	Hours		STEP
SP0	45	DH0	8		1
SP1	45	DH1	8		2
SP2	55	DH2	12		3
SP3	55	DH3	6		4
SP4	60	DH4	12		5
SP5	60	DH5	8		6
SP6	68	DH6	48		7
SP7	33	DH7	0		8
SP8	33	DH8	0		9
SP9	33				10
					
		Hours:	102

Looks like it did fine until about hour 9, when it started getting colder and colder. When I checked it this morning the beer temp was 24.46F and the set point was 6.3F. It was at hour 7 into SP1. I confirmed the settings for Pr0.

RampTest1.jpg

BTW, it appears that a solution of star san has a much lower freezing point than pure water. It had not frozen and I confirmed the temperature.
 
Ah. Good, thanks for that!
I checked the code and it seems I made a big misstake when I cleaned up the code before pushing it. I think it is weird that the compiler didn't complain.
I'll fix it as soon as I have the chance.
 
I have to retract my previous post. I was simply misstaken.
I can see one possible problem, but I find it very strange you ended up on 6.3F, even with this you should end up somewhere around 55.
I will probably have to dig a bit deeper... I'll get back when I have looked into this some more.
 
I'll start it back up on the desk as soon as I have a time when I can manually monitor the change in set points. Maybe some more information will help pinpoint the issue.
 
Found something interesting (not related to the ramp problem).

I cracked open a third STC-1000 to solder header pins and I found that it is different from the rest.

When this thread popped up, I ordered two Elitech STCs from Amazon (same order). The first one I opened is one that I've been using to test the STC+. I put the second one aside. I then ordered a third (AGPTek) from Amazon and have been testing the STC+ with it.

This second Elitech STC does not have the 5 pin header beneath the IC, and the IC is much bigger and oriented vertically. It looks like there is a 6 pin header block over to the right of the speaker. Also, the board says S1000-Power_V1.1 where all my other boards say A400_P Version:1.0

I'll try to see if I can get the numbers off the IC on the version 1.1 board. This isn't a worry until the code hits 1.0, but hopefully it is the same (or compatible) processor and I can trace the header pins out to see how the arduino needs to be connected.

2014-03-29 15.50.52.jpg

2014-03-29 15.50.12.jpg
 
I've been following this thread closely.

I ordered an Elitech from Amazon. It arrived today. Mine looks just like the one you show on the left. There is a huge IC on the vertical board.There is not a programming header on the horizontal board, but there is an empty 5 pin block near the microcontroller. Kinda bummed. :/ I guess I'll keep following this thread closely...
 
Adding another one to the mix. Although, this is not labeled as an STC-1000.

TempControllerBoard.jpg


I removed the capacitors here to get a clear picture of the microprocessor.
TempControllerChip.jpg
 
Found something interesting (not related to the ramp problem).

I cracked open a third STC-1000 to solder header pins and I found that it is different from the rest.

That is most interesting. And also a royal pain... So it appears Elitech has made a rev.1.1.
I have not seen this before. I can only hope that they have tried not to change things up to much.
It would be most interesting to know what IC that is. Unfortunately there are no guarantees that STC-1000+ will be reusable for this revision. And without the programming header, it will be more of a pain to tap the required lines.
 
I have a rev 1.1 power board unit like Disney7. I can't read the chip markings, however it does have 20 pins. Iscpdat and iscpclk appear to the 7 segment so look accessible. nMclk runs from 4 through a resistor, and then seems to go through the board to behind the display. It looks like it would be pretty tricky to solder to the side of the surface mount resistor.
 
I uploaded to a freetronics ether 10 board.

The detect seems to be sporadic, and it won't flash, I get the following

STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.
Enter low voltage programming mode
Erasing device
Programming hex data...
Programming program memory
Programming 8 words at address 0x0
Validation failed for address 0x1 wrote 0x318C but read back 0x0
Leaving programming mode

Any ideas?
If the wiring was wrong would it detect?

Can someone post a log of what a correct flash sequence looks like, or show the device ID?

I have an uno I can try tomorrow too.
 
I uploaded to a freetronics ether 10 board.

The detect seems to be sporadic, and it won't flash, I get the following

STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.

The source shows this ID
Code:
		Serial.print("Device ID is: 0x");
		Serial.println(deviceid, HEX);
	    if((deviceid & 0x3FE0) == 0x27C0){
	    	Serial.println("STC-1000 detected.");
 
Cool. Let me know and I'll flash it and start the test again.

I located the bug. It was due to a sloppy macro implementation on my part.
I have fixed it and pushed the changes to work. If you have the chance, please test it again. Thanks!

I have a rev 1.1 power board unit like Disney7. I can't read the chip markings, however it does have 20 pins. Iscpdat and iscpclk appear to the 7 segment so look accessible. nMclk runs from 4 through a resistor, and then seems to go through the board to behind the display. It looks like it would be pretty tricky to solder to the side of the surface mount resistor.

I don't have any rev 1.1 myself, so I'm afraid I can't help with this (at least for the moment). If you can't read the chip markings, how can you know where ICSPDAT ICSPCLK and nMCLR are located? Or even that it is a PIC controller?
If we're in luck it is at least a PIC16F, and it might be possible to trace the required pins to the easiest locations to tap into.
No matter what we're up against with this revision, there will be some work to support it and I will not be able to do much until I get my hands on one.

I uploaded to a freetronics ether 10 board.

The detect seems to be sporadic, and it won't flash, I get the following

STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x0
STC-1000 NOT detected. Check wiring.
Device ID is: 0x27C5
STC-1000 detected.
Enter low voltage programming mode
Erasing device
Programming hex data...
Programming program memory
Programming 8 words at address 0x0
Validation failed for address 0x1 wrote 0x318C but read back 0x0
Leaving programming mode

Any ideas?
If the wiring was wrong would it detect?

Can someone post a log of what a correct flash sequence looks like, or show the device ID?

I have an uno I can try tomorrow too.

That looks like an interesting board. I've played some with the ethernet shield, but I have not much use for it, since I don't have access to wired ethernet where I would need to use the Arduino.
Anyway, it says it is 100% Arduino compatible, so my first guess would be that USB won't be able to provide enough current. If you have the UNO, then do try that.

What power supplies are people using? Is 1amp enough to run the uno and the stc-1000?

Thanks

When I flash mine, I'm just using the USB power from the laptop.

Yup, me too.
 
Alpha, I flashed a new (third) STC last night and set it up with the following config for Pr0:

Code:
Ramp Test 1					
Setting	Temp	Setting	Hours		STEP
SP0	45	DH0	8		1
SP1	55	DH1	8		2
SP2	55	DH2	12		3
SP3	55	DH3	6		4
SP4	60	DH4	12		5
SP5	60	DH5	8		6
SP6	68	DH6	48		7
SP7	33	DH7	0		8
SP8	33	DH8	0		9
SP9	33				10
					
		Hours:	102

The only different between this and the config I had ramp trouble with is that I changed SP1 to 55 (instead of 45). I wanted to have a ramp in the first stage.

The first ramp looked fine each time I checked it:

Pr0,0,0: 45.0
Pr0,0,1: 46.3
Pr0,0,2: 47.5
Pr0,0,3: (I missed it)
Pr0,0,4: 50.0

Then I went to bed. This morning I saw:

Pr0,1,3: 34.7

It should be holding at 55, but is ramping down way under the set points for some reason.

I'll post more data as I have it.

Thanks
 
Disney, did yo see my reply above?
I managed to debug by running some test locally on my PC, and I found the bug was due to a macro that I was a bit careless in implementing.
This causes ramping to might work in the first step, but definately fail in second.
I have fixed it and pushed to work.
It would be awesome if you could re-run your test. Thanks for finding the bug and your assistance in testing!
 
Alpha, I missed that post of yours somehow.

I'll update and start the test again in a few hours.

Btw, once you're satisfied with the current code I can help figure out the 1.1 boards. I'll look later today and see what the IC is. My 1.1 board does have a header, it's just in a different place and is a 2x3 block. Hope the chip is compatible.
 
What power supplies are people using? Is 1amp enough to run the uno and the stc-1000?

Thanks

You're not actually powering the whole STC up when you flash it - just the processor chip through the ICSP header (VDD and GND). The Arduino uses very little power and the PIC chip even less power. The 500ma available on the USB port is very adequate (Unless you have a bunch of shields stacked on the Arduino).
 
Alpha - Sorry I've been a little absent. I replaced my computer Friday with a new one and have been a little busy. Is there anything I can test for you? I have a cider bubbling in the ferm chamber but I can move it.
 
Alpha, I missed that post of yours somehow.

I'll update and start the test again in a few hours.

Btw, once you're satisfied with the current code I can help figure out the 1.1 boards. I'll look later today and see what the IC is. My 1.1 board does have a header, it's just in a different place and is a 2x3 block. Hope the chip is compatible.

Cool!
It would be very interesting to know what IC that is. Looking at the pictures, I'm not so sure that that really is a programming header. Yeah, we can only hope...

Alpha - Sorry I've been a little absent. I replaced my computer Friday with a new one and have been a little busy. Is there anything I can test for you? I have a cider bubbling in the ferm chamber but I can move it.

Any testing is positive, be it running profiles and logging result or simply messing with with it and see if there is anything that could be improved or tweaked.
I certainly don't expect you to kick your cider out, you need to keep you priorities straight ;)
 
Back
Top