Go to advanced search

by scotty101
Fri Apr 20, 2018 2:06 pm
Forum: Python
Topic: Pyw script using tkinter
Replies: 6
Views: 87

Re: Pyw script using tkinter

Perhaps you should share your code and what methods you've tried so we aren't guessing.
by scotty101
Fri Apr 20, 2018 11:57 am
Forum: Python
Topic: problems with received data python
Replies: 1
Views: 46

Re: problems with received data python

Odds are the code is raising an exception. Try wrapping the import with a try-except that will either display on screen or log to a file the exception. try: import ...... except Exception as e: print(e) or try: import ...... except Exception as e: with open('/home/pi/log.txt', 'w+') as log: log.writ...
by scotty101
Thu Apr 19, 2018 12:59 pm
Forum: Python
Topic: Have the date show April 19th instead of April 19
Replies: 5
Views: 100

Re: Have the date show April 19th instead of April 19

I seem to remember reading the documentation for a language and noticing that the data format function supported this but I can't remember what it was. Certainly wasn't python.
by scotty101
Thu Apr 19, 2018 12:41 pm
Forum: Python
Topic: Have the date show April 19th instead of April 19
Replies: 5
Views: 100

Re: Have the date show April 19th instead of April 19

The built in date time functions don't support this, you'd need to add some extra code like that show on this stackoverflow question

https://stackoverflow.com/questions/589 ... s-strftime
by scotty101
Thu Apr 19, 2018 11:25 am
Forum: Troubleshooting
Topic: Official Sense Hat - not fitting correctly!
Replies: 11
Views: 251

Re: Official Sense Hat - not fitting correctly!

I do have an official Raspberry Pi, and am just wondering why the 2 heatsinks were sent with it. Ask the company who you bought the Pi from. Generally they sell them as a way to bump up their profit margins over just selling a Pi by itself. IMO heatsinks aren't needed unless you are in a challengin...
by scotty101
Thu Apr 19, 2018 8:27 am
Forum: Automation, sensing and robotics
Topic: Finding a sensor to log shock travel on a vehicle
Replies: 5
Views: 177

Re: Finding a sensor to log shock travel on a vehicle

Can you explain what "a shock travel distance" is?
by scotty101
Wed Apr 18, 2018 9:43 pm
Forum: Troubleshooting
Topic: Official Sense Hat - not fitting correctly!
Replies: 11
Views: 251

Re: Official Sense Hat - not fitting correctly!

The sense hat fits perfectly. The problem is that you've fitted an unnecessary heatsink.
by scotty101
Wed Apr 18, 2018 8:38 am
Forum: Advanced users
Topic: Help building a greenhouse system
Replies: 6
Views: 155

Re: Help building a greenhouse system

This is achievable but you are trying to "eat an elephant in a single bite". If you haven't done anything like this before, the only way you will succeed is with small steps. Get one sensor type working and then move on to the next. Each part isn't complex but doing all of it together will require e...
by scotty101
Wed Apr 18, 2018 8:25 am
Forum: Raspbian
Topic: Is raspbian a bad choice for 24/7 iot?
Replies: 13
Views: 548

Re: Why is raspbian bad choice for 24/7 iot?

Kivy is a more modern GUI framework.
by scotty101
Tue Apr 17, 2018 9:26 am
Forum: Beginners
Topic: Servo hat interface
Replies: 8
Views: 202

Re: Servo hat interface

If you want a way to create a text based interface in python, I'd suggest the cmd module as a starting point. It will allow you to define a set of commands that you can type to set/get/control various things. You would combine this with a servo library to allow users to control the servos by typing ...
by scotty101
Mon Apr 16, 2018 12:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Simple circuit to read output from sensor with separate power supply not working
Replies: 2
Views: 93

Re: Simple circuit to read output from sensor with separate power supply not working

You need a ground connection between your sensor and the Pi.
Voltages are relative to a ground and if your two devices don't share a ground potential, you will likely get a false reading.
by scotty101
Mon Apr 16, 2018 12:49 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Simple Input on RS485
Replies: 2
Views: 117

Re: Simple Input on RS485

A small microcontroller (ATTiny, PIC etc) is likely to be the best solution here. Each will also require a RS485 converter to convert the signals output by the microprocessor to RS485 compatible signals. You could for ease of programming consider an Arduino compatible like an Arduino Mini. If you ar...
by scotty101
Mon Apr 16, 2018 12:43 pm
Forum: Beginners
Topic: Interfacing a Draw wire Sensor with Raspberry pi
Replies: 14
Views: 210

Re: Interfacing a Draw wire Sensor with Raspberry pi

Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C ADC can read. i know that voltage divider cirucit can be made easily by chossing correct resistors. But i would like to know is there any ready made chips to do this job so that it can be connected very easily with raspberry pi. ...
by scotty101
Mon Apr 16, 2018 12:03 pm
Forum: Beginners
Topic: Interfacing a Draw wire Sensor with Raspberry pi
Replies: 14
Views: 210

Re: Interfacing a Draw wire Sensor with Raspberry pi

Or if you use ADC supported by gpiozero, you can use its built in support for reading from ADCs
https://gpiozero.readthedocs.io/en/stab ... entiometer
by scotty101
Mon Apr 16, 2018 11:28 am
Forum: Beginners
Topic: Interfacing a Draw wire Sensor with Raspberry pi
Replies: 14
Views: 210

Re: Interfacing a Draw wire Sensor with Raspberry pi

The analog output of the sensor is from 0-10 V. Also, I have read that the raspberry pi can withstand only 3.3. volts , and it will blow the pi if the voltage exceeds. is it true? if true, is there any other way to connect it? Resistor voltage divider will get the 10V down to a voltage a 3V3 i2C AD...
by scotty101
Mon Apr 16, 2018 11:27 am
Forum: General discussion
Topic: 4-20mA output
Replies: 12
Views: 2486

Re: 4-20mA output

How many channel does this IC has?? Can we use more than two sensors at a time with AD5421 ? Is it follows the I2C baesd protocols or not ? Did you check the datasheet? http://www.analog.com/media/en/technical-documentation/data-sheets/AD5421.pdf 1 channel, uses SPI protocol (not I2C) so you could ...
by scotty101
Mon Apr 16, 2018 11:20 am
Forum: Beginners
Topic: Python 3 - How do I create an Average High Value
Replies: 4
Views: 186

Re: Python 3 - How do I create an Average High Value

Have you tried adding the items to a list an calculating the average. This is untested but may give you an idea. kwhrhighList = [] if float(kwhr) < 4: if float (kwhrlast) > float (kwhrhigh): #Add new high value to a list kwhrhighList.append(kwhrlast) #Calculate average of the list kwhrhigh = sum(kwh...
by scotty101
Fri Apr 13, 2018 11:27 am
Forum: Other projects
Topic: 3 pcs of Atmega328 connected to 1 raspberry pi 3
Replies: 3
Views: 124

Re: 3 pcs of Atmega328 connected to 1 raspberry pi 3

How about making the Arduino's I2C slaves each with a different address? The Pi can request the voltage and current readings from the arduinos and also command the other arduino with the relays attached to it. There is an example of configuring an Arduino as a slave here https://www.arduino.cc/en/Tu...
by scotty101
Fri Apr 13, 2018 11:09 am
Forum: General discussion
Topic: ISO GPIO pins 41-x expander
Replies: 7
Views: 261

Re: ISO GPIO pins 41-x expander

Is there an echo in here? :D
by scotty101
Fri Apr 13, 2018 8:52 am
Forum: General discussion
Topic: ISO GPIO pins 41-x expander
Replies: 7
Views: 261

Re: ISO GPIO pins 41-x expander

I have done some googling in an attempt to find a GPIO "expander", I am coming up with things like MCP230XX but that seems to be designed for the Pi 1. I am looking for an expander that will give me pins 41 and beyond(in total I need 65 unique [i.e. not a multiplexer] generic I/O pins) for the rasp...
by scotty101
Thu Apr 12, 2018 4:25 pm
Forum: General discussion
Topic: fish tank sensor
Replies: 2
Views: 113

Re: fish tank sensor

What part do you need help with?

Finding appropriate sensors to interface with the Pi?
or
Interfacing sensors that you already have with the Pi?
by scotty101
Thu Apr 12, 2018 3:11 pm
Forum: Python
Topic: IF/ELSE on GPIO pins
Replies: 11
Views: 233

Re: IF/ELSE on GPIO pins

Code: Select all

var1=GPIO.input(21)
if var1: ##This will happen if var1 == true
	GPIO.output(18,GPIO.HIGH)
else: ## This will happen if var1 is false
	GPIO.output(17,GPIO.HIGH)
As documented at https://sourceforge.net/p/raspberry-gpi ... ki/Inputs/
by scotty101
Wed Apr 11, 2018 1:51 pm
Forum: General discussion
Topic: Learning tool for a 6y old
Replies: 7
Views: 203

Re: Learning tool for a 6y old

Try looking at Scratch or Scratch Junior.

Perfect way to get in to some very basic programming. There are lots of resources out there for that age group.
by scotty101
Wed Apr 11, 2018 1:43 pm
Forum: Automation, sensing and robotics
Topic: how to control multiple valves with single GPIO pin?
Replies: 9
Views: 319

Re: how to control multiple valves with single GPIO pin?

Multiple DS2408 maybe? You might be better off reconsidering what your other GPIO pins are being used for and reassigning some of them. If you can free up the I2C or SPI bus pins, you will have many more options to expand the number of outputs you can control using port expanders. Another option is ...
by scotty101
Wed Apr 11, 2018 9:35 am
Forum: Automation, sensing and robotics
Topic: Reading encoder
Replies: 10
Views: 346

Re: Reading encoder

Does that code do anything? It doesn't seem to read the encoder. The code only reads from the encoder once, not throughout the while loop, see this section of code left_A = GPIO.input(enc_Al_pin) right_A = GPIO.input(enc_Ar_pin) left_B = GPIO.input(enc_Bl_pin) right_B = GPIO.input(enc_Br_pin) and t...

Go to advanced search