My Protoneer Setup

Please share your projects...
Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Sun Feb 18, 2018 3:09 pm

I have added a DHT11 temperature sensor and am using a 2N7000G to drive the fan using PWM.

I'm getting working temp readings and have full speed control over the fan, but my coding skills are not what they should be, so it will likely take me more time to get the Python (or maybe C if I keep having the problems I'm having) script uploaded once I get it working. Been trying to find some examples of PID-style temp control.

Image
Image

If anyone's interested in the schematic I can draw it up.

Bertus Kruger
Site Admin
Posts: 1291
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: My Protoneer Setup

Post by Bertus Kruger » Sun Feb 18, 2018 6:41 pm

Elbarfo wrote:
Sun Feb 18, 2018 3:09 pm
If anyone's interested in the schematic I can draw it up.
That would be nice please.

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Mon Feb 19, 2018 2:30 am

Pretty basic, but here it is:

Image

Once I have the program working correctly I'll post it too.

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Mon Feb 19, 2018 5:47 am

Well, it appears in my hamhandedness I have done something bad to the CNC board.

The Pi still powers up and the fan circuits still work, but now I get no power light on the CNC board. I have 5V on the 2 pins that should have it from the Pi, but measure 0V on the 5V testpad near the x driver. It's entirely possible I shorted out something while messing with this.

Is there a buffer or regulator for that 5V on the board?

Do the new boards have a different connector footprint?

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Wed Feb 21, 2018 1:09 am

As it turns out it wasn't so bad.

The solder joint on the 5V (pin1) had somehow separated from the trace. I had to scratch off some coating and reconnect it.

And this kids, is why you shouldn't solder on boards you care about. ;)

All is working now though.

Bertus Kruger
Site Admin
Posts: 1291
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: My Protoneer Setup

Post by Bertus Kruger » Mon Feb 26, 2018 6:20 pm

Elbarfo wrote:
Mon Feb 19, 2018 5:47 am
Is there a buffer or regulator for that 5V on the board?
Do the new boards have a different connector footprint?
The 5V is directly from the Raspberry Pi. So the Current output is around 1A but that includes the RPI's power needs aswell.

The new boards have a little bit larger Green connectors. 3.5mm -> 3.81mm.

I am not totally sure about the connector footprint. I made the board a bit longer at the front to be able to fit the long black connectors.
Pin out of the green connectors are definitely different.( :oops: I still need to update the Wiki when I get some time.)

Bertus Kruger
Site Admin
Posts: 1291
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: My Protoneer Setup

Post by Bertus Kruger » Mon Feb 26, 2018 6:21 pm

Elbarfo wrote:
Wed Feb 21, 2018 1:09 am
As it turns out it wasn't so bad.

The solder joint on the 5V (pin1) had somehow separated from the trace. I had to scratch off some coating and reconnect it.

And this kids, is why you shouldn't solder on boards you care about. ;)

All is working now though.
:D :D :D

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Tue Feb 27, 2018 12:31 am

Bertus Kruger wrote:
Mon Feb 26, 2018 6:20 pm
Elbarfo wrote:
Mon Feb 19, 2018 5:47 am
Is there a buffer or regulator for that 5V on the board?
Do the new boards have a different connector footprint?
The 5V is directly from the Raspberry Pi. So the Current output is around 1A but that includes the RPI's power needs aswell.

The new boards have a little bit larger Green connectors. 3.5mm -> 3.81mm.

I am not totally sure about the connector footprint. I made the board a bit longer at the front to be able to fit the long black connectors.
Pin out of the green connectors are definitely different.( :oops: I still need to update the Wiki when I get some time.)
I ended up tracing back all the 5V traces to figure out what had happened. Was a bit of a pain to get that to reconnect to the main 5V trace. Not expected considering it had been weeks since i soldered it, and it had been running fine for so long.

Looking at the new board I'd guess that I will have to change the case design slightly, but it could likely still be printed as is and trimmed with a knife to fit. The connectors are slightly wider. It's probably better they're bigger.

Ever seen these guys?
http://www.ti.com/lit/ds/symlink/tps54340.pdf
http://www.ti.com/lit/ds/symlink/lmz14203h.pdf

The 14203 is kinda neat as it doesn't require a coil, but it does only supply 3A. 3.5-4A might be a safer design. Something like that would make a great addition to the board. Looks like you have quite a bit of board space to work with.

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Tue Feb 27, 2018 12:59 am

BTW, this DHT 11 sensor sucks. I will eventually swap it out with something not so error prone. For now though, it runs well enough on this very rudimentary code:

Code: Select all


#!/usr/bin/python

import RPi.GPIO as GPIO
import time



def GetTemp():
        channel = 16
        data = []
        j = 0

        GPIO.setmode(GPIO.BCM)

        time.sleep(1)

        GPIO.setup(channel, GPIO.OUT)

        GPIO.output(channel, GPIO.LOW)
        time.sleep(0.02)
        GPIO.output(channel, GPIO.HIGH)

        GPIO.setup(channel, GPIO.IN)

        while GPIO.input(channel) == GPIO.LOW:
                continue

        while GPIO.input(channel) == GPIO.HIGH:
                continue

        while j < 40:
                k = 0
                while GPIO.input(channel) == GPIO.LOW:
                        continue

                while GPIO.input(channel) == GPIO.HIGH:
                        k += 1
                        if k > 100:
                                break

                if k < 8:
                        data.append(0)
                else:
                        data.append(1)

                j += 1

        print "sensor is working."
        #print data

        humidity_bit = data[0:8]
        humidity_point_bit = data[8:16]
        temperature_bit = data[16:24]
        temperature_point_bit = data[24:32]
        check_bit = data[32:40]

        humidity = 0
        humidity_point = 0
        temperature = 0
        temperature_point = 0
        check = 0

        for i in range(8):
                humidity += humidity_bit[i] * 2 ** (7 - i)
                humidity_point += humidity_point_bit[i] * 2 ** (7 - i)
                temperature += temperature_bit[i] * 2 ** (7 - i)
                temperature_point += temperature_point_bit[i] * 2 ** (7 - i)
                check += check_bit[i] * 2 ** (7 - i)

        tmp = humidity + humidity_point + temperature + temperature_point

        if check == tmp:
                print "temperature : ", temperature, ", humidity : " , humidity
        else:
                print "wrong"
                return -1
                #print "temperature : ", temperature, ", humidity : " , humidity, " check : ", check, " tmp : ", tmp

        #GPIO.cleanup()
        return temperature

    
PWMPin = 12
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)       # Numbers pins by GPIO #
GPIO.setup(PWMPin, GPIO.OUT)   # Set pin mode as output
GPIO.output(PWMPin, GPIO.LOW)  # Set pin to low(0V)

p = GPIO.PWM(PWMPin, 20)     # set Frequecy to 20 Hz (best noiseless operation of fan, believe it or not)
p.start(0)                   # Start PWM output, Duty Cycle = 0
      

while True:
        Temp = GetTemp()
        print Temp
        if Temp >= 20 and Temp < 25:
               p.ChangeDutyCycle(0)
               print "fan off"
        if Temp >= 25 and Temp < 30:
               p.ChangeDutyCycle(30)
               print "trigger 30"
        if Temp >= 30 and Temp < 35:
               p.ChangeDutyCycle(40)
               print "trigger 40"
        if Temp >= 35 and Temp < 45:
               p.ChangeDutyCycle(50)
               print "trigger 50"
        time.sleep(30)




In essence this checks the temperature every 30 seconds and sets the fan accordingly. At least every 3rd or 4th read the DHT11 errors. No logic for it so the fan stays at the last speed set until the next check.

I find I only need to run the fan at 50% to cool very effectively. Usually it's at 30% or off. It's very quiet now.

Elbarfo
Posts: 16
Joined: Sun Oct 08, 2017 11:01 pm

Re: My Protoneer Setup

Post by Elbarfo » Tue Feb 27, 2018 1:53 am

Looking at it closer, I'm probably wrong about the new board too. It does look quite a bit longer. Maybe 10-12mm?

Will likely need a full case redesign.

That's a bummer. :(

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest