Go to advanced search

by onlinegill
Sun Dec 09, 2018 9:35 am
Forum: Python
Topic: turn on led for period of time with a button
Replies: 12
Views: 803

Re: turn on led for period of time with a button

i would use GPIOZERO

Code: Select all

from gpiozero import LED, Button
from time import sleep
from signal import pause
led = LED(17) # Led pin
button = Button(2)  # button pin

button.wait_for_press()
led.on()
sleep(3) # wait for 3 sec
led.off()
pause()
by onlinegill
Sun Dec 02, 2018 5:36 am
Forum: Other projects
Topic: Using PI for ship tracking via API
Replies: 3
Views: 2532

Re: Using PI for ship tracking via API

what about traccar ? its free and open source .
by onlinegill
Fri Nov 30, 2018 4:09 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

OK (thought that was probably the case, though IMHO editing a python script is just as easy as entering stuff on command line or into tk GUI) This is what you probably need to do. NB there should be an initialization where you read the values from the db to populate the tk Entry fields and also you...
by onlinegill
Fri Nov 30, 2018 1:23 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

table is like we created.
table name is measures
it has two fields : name and pulses
in name has 3 rows : small , medium , large
than pulses has like 100 , 200 and 300
i am trying to make this gui to update those 3 pulses filed so can calibrate or increase / decrease pour amount for each size
by onlinegill
Fri Nov 30, 2018 3:33 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Hi paddy, No rush i am trying make tkinter gui to update measures table value like small , medium and large to setup new pour size (pulses) but could not understand how to do it. # submit new pulse data to sqlite database. c.execute("update mesausers set pulses (small, medium, large) (?, ?, ?)") (sm...
by onlinegill
Wed Nov 28, 2018 5:46 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Paddy,
Its working i also added like following

Code: Select all

def pour_small():
    start_pour(MEASURES['small'])
Thank You
by onlinegill
Wed Nov 28, 2018 5:49 am
Forum: Python
Topic: Python getting input from the web or locally
Replies: 6
Views: 689

Re: Python getting input from the web or locally

i need help with arguments as well let me know if you can help me lol. i have hard time to understand sys.argv
by onlinegill
Wed Nov 28, 2018 5:44 am
Forum: Python
Topic: Stopping a python script from php
Replies: 6
Views: 791

Re: Stopping a python script from php

i am learning as well you can use sys.argv to pass arguments or look about WEBIOPI

i was googling found
https://groups.google.com/forum/m/#!top ... FkRhMsRTQ8
by onlinegill
Wed Nov 28, 2018 5:23 am
Forum: Python
Topic: 12V Simple Pulse detection and count on Pi3 help12
Replies: 13
Views: 1778

Re: 12V Simple Pulse detection and count on Pi3 help12

what about 5v or 12 dc relay ?
i am using following 5v relay to power up 24vdc solenoids along with npn transistor
https://rover.ebay.com/rover/0/0/0?mpre ... 1869298037
by onlinegill
Tue Nov 27, 2018 9:44 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Hi Paddy , If you get chance could you please let me know how can i get MEASURE_SMALL value from sqlite ? MESAURE_SMALL = ( get measure value information form sqlite db ) MESAURE_MEDIUM = ( get measure value information form sqlite db ) import sqlite3 conn = sqlite3.connect('wine.db') c = conn.curso...
by onlinegill
Tue Nov 27, 2018 4:56 am
Forum: Python
Topic: Python getting input from the web or locally
Replies: 6
Views: 689

Re: Python getting input from the web or locally

Do you need to pass arguments ? you can use sys.argv like python3 test.py on or test.py off
than you will be able to call it from web such as node red etc.
by onlinegill
Sun Nov 25, 2018 3:31 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Ok than next only would be importing measure amount from sqlite3
by onlinegill
Sun Nov 25, 2018 3:03 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

if i can figure out how to call these 3 buttons from external command like python3 test.py pour_small than iit would be easy to call it with anything and python will get measure data from sqlite
by onlinegill
Sun Nov 25, 2018 1:52 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Matt Richardson did a good Fask intro here http://mattrichardson.com/Raspberry-Pi-Flask/ and I've seen similar things with code red that you will be able to find with a bit of googling. I have to warn you that if you are new to programming then the asynchronous client/server concepts will be pretty...
by onlinegill
Sat Nov 24, 2018 8:08 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Got it thank you i will update test result monday. as i do not have relays at home. You are life saver Could you please let me know how can i call buttons like pour_small with command line or flask or node red ? would like to make web interface. i tried calling python3 test.py pour_small or python3 ...
by onlinegill
Sat Nov 24, 2018 7:47 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Ah yes, obviously.. you need to add 'cleaned' to the global lines in start_pour() and count_pulse(). Similarly you will need to add 'gas_kill_time' to the globals used in kill_loop() and count_pulse() Sorry about that. PS and also obviously, now you can see what was causing the error, the last thin...
by onlinegill
Sat Nov 24, 2018 7:34 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Update to my previous post i added cleaned = False inside def count_pulse(): and it clean start working but its fluctuating please let me know if i did right def count_pulse(): global count, count_cut_off count += 1 if count >= count_cut_off: solenoid.off() cleaned = False if not cleaned: clean.on()...
by onlinegill
Sat Nov 24, 2018 7:17 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Doh, my rookie error!! It should have obviously been if not cleaned: But it is good practice for you to debug that type of thing Paddy, I replaced as you suggest if count >= count_cut_off: solenoid.off() if not cleaned: but after flowmeter stop solenoid, clean does not turn on and i am getting foll...
by onlinegill
Sat Nov 24, 2018 4:25 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Hi, back now. Something like this.. (Not checked but you will be able to see the type of changes I made - very similar to the previous one) from gpiozero import Button, LED import threading import time pulse = Button(23) button_small = Button(18) # first button to pour small button_medium = Button(...
by onlinegill
Thu Nov 22, 2018 2:28 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

I've lost track of what your current code is and the full wiring diagram.(if I ever knew it) so it might be worth posting a refresher. I would suggest using a python Web server such as Flask rather than introducing another language such as php (especially as it's horrible) but a non trivial amount ...
by onlinegill
Wed Nov 21, 2018 6:02 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 8672

Re: stop solenoid valve with flow meter pulse

Update regarding clean mode relay or solenoid fluctuation. i removed gas line which is hooked before flow meter (clean ) and instead of clean solenoid i connected my wires to LED and my led stay solid and time is accurate that mean it turn off on time. now question is how can i stop flow meter sendi...
by onlinegill
Wed Nov 21, 2018 2:05 pm
Forum: Troubleshooting
Topic: relay or led - fluctuating
Replies: 7
Views: 1258

Re: relay or led - fluctuating

Does the flow meter stop spinning and sending pulses when the solenoid is turned off? I suspect that it may be that when the solenoid closes and the liquid is drained past the flow sensor, the sensor spins for a few more seconds, giving you more counts than you expect. you are right. i removed gas ...
by onlinegill
Tue Nov 20, 2018 8:13 pm
Forum: Troubleshooting
Topic: relay or led - fluctuating
Replies: 7
Views: 1258

Re: relay or led - fluctuating

i also tried to put flow meter, all solenoids relays on external 5v supply which mean i am not using power form raspberry pi at all i still get same issue on clean solenoid. looks like there something wrong in code. i asked another person he said following but still could not figure out what is wron...
by onlinegill
Tue Nov 20, 2018 3:04 pm
Forum: Troubleshooting
Topic: relay or led - fluctuating
Replies: 7
Views: 1258

Re: relay or led - fluctuating

My guess based on what I can see here is that there is not enough power for the cleaning solenoid to open properly. Does the program run correctly without the solenoid connected? No it does not, if i remove relays and put led”s on breadboard still clean led start flickering and not solid compare to...
by onlinegill
Tue Nov 20, 2018 3:01 am
Forum: Troubleshooting
Topic: relay or led - fluctuating
Replies: 7
Views: 1258

relay or led - fluctuating

Hi all, Our forum user Paddy helped me to make following codes but i have one problem when i press button liquor /wine start pouring and flowmeter start counting pulses than when it read desired pulse such as MEASURE_SMALL = 80 it send signal to first solenoid to stop pouring than there is 2nd solen...

Go to advanced search