#microcontrollers
1 messages ยท Page 8 of 1
oh nice good to know
is there a significant gap between them?
as someone who never touched, I see it as simply attaching wires and coding
there's more to it, which i have yet to know
i was going to choose adruino after light research, esp32 looks cheaper
i have to rethink
the ESP32 has lots more stuff like wifi , bluetooth , much faster processor and stuff
its a little bit unnecessarily complicated for a beginner
well it would depend where you are looking , here i can get an arduino UNO cheaper than an ESP32
dont try to buy the "original arduino board" , its VERY expensive because its geniune board ( like $25 )
because arduino is open source, chinese manufactureres have copied its schematic and made countless clone boards ,you can get these boards for a fraction of a price ( usually around the $3-4 mark )
you could ( and should ) get both boards imo
start with arduino UNO , get familiar with simpler stuff
then when you are ready to play with stuff like wifi and such , move on to esp32
Are the cheap clone boards (at least mostly) as good as the original? In the sense that it works ok, you can use the same Arduino IDE and the same code?
technically it's not that expensive
I'm in first year college and want to start being independent on money. With what i have i can buy only one of either boards, although i could easily get both of them if I ask dad
amazon shows adruino as $5 more expensive
yep , its the exact same working wise
the clones are cheaper because , firstly they are made in china , and secondly because they might not be using the highest quality components , so for long run the reliability will be different
but for all intents and purposes , the clones are just fine , i have only ever used clone boards except when they provided us the "genuine" boards in college
difference is mostly just in terms of PCB color difference, components looking a bit nicer and everything , functionality wise , they are pretty much identical
yes, you can use the same IDE , the exact same code on either and it wont make a difference
if you are curious about the difference between them , i think the arduino server has a thread or a post or smth about this topic
i cant even remember the last time i bought electronic components from amazon
amazon sellers price their stuff terribly , you should use a more electronic focused site
firstly take a look at your local electronic shop , see if you find it there , if not , check for local websites , if not then there are sites like mouser, digikey , adafruit , etc
and last but not least , there is always aliexpress
well you cant do much with just arduino UNO on its own
you will need other stuff like breadboards , wires , LEDs
Oh, thank you very much for this answer!
That's good to know ๐
if you are that tight on budget , then sure ig , buy an ESP32 , its not a bad option either , just not what i would recommend a beginner to go with
(you will need stuff like breadboard and wires either way btw )
i was looking at kits, microcontrollers itself aren't much
wait a minute
kit is what i would recommend too
yep
the electric components would work same way with both right?
yep
cool good to know
are electrics from amazon generally lower quality or anything? it's my first time hearing other sites you mentioned (not aliexpress), I'll take a look at them
I'm not aware of any shops nearby that provide microcontrollers, let alone the kits
the main reason i dont buy from amazon is because stuff is very overpriced
sellers just straight up double or triple the price of simple stuff
ex , a pi pico W would cost me around $6 on a dedicated site , but on amazon it could be upwards of $12-14
and sure , since everytime you buy components from amazon , you are probably buying from new sellers , so everytime there is qeustion of "is this seller good or not"
but with dedicated website , the seller is always the same , so after ordering once or twice , you know if a site is good or not
amazon stuff is not necessarily low quality , its just overpriced
a kit is just collection of different components , you could also just buy them seperately if you wanted
am i looking at the right thing?
it says "compatible with arduino" rather than arduino itself.
is it one of those clones u mentioned?
yep , looks like an arduino
compatible with arduino usually means clones yeah
uno 3
use the nano
i dont recommend nano , uno and nano are pretty much the same nano is just smaller in size
but UNO will be better since you are just learning , it supports the shields that you can buy which the nano wont

i already put up with learning easy ones while I usually start with most complicated
no thank you
Hey man
You there?
kinda , whatsup ?
Heyyyyyy
Can you come into dms bro?
i would prefer keeping it in the server ๐
Alr
more people , more chances of help , more eyes to fact check if i say something dumb
So i am planning to build smthg different this time lol(totally not an arcade controller)
So have you seen those tv backlights that sync with what happens on the screen?
i have heard of those yeah
Is that possible with an arduino or a raspberry module?
Like i have the rgb strip
Its just lying there so i thought i would build smthg with it haha
with a raspberry pi , yeah
not sure about arduino
tbh i am not sure how those things work , how they understand what color is on what part of screen and so on
ill have to check
its like 2AM and i am about to crash , remind me tomorrow, ill check
So basically i asked gpt. And it says it takes the input through hdmi, then it looks for the pixels at edges then it just picks up that and changes colors accordingly
Sure sure
I got into uni btw. Pursuing BCA ๐
nicee, good stuff ๐ฅ
Hell yeah man
not really ๐
from what i found , one DIY project makes use of a raspberry pi and USB webcam to check the colors on screen
but it seems a bit overkill to me
imo , an inline circuit that takes the HDMI from PC as input , extracts the color info from that and then outputs the HDMI signal as is
which sounds complicated to me , unless there exist some module for this on somewhere
on second thought , maybe you can incorporate something like HDMI splitter which will split the input coming from video source , then send one of that to TV as is
and send second of that to your raspberry pi using some sort of USB capture card or smth
TLDR , getting the raspberry pi to recognize the colors on the TV is the hard part , lighting up the LED strip accordingly is the easy part
I see
Thanks alot man
Thats a really crazy amount of intel
A question tho, which raspberry pi module do i need and how much will it cost?
i would like to think that a rpi zero 2 w can do the job , which would cost smth like 1500-1600 INR
but i am not 100% sure if the pi can handle all that stuff llike video capture and all, it can get pretty heavy depending on monitor resolution
so i would suggest something upwards of rpi 4 , 4 gig RAM which can cost around 5k INR
So i asked chat gpt abt the same
It recommended a raspberry pi zero 2 or 3 model B+
But it added a note that if i plan to use the cheaper zero 2 i must use a capture card along with it
To make it more efficient
It cant handle it lol
๐
honestly speaking , i dont give a crap what GPT says , it a toy AI at the end of the day
Real
Hope it doesnโt advance that much in next 5 years
๐ญ๐๐ป
you would need to capture the video stream with a powerful pi too like a capture card
I see
the HDMI port on rpi is for output , not input
Any raspberry pi alternatives which are cheaper ? You know me lol i am broke ๐๐ญ
Ohhh yeahhh
Right
You did mention that earlier
Mb
maybe orange pi ? i am not really sure
any cheap SBC that is powerful enough to handle the capture card should be fine
I see
probably not possible with current approach
i am sure you can buy direct products that will do this though for cheaper
Yeah
It costs like 4-5k to buy the same thing and like 15k for a really good one
I was like imma try to make it cheaper haha
But ig not everything can be made real haha
Imma still try it with raspberry pi zero 2W
if the rpi zero 2 w can handle the load, your plan would work
If it fails well i will just make other projects with it
And play with the board
Its a win win lol
๐
Any micro controller servers you are in? Like where i can review ppl abt it?
Or lemme check discord list lol
I think i can find one with appropriate tags
Ohh damn lol
Cant post here
Can you send in dms pls?
sure
Thanks man. You are G
( if any mod is reading this , maybe you can whitelist the links i sent here that were deleted ?? They are legit electronics communities . I would open a modmail to get them added, but my old one is not yet closed so i dont know what i am supposed to do there )
Hi, This is Sayed.
Im working on pymodbus simulator; i having some problem, Anyone can help me?
dont ask to ask
just ask your question directly
What's the issue?
@elfin sphinx are you familiar with ble coding and raspian?
not much really ๐
ok, What's your specialty focus with microcontrollers?
@elfin sphinx good morning
I spent all yesterday trying to write code with ai to get cool functions but only got a couple working but working good
not much of a speciality , i just learn whatever is required lol
if we talk about stuff i like , then its the embedded stuff , i dont like doing simulations , designing analog circuits and all
unless its for some project i want
Yeah I hear that, I'm more hands on then simulations but I do see there benefit. I've tried wow wiki and I like it
@elfin sphinx do u know much about services and triggering or starting a python .py file? I'm trying to start from bt but the services don't work in bt pairing on some libraries
Modmails get closed in a variety of ways, and multiple threads/topics in a single modmail are not an issue. It's a communication vector so don't worry about having multiple topics in a single thread unless we ask for managing things on our end. If those servers are servers you think are worth adding, go ahead and open a modmail with them, though we audit the server and sometimes conclude that for some reason or another it's not something we can whitelist
could you elaborate on what you're trying to do? Bluetooth in python is a difficult thing because the hardware stack is often weirdly supported. What is the python script you're trying, and what services aren't working (and which ones do so we can compare)
you mean you want to launch a python file on your PC from a device that is connected to your PC via BLE ??
okay ๐
Ok the cats out of the bag, I'm trying to program esp32 to a rotary encoder just to use the button on pin 21 to pair with with rpi4 raspian os. I've got it to pair with blekeyboard and blemouse but bleserial library it won't pair. Raspbian says no services can be used on this device with blueserial library. I have a bunch of scripts made to test with mixed results. Script to shutdown says awaiting connection but when I send for instance 000 I want the script to connect to turn off rasspbian os. If I run command in terminal it works to turn off pi. I was also able to make wheel of mouse work on pi with rotary but I thought it would be nice to have a bt wireless power button. Seems related to bleserial. I've used ble serial for other projects successfully but to some reason I get the services issues with that library
Could be pc or rpi4 or any os, I'm focused on rpi4 at the moment. I got close last night. Its just annoying to make the 4 clicks to power off pi when potentially I could use one button wirelessly to do that easier. I have serious neck back and arm pain so some days it would be nice to one click to turn off from across the room or something.
tbh i dont understand what you are trying to do
till now i havve understood that you have a rotary encoder connected to your ESP32 , and you wnat to connect your ESP32 via BLE to any generic computer
my question is , what do you want to do after the ESP has connected to the PC ??
Just a esp32 button to basically to turn off rpi4 after pairing. sending command to .py script from esp32 with a trigger to script that's listening to shut computer down. using the button on the rotary encoder for now as the button on pin 21. Have to run some of the things in vemu. Basically just shut computer down software wise with one click wirelessly
you can have your ESP32 be a BLE keyboard , and then when paired you can click the button and , it can send key strokes that will open a terminal and issue the shutdown command for your OS
That's a good aproach, ill try that. Genius, Thanks Saul
I'm using pymodbus simulator to generate modbus data from a csv file,
i have msp430 based microcontroller, which has been designed with rs485 modbus. From MSP430 micrcontroller it sends request "sending 58", pymodbus receive it and reply the value:
thats the thing.
Problem is : Pymodbus has "frame not ready" message and it cant send to Microcontroller.
Not pymodbus simulator sends it through rs485 modbus module, and micrcontrollers A+, B+ GND pin connected with that pymodbus rs485 module.
I never seen the project done wirelessly so I thought it would be a fun challenge
no worries
in ubuntu , you need to send ctrl + alt + T to open a terminal , just find the equivalent keystrokes for the same in raspbian OS
then once the terminal is open , you can send poweroff and then enter key
that should ๐ค shutdown the PC
Yeah ok, I should be a able to time the words with same button after opening the terminal to shut down I think, I think there's a good shot that will work. I was able to get 000 sent at once so multiple things from one button might be possible. Also if I can skip the python file that is less things to deal with
the button press is just a signal for the microcontroller to lets say execute a function
you can write whatever you want , however long prompts / commands you want in this function
Yes thanks for that clairification. I'm familiar but I do get confused, makes perfect sense
@elfin sphinx thanks man it worked flawless, I really appreciate the help. Now I'm wondering best safe way to power up rpi4 with with esp32 and relay but have a safety feature that makes it so Running os system can't be turned off while on without a system overdue for crashes or freezes if needed
well , you cant really use the RPI to turn itself on when its off , right ?? cause there would be no BLE connection
and i am not sure what you meant by the safety feature
Can if you had a dedicated esp that senses somehow if os is on. Could use esp now perhaps. Safety cause u don't want to abruptly turn off computer while os is running. Don't want to corrupt anything. It would be a smart sense that only powers off relay or what not when os is not running, so could have a over ride in software. Like a wireless esp screen to both ble on rpi and and WiFi on the other esp32 to receive comands
what ??
how would you turn on your rpi using ESP32 ?? the rpi is off , who will control the relay ??
unless you are talking about attaching another esp32 to the pi that will do the communication ??
( which sounds unnecessarily complex to me tbh )
if your pi is connected via LAN to your router , you could use the Wake On Lan protcol to issue a wake up command to your raspberry pi using any other device on the network
Yes another esp32.
so there wont be a BLE connection between the ESP remote in your hand and the raspberry pi itself like previous ??
That makes more sense bit can't completely power down
Yeah it would have the same ble but power on off from relay would be done from WiFi protocol to free up the ble for only powering off via software the same way
oh wait your right
its an ultra low power state , i am pretty sure the consumption during that state will be much much less than your ESP32's power consumption
ESP32 while communicating over wifi can take anywhere from 150 to even upto 250 mA
Hmm. Esp on lan could be ultra deep sleep perhaps
just brainstorming on feasiblity. Maybe someone could have real use cases for it. I don't know if ill make it but great to think things out, thank you
I think wireless might be more finicky for deep sleep esp wifi
not sure what you mean by this
i am confused
one time you are saying that you need the BLE to happen , now you say you want to free up BLE , which one is it ??
for the wake up feature , there doesnt need to be BLE connection between your ESP and rpi , only conditino is that RPI and ESP should be on the same wifi network
Deep sleep to put esp32 into low power mode to take up least amount of energy but still able to receive packets for turning on and doing things then getting tired and going back into a deep sleep
you cant put ESP in deep sleep and still receive wifi stuff
you need to put it in "modem sleep" or smth similar
the current consumption will reduce than usual , but its still there , maybe you could bring it to 100mA from 200mA , but it will still consume lot of current
(unless that mode is supported in light sleep too, in which case the current will be even lower , but i dont think light sleep supports that )
we usually dont pay much attention to it but ESP32 in normal operations is a VERY power hungry device
WiFi is more power hungry than lan I think. Ble for rpi4 direct software connection for turning off only, WiFi from one esp32 to the router that connects over to the lan of other esp32 that has relay for rpi for power rpi on or off
not to mention that power saving with ESP32 is a vast topic and is tricky to get right
if you wanted, you could use the wifi for turning off too , but it will be a bit more complicated , you will have tto setup a small webserver on rpi that will listen for some sort of communication , then once it receives the turn off signal , the backend code will issue the shutdown somehow
I'm going based off memory, my apologies. I don't have the sleep data In front of me. I haven't used any of the sleep features myself, just seen a bunch of vids on them
its complicated to make and hair pulling to debug if you want to save as much power as possible
So true
how would you know its soo true if you havent even tried it ๐
anyway , those are the options
the ESP32 + relay is possible too , just the sleep part is hard to get right
I'm visualizing lol
if you want to know about the " if the rpi is on or not before shutting down" , you could maybe read the status of the green LED that is on the board of the rpi
or maybe you could hook up some wire to some GPIO that spits out data when system is running or smth
I don't know if I'd trust my rpi to relay so would test on something else first
i am not sure about the exact details , but it should be totally possible to detect if the pi is on or not
sure , upto you
i would suggest you get a relay module btw , and avoid using a bare relay
Software I was thinking that only sends when os is running
not sure what you mean
" software i was thinking that only sends when os is running"
what software ? running where ? sends what ? through where ?
have the software blink a gpio port so esp32 could detect it? Some code or what not that auto runs when os is booting?
wait , why do you want to know if the OS is running or not before turning off ?
the way you turn the pi off is via BLE right ? so if there is a BLE connection , you would know that the os is running
or are you referring ot the future project that you are gonna make with the relay ?
so when pushing esp32 button on accident u don't shut off rpi without shutting down properly
how would you "shut down properly" using your esp32 ??
lets say , you want to shut your PC down , and it is currerntly on , what do you do and what do you want to happen ?
with the one click way I made earlier with your help
I made it to schedule for one min shutdown
so for that command to work , the pi has to be on , otherwise it wont work
so when you are issuing that command , you kind of know that the* pi is already on
Yeah but maybe there is another way
a better way
you are confusing me a lot
My apologies
maybe post your requirements , types of connections and every last detail about what you want to do ( write it considering that new person helping has 0 knowledge about what you are doing , so you should explain to them in as detail as possible , starting at the start )
someone will help you , or maybe ill take a look later
Thanks man, ill keep that in mind. Your more than welcome to do a write up on it if you find it worth while. When I get a esp32 with touch screen built in I think ill be able to do a lot more cool features like this integrated into touch screens
Wow, a microcontroller with a touchscreen sounds very cool, I'll need to look into that
Or just working with screens in general
They have come a long way in features, so many good videos on yt also look up cheap yellow display
Hello I use a raspberry pi Pico and I would like to code it using micro py but I wasn't able to find an optimal IDE, I would appreciate having some suggestions.
Thonny is a fantastic IDE
that is what i use personally for my micropython and circuitpython projects
Anyone here knows how to connect HTML to raspberry pi? I want to fetch data from the board and display on the frontend using HTML and then this shud be deployed on server running on raspberry pi. I'm using mqtt protocol
Im kinda lost
Which is the correct channel for Machine Learning stuff?
#data-science-and-ml this one
HTML is not something that you can "connect"
I want to fetch data from the board
what board ?
you can make a webserver using something like django or flask in python that can serve HTML files
but for live visualization , you might need some javascript as well
also , how "live" is the data ?
Let me explain the concept to you. I'm using a microcontroller, specifically the Wiznet W5500 EVB, which will send data to your website or HTTP server. This data will indicate whether the band and mat are connected or not. So, the website you're creating needs to function as a client for my device. I'll be sending information via the TCP/IP protocol, and you'll need to receive it as the client.
Additionally, we need to add a page for new devices where we'll input an IP and port. If the connection is successfully established using this IP and port, the status of that device should be displayed on our main page
Using the second method for message transfer via MQTT, we need to create a webpage on our Wiznet W5500 EVB. This means that when you enter the device's IP and port into a web browser, a page will open. On this page, there should be two boxes labeled "MQTT ID" and "Port Name." When I enter the correct MQTT ID and port, the connection with my MQTT server will be established.
But where the MQTT ID and port we provide on this page will go needs to be defined in the device, meaning in the MicroPython code.
this method we use for configuration of our device
Actually we are using wiznet w5500 evb module, Yess it has inbuilt ethernet module , actually it is based on rp2040
We can say it is a combination of ethernet w5500 and rasberry pico
rasberry pi we use here only for data collection fromย ESDย ย Device
import network
import machine
import time
from umqtt.simple import MQTTClient
def w5500_init():
nic = network.WIZNET5K()
nic.active(True)
nic.ifconfig('dhcp')
while not nic.isconnected():
time.sleep(1)
def connect_mqtt(server, port, client_id):
client = MQTTClient(client_id, server, port)
client.connect()
return client
def is_band_connected():
band_status = machine.Pin(11, machine.Pin.IN).value()
return band_status
def is_mat_connected():
mat_status = machine.Pin(10, machine.Pin.IN).value()
return mat_status
def main():
# Initialize W5500 module
w5500_init()
# MQTT Broker details
mqtt_server = '192.168.1.14'
mqtt_port = 1883
mqtt_client_id = 'YOUR_MQTT_CLIENT_ID'
# Connect to MQTT broker
mqtt_client = connect_mqtt(mqtt_server, mqtt_port, mqtt_client_id)
try:
while True:
# Check Band status
if is_band_connected():
print('Band connected')
else:
print('Band disconnected')
# Check Mat status
if is_mat_connected():
print('Mat disconnected')
else:
print('Mat connected')
# Publish Band status to MQTT
topic_band = 'topic/Band_Status'
message_band = 'Band connected' if is_band_connected() else 'Band disconnected'
mqtt_client.publish(topic_band, message_band)
# Publish Mat status to MQTT
topic_mat = 'topic/Mat_Status'
message_mat = 'Mat disconnected' if is_mat_connected() else 'Mat connected'
mqtt_client.publish(topic_mat, message_mat)
# Delay for 1 second
time.sleep(0.1)
finally:
# Disconnect from MQTT broker
mqtt_client.disconnect()
if _name_ == "_main_":
main()
this is the micropython code which I already used in our device which use mqtt protocol for communication
I don't know if this is the best server to ask this, I have a raspberry pico and I'm trying to use a HMC5883L but I can't read the i2c.
there exists a fairly active raspberry pi server
i am still kind of confused tbh
i am not sure what you meant when you said
This data will indicate whether the band and mat are connected or not. So, the website you're creating needs to function as a client for my device
"as a client for my device" , what device ? what do you mean by client ? in a server client architecture , server is the one sending http to the client , and client is the one requesting the http , not sure what you meant by that . also what is a "band" and a "mat"
also "second method for message transfer via MQTT" , i am not sure who is communicating with who , i am not sure what all devices are present in your network , i am not sure who wants to talk to who
can you maybe explain your project and then we get an idea of what you are trying to do ?
cool
do you need help with that , or you just wanted to let us know that you cant get it to work ??
if you need help , you are gonna need to send lots of information like , your code , your error(if any) , your circuit diagram , a photo of your actual setup
yup, I used flask
By live, I meant the statuses should be updated in real time
this table should get filled up dynamically
i still have no idea how this table should g et filled up , where the data is coming from , what all devices youy have in your netowrk
i assume the connection protocol between your node devices is mqtt , then who is the mqtt broker
also i am not sure what is all the ip addresses and ports in here
please clarify the stuff asked here so we better understand what is going on here
yup will do ๐
@elfin sphinx thanks for the reply. yes, I do need help. I just wanted to make sure this was the correct place before spamming code and photos.
this is the code i use to scan for i2c devices
`import machine
sda=machine.Pin(16)
scl=machine.Pin(17)
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
print('Scan i2c bus...')
devices = i2c.scan()
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hexa address: ",hex(device))`
the output was.
Scan i2c bus... i2c devices found: 1 Decimal address: 13 | Hexa address: 0xd
I then followed this guide https://how2electronics.com/interfacing-hmc5883l-magnetometer-with-raspberry-pi-pico/
cool , so what did you need help with here ?
it looks like the code is detecting your magnetometer on I2C bus just fine
@elfin sphinx When I try to read I only get 0,0,0
this is one of the codes i tried to use
`from machine import Pin, SoftI2C
import math
import time
import struct
i2c = SoftI2C(scl=Pin(17), sda=Pin(16), freq=100000)
declination=(0, 0)
i2c.writeto_mem(0xd, 0x00, struct.pack('B', 0b111000))
i2c.writeto_mem(0xd, 0x01, struct.pack('B', 1))
i2c.writeto_mem(0xd, 0x02, struct.pack('B', 0x00))
declination = (declination[0] + declination[1] / 60) * math.pi / 180
data = bytearray(6)
xs=1
ys=1
xb=0
yb=0
while True:
i2c.readfrom_mem_into(0xd, 0x03, data)
x = (data[0] << 8) | data[1]
y = (data[4] << 8) | data[5]
z = (data[2] << 8) | data[3]
x = x - (1 << 16) if x & (1 << 15) else x
y = y - (1 << 16) if y & (1 << 15) else y
z = z - (1 << 16) if z & (1 << 15) else z
gain = 1
x = x * gain
y = y * gain
z = z * gain
x = x * xs + xb
y = y * ys + yb
print(x,y,z)
time.sleep(1)`
hello everyone , i need help guys who have a public http serveur and can host in the this serveur a bin file
i work in OTA update using gprs, the sim800L module dosen't support https protocole
you should find what you need on http://sdf.org/ or pythonanywhere.com
If you want to show historical data, then you must store the data in a database. Device -> MQTT -> (broker) -> data receiver -> database
Then from the browser. HTTP request -> flask web server -> database -> HTTP response
If you do not need historical data, then you can enable MQTT over WebSockets in your MQTT broker - and let the browser JavaScript listen directly for messages using WebSockets
Thanks
the pinned post has links to some information regarding that, but loosely it's mostly just arduino c/c++
thanks for the info!
I think it depends on your Arduino. Mine supports micropython so I can code with python, but I'm not sure if all do.
does it depend on the model or other properties? I have the uno r3
I believe it's the model. It should say online somewhere if it's compatible. I have the nano rp2040 connect
Arduino is a bigg company
they make A LOT of development boards , some of them are powerful enough to run micropython , a lot arent
so whenver you say stuff like this , its important to include what model you have , instead of saying just arduino as it can confuse a lot of other people too
the UNO R3 cannot run micropython or circuitpython
you are stuck with C/C++
is there not a library / driver for this module ? i am not sure why you arent using that
@elfin sphinx thanks for the help I will be trying to solve this on my own ๐
I'm not disappointed or anything, it would simply be easier with python I presume.
How about esp32?
well , you can "control" your a rduino with python using something like pyfirmata
but you cant write code on arduino using python or any derivatives like micro/circuit
ESP32 can run micropython and circuitpython , yes
but the methods to set the board up might vary slightly depending your exact ESP32 model
Hello y'all, i don't know if this is the best server to ask this question. I'm new to programming with python(about 2 months), i have a dream project i will love to build which is a smart farm. This smart farm will have features like automatic feeding, watering and individualized animal tracking for optimial care-giving, i have no experience in technology before now (coming from medical background). what technology should i be looking to learn and what is the path of study for a project like this?
Do you currently own a farm and have livestock, or is this a project idea you have?
If you own a farm I'm going to suggest you go with a professional product.
If it's just a goal you want to work towards, automated plant watering is a good place to start: it involves a lot of the same concepts as building blocks, gives you some experience with automation, tracking, hardware, electronics, etc, and 'failure' is a dead plant, not an animal so you can also learn about reporting/warnings in a 'safer' way
Thank you for your reply. No i don't own a farm, i'm curious about the technologies and i belive a project like that is a good way to learn it. What is the roadmap you will recommended for a project like this?
Did anyone here ever run some kind of user inteface using kivy on raspberry pi?
Is it possible to run It in docker and do I Need desktop version for that?
technically you dont have to have the desktop OS , you can manually install the X server and configure it , but imo its a bit tidious
if you have a powerful pi ( pi 4 or 5 with 2 gig or above RAM) , you can run the full desktop and a GUI app on top of it imo
if resources are important , then you could set up the X server only and go from there
every individual thing you mentioned is a "thing" on its own
there is not really a fixed "roadmap" for these kind of things
just plan out main stuff you want to do , and then work on those individual things, ex lets say you want to set up a smart farm that 1) feeds and waters the animals periodically 2) does Individualized animal tracking
also i am not really sure how you would "feed" the animals ??
lets say you have a machine that feeds the animals on command
now depending on how "smart" you want this to be , the technology used will be different.
ex . it can be as simple as programming it to feed and water animals at fixed time of the day
now to enhance this , you could add a weight sensor to the spot where you will drop its food , this will measure the weight of food and you can estimate if the animal is eating the food or not
this could be fooled if some other stuff falls ont hat spot and adds weight on the weight sensor ( so the food will be finished but the sensor will show that the food is still thre)
to overcome this ,you might use something like computer vision or something similar
so you see , the complexity goes on increasing the more you want to enhance it.
also "automate the farm" is a bit of vague subject and i am not really sure what part you want to implement yourself vs what part you want to just buy ready to go
ex - lets talk about monitoring the cattle.
there are number of ways you could go about it with their pros and cons
such as geofencing the cows using a GPS tracker or smth similar
now i am not sure if you are interested in building this GPS monitor yourself or you want to just buy one that is ready to go and then use these hardware components and write software for them
if you are really not sure what you want , but want to get into all this "electronics stuff"
my advice is , just buy an arduino kit and start doing projects that you see online that interest you
(ex - a good beginner project for you might be arduino based automatic plant watering system )
and try to learn new things, thats pretty much all i can say to you
there is not really a fixed roadmap for this kind of stuff like there is for say learning a programming language
the only "roadmap" i know of is doing engineering in electronics or similar branch
Thak you Saul Goodman for that out time from your precious day to send me this reply, as you advised i'll start by drafting what exactly i want in this smart farm and begin with arduino.
๐ having a fixed set of features you want and requirements will really allow you to make quick hardware choice
also i think the farm should be the big goal you walk towards
but you should start with simple stuff in the beginning
otherwise you might just get overwhelmed
I have a question not related to python but how do you secure your code from being stolen?
you open source it, put a permissive license on it and then it cannot be stolen, and probably will live way longer
a part from that there are a number of SOC which allow for burning some fuse and set crypto/tpm at a very low level
And what about welding parts? Like emmc into controllers
Also what about storing some kind of device ids/API tokens
I want to primarly make them secure
you want SBROM and encryped storage ( nand/emmc can be dumped easy )
you can experiment for cheap with allwinner socs you can burn fuse from usb/fel mode you will find docs on https://linux-sunxi.org and armbian forums
What do you mean by "you can burn fuse from usb/fel mode"?
i'm not advertising, but all allwinner socs can boot via USB and you can have uboot interacting with very low level functions https://linux-sunxi.org/FEL/USBBoot . That made those socs unbrickable and so very good for beginners , though messing with e-fuse and crypto you could probably lock you away if you lose the key
I Kindly dont understand what are all allwinner socs and what exactly are they?
system on chips you can find on dev boards like "orange pi" , "Libre Computer" "lichee pi" etc ...
Okay now im reading more about It, but will this make it safe from being accessed by other peoples ( even if the device has been stolen )?
from most people yes
Okay, im reading more and more about it and it starts making sens but i still dont understand than
where the encryption keys will be hidden to make it safe?
inside the cpu there are a bank of fuse you can shortcut and burn to make a bitstring that is hardwired forever and make the chip unique
and this is not readable outside internal boot process https://www.linaro.org/blog/uefi-secureboot-in-u-boot/
UEFI SecureBoot is a verification mechanism ensuring that code launched by a computer's firmware is cryptographically verified. It is designed to protect a system against malicious code being load...
only write once
Okay, so even if someone would try to access this "key" stored in cpu by using other micor sd he wont get access to it?
indeed they cannot, so don't loose the key yourself
Okay, but for what should i remember tha key myself? Do i need to input it each time the device is booted
?
you need the key to make a trusted encrypted FS image or the cpu won't boot anymore
it will only allow stuff signed for it
Okay, thx for your help im going to start reading about it
yeah, I did the websockets one and it worked, thanks
How tf do I understand coding for microcontrollers๐ญ
I have this uni project due for traffic control and pedestrian crossing and itโs eating me already
wats ur issue?
I want to start by building my basic fundamental knowledge on these things. Where should I even start?
what are you studying in UNI ?? CS ? electronics ? like which field ?
Itโs a first year general engineering course. One of them is an electrical engineering unit
Called smart systems
Coding an arduino is going to be the end of me
start by arduino led blinking ( and for handeld games start with pong ๐ )
Whoaaaa Iโll check those out
when you are done with both, learn async and blink the led while playing pong ๐
What should I be doing or watching thatโll make me significantly better at circuitry stuff
Cause my projects due in like a week and I donโt know anything it feels like
i guess stay with some arduino blinking led tutorials on YT
Wait you can make pong with an Arduino? That sounds cool, what kind of additional hardware one would need for that?
I assume a screen + joysticks, is there anything else pong (or other simple games like pong) would need?
no really joystick, only potentiometers on analog inputs
Oooh that makes sense
for screen ssd 1306 should be enough, i2c ones may be slow did not test
Thank you 
or buttons https://www.youtube.com/watch?v=YbztpjIDKHE but that would not be original game
did they not teach you about it ??
but yeah , if you want to start out , get your hands on a basic arduino UNO kit , and just start doing stuff
you will find loads of youtube tutorials , blogs , articles about it
it just felt like cognitive overload to me, they showed us an arduino for the first time and then baam now we gotta make a whole smart system after 2 weeks and figure out all the hardware and software for it.
and then we're required to have so many features, to get enough marks
what is the project ?? and what features are required ??
this is the main project
is this supposed to be easy or medium difficulty or smth ?
i still dont know what the required behaviour is , you just posted the overview
but from what i see , i would say this is beginner to a bit above beginner level
from what i can seee , its just few LEDs , few buttons , and an ultrasonic sensor
i am not sure what those 7 segment displays and LDR / Thermistor are doing there
Hi im having a problem with runing kivi with good graphics on my raspberry pi 4b, so i connected my raspberry pi to my Acer screen with micro hdmi -> hdmi cabel and when running simple app im getting realy bad graphics on the screen
Also Im runing server version ( meaning no desktop only cmd )
While when running same code on my PC with linux graphic is 10x better
import kivy
kivy.require('2.3.0') # replace with your current kivy version !
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
from kivy.graphics import Color, Rectangle
from kivy.core.window import Window
class Main(App):
def build(self):
window = GridLayout(cols=1)
# with window.canvas.before:
# Color(.2,.2,.2,1)
# self.rect = Rectangle(size=(1200,600), pos=window.pos)
label = Label(text='Hello World')
window.add_widget(label)
return window
if __name__ == "__main__":
# Window.maximize()
# Window.fullscreen = True # Making it go to F11 mode
Main().run()
can you show some video of what you mean by bad graphics ??
it's hard to record it from phone
It Looks like resolutions would be different
Like the text gets much bigger than it should ( the cursor as well )
then yes , firstly set the correct resolution for your display
That looks like "blured"
and what does it look like when its "good" ??
OH okay
Im stupid
Works fine now
๐
Thats why i told you it's hard to make it look good from photo
if the good image is from your laptop , you can just screenshot it right ?
no need to use phone to capture the photo
also you could have just said that "text looks wayy bigger than its supposed to be and blurry "
when you said "graphics" i thought something like , video or pictures or smth
Now its not from My laptop
It's on the screen of my Monitor which is connected by hdmi to raspberry pi
directly
And the system doesnt no have desktop support
yep , the bad image is being displayed from the raspberry pi so you have to take photo with phone
but you said if you run the same code using your laptop , the graphics are much better , can you not screenshot those ??
Oh sorry i can
Okay so the problem was that raspberry was trying to fit On full screen window size of lower size
i mean if the problem has been solved , its all good , you dont need to send anything
I just need to make window bigger
yep , resolutions man , they suck when setting up
Thats true, but i will be probably working with screens of one resolution so if think i can use static sizes for that
Do you guys know some GUI frameworks which support packaging for linux? Im planing to create some Kind of self-service checkout and working with docker would be hard also using linux packages may make it easier and more reliable?
Are there rules against mixing others c plus plus code and sharing online?
what do you exactly mean with "mixing"?
If you mean modifying and sharing the code, you will have to look at the license. Some licenses require the original author be mentioned, others require you to reuse the license for your new version, etc.
If you want to be sure, just read the "LICENSE" or "LICENSE.md" file in the project root
If the project doesn't have a license you will have to contact the original author and ask for permission.
this site might help: https://choosealicense.com/licenses/
Non-judgmental guidance on choosing a license for your open source project
Thank you for the detailed answer. 
My peepos
Hola
I require assistance with calibrating a light sensor
Please respond
I am dying ๐ข
What sensor do you have?
Any drone guys in here? Iโm programming an autonomous boat using adupilot and mavlink. Iโm looking for a flight controller that dependable but not overkill for something like a boat that doesnโt experience the kind of stress a air platform would
there are practically infinite ideas , you can find them by googling
some are - weather station , ble remote , ble keyboard , small webserver
Weather stations/air quality stations are a particular favorite project of mine
Sky is the limit, there are a ton of code examples online and in arduino ide . I hope to make a web radio soon. Go on YouTube and search esp32 then refine the results to day, hour, month and year to see what's going on in the world of esp32. Can make watering systems for plants, the sky is the limit of your imagination with reference and skillz. If you have any more questions let me know and ill try point you in the right direction. The l298n is a great motor controller for using pwm to change speed of motor, forward, reverse and stop for two motors individually and its very inexpensive, can use with small motors up to 25w max.
i particulary like hackaday.io and instructables.com for very innovative project ideas, you can search for esp32 projects on there too
anyone able to help i want to setup my raspberry pi 4 with a custom data set on yolov5 and a pico micro controller
Is anyone familiar with headless pico running, I have a code that works flawlessly when run through thonny but breaks when run headless and I have spent hours trying to figure out how to fix it and I can not do it whatever I try
have you saved the code actually on the pico itself ??
if yes , what is the name of the file you have saved it in ??
in what way does it break?
Thank you both for the replies, the file is saved under the name main.py which does run when powered but unfortunately the code doesnโt work as when launched from the computer. The issue was that when running headless there is no console for the error message to print into. But in redirecting the error message to my LCD screen I get the message โcouldnโt determine sd card versionโ
Which is very strange because it works fine when run via the laptop and I am connecting it to the same power so I am not sure what could be causing the difference
Any help would be greatly appreciated!
can you show your full code and circuit diagram and photo of your setup ?
Good evening lads, is there anyone of you who could guide me on robot and sensors training ? I have a college project that requires training a robotic arm to detect and segregate garbage. require some helpful insights on what approach to take !
Such an error could be timing related. Or that you had dirty state in the microcontroller peripherals left over from a previous run. Before transferring to flash, I would always recommend doing a couple of test cycles where you reset/unplug the USB, then run the code, to check that it works from fresh start
Also, it could be power-related. When plugged in via USB, that is a power source. If you do not have USB anymore, perhaps something is no longer powered, or is powered in a different way
Good evening, I am just getting started with python and microcontrollers. Any suggestions on where I should begin? I purchased microcontrollers from adafruit and looking like I can work with micropython or circuitpython. I have Sublime Text or vscode. Seem to like sublime text more.
When I have a question I go to the internet and that turns into a rabbit hole that has no end
you could and should follow the official getting started guide from adafruit for your board
@iron umbra You can ask here
amount of people willing to help over VC is thin compared to people willing to help over text
if you describe what you need, people can help in here
I was soldering and this was making a lot of smoke, my dad said I should have a fan but I forgot, I was blowing it away from me, is this bad?
not just a fan but a smoke extractor so toxic fumes go outside or at least work under opened window , avoid repeated exposure because yes this is bad.
^what pmp-p said, also remember to wash your hands after using it.
for a makeshift solution , buy charcole sheet , attach it to the back of a 12v PC fan , and then use that to suck those fumes in and keep it near your window , so it sucks the fumes in and then throws out the back out of the window
when lead is melted in open environment does it becomes PBO2
does it try to choke as regular CO2
Anyone here who has used this board?
https://www.ti.com/tool/SK-AM62A-LP#description
what sensors can be used on this board?
View the TI SK-AM62A-LP Evaluation board description, features, development resources and supporting documentation and start designing.
Good ventilation out the window is a must. Also a good mask helps. A hood with proper exit vent is ideal. The smoke has made my taste buds seem different in the past, either way I'm sure its not good for you, possibly cancerous or lead fumes. Best to stay safe, who know what issues chemicals can cause down the line when it comes to health
how do I make input() run in asyncio?
Yo does anyone know where i can find some useful info on autonimous programming using python for something like a rover using a raspberry pi???
!rules 10
https://docs.micropython.org/en/latest/library/asyncio.html here are the asyncio docs for micropython
@elfin sphinx if i use fabgl code and someone elses code and put them together can i share them on github? i made something really cool i would like to share but im not sure on the licencing. i also used chat gpt to make it
not sure what fabgl code means
and for someone else's code , check that code's licence and follow it
if they dont have one , shoot them mail or smth
actually i think you should share code, since fabgl is GPL https://github.com/fdivitto/fabgl?tab=License-1-ov-file#readme
i dont see a license on the other persons code in git, does that meen its ok to do whatever?
if it was the link you removed there's an open issue about licensing
yeah, so i cant use it?
you probably can as long as everything derived from that work is labeled GPL v3 too
i would not have a clue...
ask a lawyer then
is there a way to find out besides git?
im too poor for all that and not trying to profit just wanted to share if its ok. if not i guess it stays in a lock box lol
open an issue on github asking kindly for permission and what you want to do with it and keep track of the answer
open an issue on github asking kindly for permission and what you want to do
with it and keep track of the answer
awesome guys, ill look into that, thank you
i think it might be beneficial for some in the community hopefully
look in asyncio console code
if on posix then put stdin in non blocking mode and use select() on it
its this code thats giving me problems:
await asyncio.to_thread(input, prompt)
it gives me this error:
AttributeError: to_thread
on CircuitPython
CircuitPython doesn't have threads
What are you actually trying to achieve as with CircuitPython there's not usually a shell to read input from
ok
what is the difrence between micropython and circuitpython?
Hi all. I have a switch box, running on arduino. Everytime i turn one of the switchs for example , it prints "strobe.switch.on" on the serial monitor. I would like to write something in python that gets that printed value and transform everytime it prints something like that, to press the "s" keystroke for example.
So something like
Pyinput
Input keyboard
For "Big Enough" chips, MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. CircuitPython is a fork from MicroPython which has some minor changes to MicroPython in an effort to simplify experimenting and learning to code on low-cost microcontroller boards.
The boards they support can be found here:
https://micropython.org/download/
https://circuitpython.org/downloads
Micropython tends to make use of as much as it can on each chip it's on, and that means the api from one chipset to another might have a fairly large difference. Circuitpython in contrast attempts to maintain the experience from one chip to another so it's more familiar, but that comes at the cost of some features not being as optimized as in Micropython
so if i understand this correctly, you have an arduino , that says some stuff using Serial.print() , and you somehow want the python program to read that and do some actions , correct ?
As much as i respect peoples license to code it looks like it could be holding back major innovation if everyone who wants to post new code based on old code has legal roadblocks. I see both sides but its interesting. Like what if you want to ask permission to use someone's code and it takes years for them to get back? Society keeps moving along but the codes that have been created might never be released. Am I correct in this assumption?
i would just post the code and in the readme say that - this XYZ part of this system uses code of ABC person's project over at <insert their link>
it might violate the licence, not really sure , but yea , i would just do it
Would that protect me legally? I can't afford and financial issues in the future
Thank you for the insight
i texted the authors with the github issues feature on github but it looks like the project hasnt been worked on since 2022
It wouldn't protect you legally, and if this is something serious, you should consult a lawyer
not really sure , it might not
but i like to live life on the edge
if their code is open source and they dont care to put a licence on it neither do they reply to messages , i doubt they care to take stuff to legal action
@willow star thank you, makes sense
ok, il do my due diligents first and then think about that, i doubt it either, i think i seen something mention about someone elses license so maybe they were using others license to begin with lol.
Is vdhl part of micro rollers and is it hard to program the corrections functions to micro trollers with vhdl
Do you mean VHDL?
If so, VHDL is a hardware description language for things like FPGAs, which are chips that let you actually change how the chip works on the inside. A micro controller is much more set in stone as to what it can do.
VHDL is.. not terrible? But I didn't have fun learning it and didn't retain any of it. It's really powerful if that's the level of programming you need, but it also consumes a ton of power and for a lot of things you don't need it.
almost all of my personal needs for microcontrollers are hobby projects like weather stations and smart home controllers.
FPGAs are great for really high speed processing, but for a lot of things I need there's something cheaper and simpler. And since it's a hobby project, simple is nice
No worries, I assumed that's what it was after I couldn't find anything related to vdhl
but yeah, you can do a lot with an fpga and VHDL, that said it can be overwhelming very quickly
How is that so?
I am looking at doing a capstone and am thinking of doing a flashing light microcontroller.
The way you write vhdl is to describe the circuit itself, rather than just the code like you would with a python program. With that comes the fact that the circuit does a lot of things at once, so where lots of python code is single threaded, hardware does a ton of things at the same time. So the way a program works on an fpga is different, and that can be a difficult thing to mentally understand.
Also the language itself is rigid and feels different than python. (But like in the 'fortran feels rigid and can do a lot of amazing things' kind of way)
If you're thinking of that for the capstone, I'd encourage you go for a micro controller before you do anything with vhdl
I am thinking of implementing VHDL with using a microntorller
I don't know if that's possible, could you describe it in more detail?
Never mind as it does look like to be uisng C++ for that reason
ah, ok so you want to write vhdl to blink an led, not put the vhdl on a micro controller. I think I follow that a lot more now
Yes as that is correct.
I see that VHDL is mostly used for hardware testing but are there like components that can be associated to vhdl
Why are you interested in VHDL vs something else?
I need to learn it for embedded system course and so I am interested in using microcontrollers as that is part of the course
The book for the class ask to learn VHDL
College course as am going for CS
Ok. I think that makes sense.
Really quickly, VHDL code is usually deployed to an FPGA, but you can simulate the circuit on the computer. So you can write VHDL to blink an LED, but to put it on something else you'll need an fpga.
FPGA's are different than micro controllers. They are confusingly similar, but they are different.
https://www.reddit.com/r/ElectricalEngineering/comments/120pgl8/what_is_the_practical_difference_between/
https://rushpcb.com/fpga-vs-microcontroller-understanding-the-key-differences/
These two links help describe their similarities and differences
Thank you for that
(Fixed the reddit link, I copied the wrong one)
Any advice to survive the mebedded systems course.
Take it step by step, and ask questions when you don't understand what's going on.
Embedded courses have changed a lot since I took them, but at their core it still covers the basics. Micro controllers are simple machines, that's why you can talk about how they're built at their most basic level. That said, it's easy to get overwhelmed. Focus on 'what actually needs to happen' one step at a time.
It's similar to programming, break everything down to really simple steps. Read datasheets, write notes as you read it, etc.
This is a eight week course as well and so Iโm trying to break a step-by-step so then I can accomplish it within that specific time we are expected to do between 16 to 20 hours per week and so it will be a part-time job for me
To survive this course at this is really important for me to graduate as so that I can be able to complete my CS degree. Thank you very much again for your help and all.
@errant wigeon
VHDL is used to describe hardware , it is not a programming language that tells microcontrollers what to do
Thank you
Iโm having issues trying to get this ultrasonic sensor work, is there anything wrong with the wiring?
I can't really see any of that wiring, so not sure ๐
lemme take some better pics
I mean first thing that looks like it could be off, the little black breakout that's providing power from USB, how is that currently connected to whatever the blue board is?
Because it doesn't look like they share ground
this is essentially what ive done, sorry just redid on tinkercad
im pretty sure its the faulty black wire on the gnd pin of my ultrasonic, its really loose but the school hasnt provided enough FF wires sadly
Maybe, but first I'd check this
Because I can't see in that original photo where the black board and the blue one are sharing a ground
You have the gnd of the sensor going to the blue board, but there's no gnd going to the black board that I can see
This part??
Ah okay so is that grey wire the one connected the gnd of the black board to the blue board?
Yeah the grey goes to the black board and the blue goes to the ultrasonic
Okay so that probably isn't the issue, what's going wrong at the moment?
Are you just getting bad readings?
Then yeah, maybe share that
yeah im not sure what this is actually doing, i was just trying to test the ultrasonic sensor
i have 4 on me, none of them are working with the code, so im assuming its a code issue
This seems rather odd, why do you have a 10 second delay after setting the trigger pin high? Correct me if I'm wrong, but the way an ultrasonic sensor works is you set the trigger pin high, and then you wait for the echo pin to go high, and you can figure out the distance based on that.
At the moment you set pin1 high, then sleep for 10 seconds, which is a longgggggg time, it'll take that sensor a fraction of a second to read the distance and set the echo pin high, so you're never going to see it in this configuration.
yeah that might be the issue
You can probably just remove those two lines after pin1.write_digital(1)
Just set it high and then call your measure_pulse
Let me fact check that though
It may be a bit different to what I'm thinking
Ah okay so maybe you do need a falling edge for it to then send out the pulse, but seems like the trigger pin should only go high for a couple microseconds
Is that sleep currently in seconds or ms?
theyre ms
im not sure what its doing, its still reading 0
Send the code you've got at the moment, we'll take a look at that
Go back to this, try with the sleep(0.01)
As in after setting it high
So ```py
pin1.write_digital(0) # you probably don't need this
sleep(1) # or this
pin1.write_digital(1)
sleep(0.01)
pin1.write_digital(0)
Set it high, wait 10 microseconds, then set it low
oh alright
its still only reading 0...
theres no interference or whatever, ive tried sitting it down and holding it up so unsure
Send the code you've got at the moment
wait
I think your trigger and echo pins are switched, it might be the angle of the photo
But it looks like you had trigger connected to pin 2 on your microbit
And echo to pin 1
Send a photo of what your circuit looks like now
one issue ive been having is that the black FF wire on the ultrasonic keeps falling out, but i dont own another wire. every test ive done it stays in though
maybe ill tape all 4 of the wires on the ultrasonic together, and then tape the gnd wires together
Send the current code you've got, we'll do a check on that again
weird quirk ive found with it, if i put anything super close to the sensor, it reads 3
Is dividing by 58 correct? we may as well check that real quick
Speed of sound is like what, 340 m/s, that's 0.34 m/ms, which is 34cm every millisecond. So shouldn't you be multiplying your duration by 34, since your duration is the time in ms that the pulse took? Or actually divide it by 2 to find the real time it took to go one way rather than both, then multiply by 34?
btw this is my actual assignment's code, that code is just to try and get any reading on the ultrasonic
this one just displays a sad face, which is def an issue with the sensor
i feel like thats probably right, gpt's logic didnt even sound remotely right
this is like the 37th iteration or something, im sure this has its own issues but thats not too important right now
now im getting numbers, its just like 500 and 600 and stuff
sounds a bit better
yeah its reading numbers, the multiplication value just seems off
ive tried a couple, but i think it reads 0, 1 and 2 multiplied by whatever it sees closest. i was holding my phone 30ish cm away and it was reading 2
I mean it won't be particularly accurate, and also you're reading this off the microbit display right? That's probably going to be rather tricky
Maybe print the values out if you aren't already
And check the output
yeah my teacher made this assignment really dumb
Because reading them flashing around on the display isn't going to be easy
im not even sure how to print to the serial monitor on mu
I'm sure it'd be possible, I wouldn't know how I've never used a microbit before
But sounds like a pretty standard feature it'd have
i think it works better on makecode
except for some reason it has 40 problems on there
sleep isnt defined on there wtf
might just stick to mu
I just dug out this pad that my programmer friend gave me a while ago, thinking nothing of it...and I'm completely blown away.
Apparently, once I learn something called CircuitPython, I can make this do whatever I want! ๐ It's exactly what I've been looking for!
finally built a shadowboard builder with a raspberry pi!
my bad i guess i didnt fully understand what a microcontroller was
although, wouldn't this still be the best channel for that message?
just messaged the mods and it does fall within the scope
Do you guys have any idea about rospy
i would closely watch ROS2 + its wasm ports ( backed by quantstack) and look for python 3.13+ wasi integration
i think you may need something like https://github.com/dheera/rospy2 too then for code porting
I always wondered if I wanted to actually build my prototype, how would you do this? Has any sent their project to a company thats able to make something ie custom circuit boards, cases etc.. for whatever project
for samples you can order online and get your board(s) in the mail
be warned if you do assembly outside your country you will have to deal with inspection/certification from FCC/CE customs etc ... especially if involving wifi
Samples? What do you mean? So I have an arduino and been messing around, but its a bit bulky (especially with the bread board) but lets say I wanted to build a drone or idk a remote control car or something. After the prototype is made, are there companies that people have dealt with that build peoples ideas if you send them protoypes?
Also, unrelated question, is this channel mostly for Python microcontrollers or ones that can potentially run Python or microcontrollers in general
you send them drawings for circuit board
then they make the board for a quantity and send them back to you
I see so then you would send your "shell" of whatever external supporting case to another comanpy that does like plastic moulding or something?
if you are dealing with GPIO and SPI/I2C then you are on topic
yes you need multiple providers because different jobs, if you want simple you go to specialized firm that do everything and they will charge you A LOT for prototyping
that's why everybody use carboard and hot glue to design the future
Good to know. I had some random ideas, I'd like to create . I was thinking I might try and get a 3d printer to create my own cases to start then go from there lol
What are the downside to ESP32? I like my arduino, but ESPs are so cheap.
if using with python, memory too small pick esp32 with PSRAM
if you know what you are doing esp8266 is just enough for everything ( though only 1 adc is really short )
i am make a robot arm can use in insdustury the job of robbot is pick up the pakage from conver belt and place into somewhere else
what that purpose i need to learn ros 2
gazebo
and tf.broadcast
i new in robotics i don't have any knowlege
and zero work experience
in ros
robot arms are really quite complex,expensive and breakable stuff when used in real situations
i am participating in national competion
with real arm or simulator ?
if real you need to build a model of it
including ros and open cv
i the arm will be given in competion all i have to do is coding stuff
Does c or c++ works best for microcontrollers.
most SDKs for common microcontrollers are written in C++....
Where can i start learning how to program an arduino to handle a a mini rover
most arduino coding is done in c++
start with the most basic tutorial you can find then dive into controlling servo motors and navigation
Just a basic intro to arduino pretty much and go from there?
yeah thats what I would recommend
How do you guys make your pcbs? I have a more complicated project (macro pad) the wiring is not particularly complicated just a lot of wires, thinking about going chemical etching.
for simple stuff i use that type a lot https://www.aliexpress.com/item/1005001856688942.html
Thank you
HOLY
I don't have much experience but I wouldn't say there are downsides? esp32 should be more powerful and seems to have more features
Yeah they seem pretty good so Iโm like why so cheap. I wonder if the cost for the Arduino goes into the โsupportโ like itโs IDE and whatnot.
use rust ๐ค
The only "downside" to an esp32 when compared with Arduino would probably be the power consumption. Other than that , esp32 are pretty much better than Arduino in all aspects. They are cheap because chinese manufacturer mass produce clones which drives the price low
Fwiw Arduino are pretty cheap too, if we talk about clones
I'm happy with EPS32 and ESP8266. I'd recommend it for MicroPython development
Plus you get a WiFi included
I was able to make a esp32 cyd positive affirmations sender receiver if anyone wants to try out the code
WIFI on a ESP32 has many uses
loving these cheap yellow displays, for just a bit more than a esp32 can have a touch screen built in. anyone else tryed them out?
maybe show a picture / link to what displays you are talking about ??
when i search for cheap yellow touchscreen display , all i see is these mobile phone displays
@elfin sphinx
cyd or cheap yellow display. the 2.8 inch one seems to be the sweet spot in price and value. just a standard esp32 i think with many awesome features. lots of youtube videos on it. they also have a discord channel for it.
from what i can see they are just like any other display just with a different PCB colour
but yea i used similar displays with same display driver ICs , work fine
also the 2.4 inch displays (the non yellow ones) are like 10 bucks , so they are cheaper ig
nice, yeah, it has ldr and speaker hook up. i would like to get a screen without esp32 but im enjoying this one for now
the esp32 in the screen makes it come out to about the same price
i guess , yeah
but i rarely encounter a project where all i need is just the ESP32 and a big display
having the ESP32 seperate makes it easy to hook up components and everything
theres this library for it and maybe your projects too. some good examples and theres another repo somewhere to with other good examples. https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display
these displays might be good for stuff like differet dashboards , status indicators etc
compact in size , have everything integrated in single PCB , cool concept ๐
i got two for espnow experiments. i created a 12 button touch screen with macro keys and gave it bt functionality today. i see potential, coming up with fun ideas is the hard part sometimes
thats a cool project
have you ran espnow @elfin sphinx ?
i had experimented with it , but not used in any projects yet
chat gpt has been helping
nicee
nice, its very fast and longer range
yep, just dont have any project idea for it yet
maybe a RC car ๐คทโโ๏ธ not really sure
Today's fun
I think I'll make two pages for it for more buttons and a front menu if I can pull it off. Need it for my plant watering system
pretty sure if i do start on that idea its gonna end up in the graveyard of unfinished projects ๐
In theory you could make it as many layers deep as you want
good luck !
Lol, what ya working on lately?
4mb of pure goodness
Developing a system for a client
they want to make a ESP32 based periodic timer system (something you would use for like a stuff reminder box or smth like that )
and i have to make it low power so it consumes very low power when connected to battery , so just working on that
and apart from that , just fucking around with the 3d printer i recently got
@elfin sphinx I made a esp now positive affirmations sender receiver also with serial interject to send whatever while it sends 40 random positive affirmations can overdue with other text
ohhh noicee
so its like one of the 40 hardcoded affirmation being sent out or if user types something , that gets sent , correct ?
Awesome man. I hope to find d some work like that one day
you wil you will , dw
i got that client bcoz one of my college friends hooked me up lol
Low power is king with mcu, what 3d printer did u end up going with?
(aight i have to dip now , ill be back after a while)
SV06
nice, ok man, cheers!
what do you guys think about this project? uses the ps/2 port of regular keyboard with esp32
Hey, I don't have any experince with ESP32 or embedded stuff in general and I'm trying to configure an I2C comms with an external sensor, what may be going wrong there?
#[entry]
fn main() -> ! {
esp_println::logger::init_logger_from_env();
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
let clocks = ClockControl::max(system.clock_control).freeze();
let delay = Delay::new(&clocks);
let sda = io.pins.gpio8;
let scl = io.pins.gpio9;
let mut i2c = I2C::new(
peripherals.I2C0,
sda,
scl,
100u32.kHz(),
&clocks,
);
for address in 1..255 {
let mut data = [0u8; 6];
delay.delay(20.millis());
let result = i2c.write_read(address, &[0xFD], &mut data);
match result {
Ok(_) => log::info!("Device Found at Address {}", address as u8),
Err(_) => log::info!("No Device Found"),
}
}
loop {}
}
I can't seem to read/write from any address and I'm not sure if it's a code or physical problem ๐
which ESP board do you have ?? which sensor are you using ?? (also it might be great if we could see a connection diagram or a photo of what you have wired up )
Perhaps try to add some type of debug system to help point of its either or. Were you able to make progress by chance?
uh can you code an Arduino in python
@cloud hinge @elfin sphinx I'm using an ESP32-S3 board and a SHT40/41 sensor: https://sensirion.com/media/documents/33FD6951/662A593A/HT_DS_Datasheet_SHT4x.pdf
0xFD command should measure temperature and humidity, response size is 6 bytes, so I create a buffer for that: [0u8; 6];
SDA is pin8, SCL is pin9 ๐ค
Guys, I have to build an ai powered image recognition system for my science competiton.I have made the program but i don't know how to use any microprocessor or build a model. Can anyone please help me
to display it in and ofc i can't just take my laptop their and show them
this pin should go to GND instead of 5in right ?
It's ground
yea, then why is it connected to the 5V pin ?
It's connected to ground, perspective issues
I've been at this problem for a couple of days and can't figure out what's wrong ๐
they're 2kOhms, should I try a different value?
it should be fine , but just for peace of mind , try something like 2.5k-3k ish
the "recommended" for 3.3V logic is 2.4k afaik
Ok, but is there anything else that could be wrong there?
make sure you are using the correct address for your module
you can find out the address of connected device using a i2c scanner code example
I only have 2k, 2.2k and 3.3k ๐ค
My code is an i2c scanner ๐
I bought a multimeter and measured 100khz on the bus, so I assume it should be working?
do 2.2k
also , try it without those pull ups as well
pull ups are not always externally required , i have never used pull ups on almost 95% of the I2C modules i have used
I think I tried without pull ups, but I'll try again
Really no change with 2.2k resistors and without them ๐ค
aight , so hardware wise , all seems to be connected just fine
but unfortunately i have no idea how rust works so i am unable to debug your code
how about , you try this arduino code
#include <Wire.h>
// Set I2C bus to use: Wire, Wire1, etc.
#define WIRE Wire
void setup() {
WIRE.begin();
Serial.begin(9600);
while (!Serial)
delay(10);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
WIRE.beginTransmission(address);
error = WIRE.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
and share the output , so we can see if its a hardware issue or software issue
Thanks, i'll try that ๐ค
(post what happens when you can, ill be back in few , have to step away)
I think it's waiting for serial forever for some reason
And the code works in wokwi simulator ๐ https://wokwi.com/projects/409710252052961281
I tried different sensors and different esp32 s3 boards, but result is the same
thats not the serial monitor . That just shows the output of upload process
you have to open serial monitor seperately in the arduino IDE using this button
so , open the serial monitor and press reset on your board
Uh, encoding problems?
10:17:23.883 -> @โธฎโธฎ)โธฎฮ2โธฎโธฎโธฎ9mโธฎM)nโธฎ
probably
check that the baud rate of serial monitor is set to 9600
just for my confirmation , could you send a pic of your whole serial monitor ?? ๐
rate of 115200 seems to work? ๐ค
But it doesn't seem to scan anything, I'm also very confused why rust code seems to work in wokwi
yea , so the 115200 buad should be changed to 9600
this is what you see when you reset the board right ?
Yep
can you set it to 115200 in both places and check again ??
(you need to recompile and reupload the sketch after you make a change )
this is pretty weird issue, i never had problems with this baud rate
^ That's what I was getting
HUH
why wont it print anything then , at least this line Serial.println("\nI2C Scanner"); should have been printed
I tried a different board, it's the same ๐
different ESP32 S3 board or different model board ?
Different esp32 s3
Ugh, I've been using a wrong usb type c port? ๐
What are default pins for i2c on esp32s3?
if you see the boot messages in serial monitor , then it means that the serial connection is working
from what i could find (i swear why is there not a single diagram that explains the pin functions in detail lol) , looks like 8 and 9 are the correct ones
It doesn't seem to be able to find anything ๐ค
void setup(){
Serial.begin(115200);
while(!Serial)
delay(10);
Serial.println("The serial monitor is working");
}
void loop(){
}
No, the serial is working now, but It doesn't seem to be able to find any i2c devices
What does the message say ? ?
if it cant find anything , it should print i cant find anything to monitor
you see that ?
10:34:50.123 -> Scanning...
10:34:50.123 -> No I2C devices found
ahhhhhhh, good
so at least something is working
ok, do you have any other I2C module ? ?
like a dispaly module or whatever
anything that uses I2C
Yeah, I have the same sensor and a couple of screens, but I tried them before too with the rust code
can you connect one of them which you know works to this setup and see if their address is getting recognized ??
bcoz tbh i really dont see why it shouldnt work , you are doing everything just fine
so we want to eliminate the possibility of the faulty module
http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference
looks like you are using the correct default pins
I tried a different one (same model) and the ldc screens, but nothing seems to be working ๐ค
There's physical connection between all the relevant pins
#define WIRE Wire1
can you change the second line of code to this and try again ??
maybe , the Wire is not the correct interface we want (which it should be , but we try everything we can)
10:45:06.697 -> Unknown error at address ...
10:45:06.697 -> Unknown error at address 0x7E
10:45:06.697 -> No I2C devices found
Aight , so something
can you try different mix and match of pull up resistors , try upto 10k ?
This was without resistors since you mentioned that you didn't have to use them in majority of cases ๐ค
I'll try
yea, but i mostly use the ESP32 wroom module , rarely used the S3 , so maybe its different on there ๐
It seems to be able to find the lcd screen with both I2C0 and I2C1...
you mean like with Wire as well as Wire1 ?
Yeah, I'm trying it with the rust code too
not just yet , now we know that I2C bus is workign
now connect your actual sensor to the ESP32 , and see if that gets recognized
Yeah, It doesn't seem to be able to recognize the sensor ๐ค
like , not even the Unknown error at address ... thing ??
1 sec
bcoz if you see the unknown error thing , you might be able to try different pull ups and maybe get it to work
but if you see no device found at all , then it might just be a busted sensor
It says "uknown error" for majority of addresses, I'll try different pull up values
Is there some sort of documentation on how to calculate the needed resistance?
what do you mean "for majority of addresses" ?? you have multiple devices connected on the bus ??
For all of them* ๐
yes , but its kinda complicated , you h ave to factor in the capcitance and whatnot (https://www.ti.com/lit/an/slva689/slva689.pdf)
in 99% of the cases , a ball park value should be fine .
HUH ๐
Tbh if the screens are getting recognized , i blame this on a faulty sensor module
bcoz whenever we see the Wire.endtransmission return code 4 , it means the I2C bus is kind of mess and something is wrong in hardware ( its documented as "other error" )
also if the chip was powered like this even accidently , it has the potential to permenantly damage the chip
I think it's a problem with this specific sensor model
I've seriously been considering becoming a gardener at this point ๐ญ
do you have another module of this sensor ?? you can try that as well
It works even without pull-up resistors
as it should in most cases , yea
I have two, they both don't seem to work
Different one does...
where did you get the sensor from ?
They're from aliexpress, different ones seem to work though https://aliexpress.com/item/1005005517463180.html
e.g. this one https://aliexpress.com/item/1005002652456277.html
yea but those modules use different chips, so..
tbh i am not really sure why this is causing problems, i dont see anything wrong in your setup or the code , also the other I2C devices get recognized just fine so.....
whenever i am in situation like this , i just grab an arduino Uno or Nano , connect my sensor to that and see if that works
i suggest you do the same (just make sure you provide the sensor with 3.3V power instead of 5V also make sure you use a logic level converter module between the arduino and module because the arduino works on 5V logic levels )
a module like this should be fine for the logic conversion (they are dirt cheap too)
I'd rather just use a different sensor and get my $2 back for these ones ๐
Thanks a lot for the help, I've been at this issue for a couple of days
if you dont have any of the stuff i mentioned like the arduino or this module on hand , then yea , thats the most logical option
but if you do have these things on hand , it wont hurt to give it a go in my opinion
either ways, good luck and have a good one
Thanks a lot again, I was able to read the data from sensor ๐
pub async fn read(&mut self) -> Result<Aht30Result, Error> {
self.i2c.write(self.address, &READ_SEQ)?;
Timer::after_millis(100).await;
let mut buffer = [0u8; 7];
self.i2c.read(self.address, &mut buffer)?;
let temp_raw = u32::from_be_bytes([0, buffer[3] & 0b00001111, buffer[4], buffer[5]]);
log::debug!("Aht30 raw temperature {:#x}", temp_raw);
let temp = f64::from(temp_raw) / f64::from(i32::pow(2, 20)) * 200f64 - 50f64;
log::debug!("Aht30 temperature {}", temp);
Ok(Aht30Result { temp })
}
INFO - Aht30Result { temp: 26.611900329589844 }
INFO - Aht30Result { temp: 26.60999298095703 }
INFO - Aht30Result { temp: 26.601409912109375 }
INFO - Aht30Result { temp: 26.615524291992188 }
INFO - Aht30Result { temp: 26.598358154296875 }
HUH
what was the issue ?
wait , this is another sensor right ? it says Aht30
I guess the sensor itself
ahhh okok
Yeah, this is a different model
Yeah, something similar, seems like a nice opportunity to work with rust and try to send that data to prometheus server
Hey, if I want to program a remote control (in TV remote control style) for my pc with bluetooth, do I program my microcontroller as a wireless "keyboard" or, with a blutetooth master-slave system, let the slave simulates key presses?
programming smth like ESP32 to act as BLE keyboard should do just fine
your PC thinks its just another keyboard
you want to run a .bin file on a micro controller ?
a .bin file compiled for a target uses the instruction set for that target
for example a file compiled for Arm processor uses the arm's instruction set ( and it wont necessarily work on another machine that uses different kind of processor with different instruction set)
so you need to know what kind of chip your smartwatch has, then emulate that somehow on your PC ,if you are able to do that , you can run your code on your PC
or maybe the smart watch you have is a very popular smart watch , people have already RE it and have made tools available , so gotta do some googling depending on your exact watch
this indicates that the data inside your game.bin file is of binary type
yes
file command is used to find out the type of file and data
yes, thats another type
if you do a text file , ti might show smth like ASCII text
you need to know the instruction set for your chip , then emulate that using some sort of program , like python or whatever
then you would need to make another software that emulates the screen and buttons of your smartwatch using a GUI library in python or whichever language
all of this is insanely hard and really not worth it for running a simple smartwatch game
why do you want to run it on PC anyway ?
what OS does the watch run ?
is it like android based or no ?
do you have a link to that watch or smth ?
hmm , sounds like another chinese clone smartwatch
if you are able to get what microprocessor is used inside the watch , and if its a common microcontroller like STM32 based or smth then you can do some progress
but i doubt its that , its most likely custom chip with its numbering sanded off , so you are most likely gonna get nowhere with this ๐
at any rate , the RE server might be able to give you some insights on the .bin file of yours ig
those people know how to exploit stuff and they might be able to give you extra insights
whats the chip number ?
like apple A7 chip ??? sounds unlikely , that chip is overkill for a smartwatch and probably a lot expensive
not to mention apple doesnt really release stuff like that to others afaik
well , good luck with your journey lol
hello i got pico mw and i been trying figure out how to get adafruit momo 0.96 oled working?
it keep telling me no module
did u pip install the module?
im on thonny right now trying make it work
what library is it that ur trying to use?
if u dont install the library with pip, it needs to be in your interpreter's site-packages directory
or the same directory where your shell is running. the error message says python cant find that module, meaning its not installed properly or in the wrong directory
that what i been trying to do but it keep giving me error
ok, what is the name of the module
ssd1306
im on window 11 it not linux related
ok but the rpi is
on the rpi itself - you need to run that command
you can run that command on windows as well
do you have a circuit diagram and a photo of how everything is connected together ?
and send error message
it pico microcontroller i'm trying to make rc car
okay , but we still need to see a connection diagram , the code , the error message
also a photo of full thonny editor when it gives error would be great
i suspect it's not installed
usually i drag drop stuff onto the pico, dont know if pip install even works on that thing
im not super familiar with the pico - is it micropython or cpython?
both are different things 
micropython and circuitpython , both are supported on pico
also since its micropython/circuitpython , its kind of board independent (the pip stuff)
thats pretty cool. i am building a gui library for micropython on the CYD. assumed it was pretty similar
can you go to view and click on files ??
it will let you see all the stuff thats on the pico's storage
so , you are telling your code to use the ssd1306.py file , but its not actually on your pico , you see whats happening here ?
you need to put that file on the pico
^
im new so i don't know how it works
i suggest you checkout some tutorial or smth
i currently am busy with smth so i cant walk you through it atm
but if you got to youtube and type in "micropyton with pi pico" you would find tons of tutorials and guides
i actually download some file but i have no idea how to use thonny
we have all done it/started somewhere @faint lichen
i don't what am doing i put in lib file it still has't found module
read the docs for Thonny. There you will find info about 'Instlling Modulals". you should be able to figure out how to install PIP3, and the libraries you will need to get the OLED working
Also you should look at Random Nerd Tutorials.. There they have info on how to use MicroPython on a Pico and using Thonny, and implementing an 0.96" Oled .."Hello World"..
ok ty
i need help it keep giving me error because i can't import i2c device
could you post another screenshot like yesterday ?
you need to save your code on the pico itself
make a main.py file on your pico (not inside of the lib folder , outside of that lib folder)
and then paste your main code in there , and then run that
can you psot new picture ?
You need to upload the whole folder adafruit_bus_device to ur pico, u have copied it partially
Also make sure u upload the folder as is
What's the error
AttributeError: 'I2C' object has no attribute 'try_lock'****
i'm not sure what it means?
You are trying to access an attribute that doesn't even exist
Can u send photo ? It will tell me what file is causing the error
Wait, r u using micropython or circuitpython ??
The Adafruit library is a circuitpython library(I think) , u cant use that in micropython
pico is the board
micropython or circuitpython are 2 languages that you can use to program your pico
you cant use a circuitpython library in micropython code
you see whats happening here ?
what are you trying to make/do ?
yeah i know i was trying make rc with little screen come up top
as in little altoid tin
with wheel and servo everything
can you try this code ? ?
replace the ssd1306 in your lib folder with what i sent
and then use the main.py code i sent
this will check if the screen works or not
and just make sure you replace the SDA and SCL pin (0 and 1) on line 5 in main.py with what you have ( 4 and 5 ) iirc
it make no sense it said no i2c device found??
photo of your setup please
And ur latest code + error
in your code , you say that your display SDA is connected to pin 4 of pico and SCL to pin 5
but is that actually where the pins are connected ?? it looks to me the pins are connected to pin 0 and 1
so its obvious this wouldnt work
@faint lichen
also double check the SCL and SDA wires
i did
ok it seems there a address issue thing going on
oled display not found address 0x3c
NVM I GOT IT WORKING
it usb problem it no wonder
i don't understand i got it working bu ti switch usb port and now it keep doing same thing
it was working now it back down
I assume you are on windows?
For me, in the past, this turned out to be a "USB Hub" issue. Windows for some reason who get a serial adapter stuck and any attempt to use it resulted in Permission Denied as the previous "usage" hung up.
I would move the USB plug to a new port on the hub and it would work again.
When I ran out of the 4 ports, I had to restart the hub.
That's when I realised it was a hub issue and connected direct to a USB port and ... it worked.
It only happened once to me, a long time ago, haven't seen this behaviour since and I do use Hubs.
So YMMV.
So while you are in that error state re-plug your USB hub and see if it clears.
??
if you want your code to run as soon as you turn on your pico , without opening thonny , make a file called main.py and put all your code in there
you have made Main.py file , not sure if thats causing the issue or not
what exactly is the issue right now ?
I just taught myself how to solder and made this gem.
I ended up making a Simon game out of this circuit.
Nice!
is there a way to transfer convert everything from vscode platformio to arduino ide super easy? seems seems arduino ide to platform io is much easier for example using .ino for in vscode platformio. would be a nice feature for people who like to switch it over
what compiler are you using
I am extremely unsure of how to get started with robotics. I am completely unaware of anything and assume, for the simplicity of explaining, I am very stupid.
What should I do? I can only afford an Arduino, not a raspberry pi.
Would the Arduino UNO be a good starting point?
yes an arduino uno is a great start, i started with arduino nano. i recomend the l298n motor controller as its inexpensive and has a ton of features for controlling motors. robojax on youtube has great tutorials for using it along with the needed libraries
I was looking at this kit which seems to be affordable enough to me... will it be good?
https://www.diyelectronics.co.za/store/kits/948-arduino-uno-basic-starter-kit.html?srsltid=AfmBOorMCIHhOf7Ef1BwivBMi6SEAGv7AmmeT7Rc_35EeBcXqJh8LX5PTdQ
This Basic Arduino Uno Starter Kit is the ideal starting point for beginners, but can also be a great addition to an Arduino or electronics toolbox.
it looks like a nice kit, there are some affordable packages on amazon and ebay too. it pays to shop around. some kits have more components depending on what u need and might be comparible in price. i got the 3 pack of arduino nano clone for a great deal like 2 bucks a piece a long time ago. nano has most of the same features as uno but uno might be a better starting point for easier access to pins
I don't have eBay in my region. Amazon just arrived recently yet they charge sky high prices, making it less affordable. Also I am not sure if I will like this or not, hence my hesitation to spend too much money on a starter kit. I like this kit, as it comes with the lights and buttons, meaning I will be able to experiment and play around with combinations and see if this is something I wish to build on.
From my university courses of my choice, one of the ones I want to do requires me to be familiar with robotics and these micro controllers, hence, my wish to enter this field.
NIce, makes sense. the cool thing about electronics is sometime you can get the parts off old electronics for certain need projects. not always possible but sometime can work out great . leds and diodes can that way a lot of times. for other things like buttons its possible to desolder with the right tools. need some type of solder sucker
So this kit will be a good purchase for dipping my toes in?
that alone can blink a led, do wifi, and run python https://www.diyelectronics.co.za/store/iot/1180-esp8266-wemos-d1-r2-wifi-dev-board.html
5volts tolerant except on ADC and apparently cheaper
Yes but it does not come with any components. I don't have any components...
why not first blink the onboard led ? you don't need component for that
Yes but then after that I might want to expand. Not to mention this is just a board. There is no cable or anything to attach it to your computer
just findint its gpio number will enjoy you a full week end ๐
this one can use a standard phone microusb cord, or wifi
I like the kit I posted about as it comes with a breadboard, cables, lights and switches. Simply programming the light on the board is not enough for me. I want to kind of get into it, and I think that the lights, switches and breadboard will allow me to get a good enough feel.
programming the light is everything, that's the point of digital electronic. cabling is just boring and source of failure ( and "magic smoke" )
But then if I want to go further I have to buy a whole new kit. And the shipping cost is insane. I'd rather go a little overboard than a little under and then have to pay again for additional components.
problem is "further" and "arduino uno" in the same sentence
wdym?
if you go further you will go toward STM32 , arm socs or ESP8266/ESP32 and bus with 3.3 volts levels
AVR (arduino uno atmega) are old, expensive, don't have enough sram for beginners and 5 volts
you could as well make your first steps on https://wokwi.com/ and then buy something really usefull
But I am not even sure what I want to do, or what it is that you are telling me about
Which is why I think it is best that I stick with the beginner kit. It serves as a guideline.
imho you get digital electronics wrong it is more about coding ( the hard way) than wiring, but everybody need to learn one way or another
Yes but I can use that same beginner kit to code (like you say) and build basic things. Then I can buy more components to build on it and experiment more.
that's exactly NOT how thgings are done nowadays
nowadays we build everything on simulators, run fuzzy tests on them, and only go to prototype after success. That is the only way to lower costs and re-use components efficiently
Yes but I would still be able to do that with the beginner kit...
wokwi simulator has far more to offer than the more expensive kit in the store you linked
and it should not burn your house if you make a mistake
Oh yes I have heard of it
It seems to be what I want
Though I am a little disappointed that I cannot get hands on ๐ฆ
you can you just have to look at your pc a different way
eg save an old pc from e-waste, get a few meters of semi-rigid alarm cable + a decent plyer/cutter and begin to play with soundcard as a dual channel ADC , fun oscilloscope + 6 ways pwm output , or parallel port as GPIO in/out
I am trying to build the basic blink project, but did I do smth wrong?
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}```
Ohh my code was wrong
iirc builtin led on uno is on pin 13 and you wired the 8
making new project and I need to pick hardware, anyone got suggestions?
Requirements
Under 10$/โฌ per microcomputer
Has a digital output for a relay/led
Can open a capacitivePortal
Can connect to wifi with antenna and Ethernet
Easy to code
Thought about esp32 with ethirnet but i dont really like micropython and would prefer python
the cheapest board that can run full blown python would be a raspberry pi zero /w/2w imo
and those are around $10-15 (depends on if you want wifi or not )
also those are without ethernet. for 5 bucks extra you can get it to support ethernet over usb
but no "microcontroller" like arduino or esp32 will be running full blown python
exceptmaybe http://www.caddit.net/pythond/ running on an esp32 dos emulator ๐คฃ
Full python 2.4.2 interpreter with dynamic library module support, OpenGL, Dislin and other extras
what don't you like in micropython, maybe it is fixable ?
otherwise under $10 i only know "lichee pi zero" that could run full python3
but wifi/ether will raise the cost
Ok, i kinda need some help. Im doing a project where i am going to be using a raspberry pi to make a steering wheel (bc im too poor for an actual one) but i can't find out how to emulate the xbox one or controller inputs i need. Help would be appreciated.
i got like 50% of code that needs to be converted from python to micropython, and there are like libaries that dont exist on micropython but are similar, which kinda defend the purpuse of ease, (Beatiful Soup 4 and Flask would be the 2 biggest concerns for me
hmm given the modules mentionned i'd say you don't want MCU, but more cheap arm socs with at least 512MB ram like *pi boards
can you code the ESP32 in python??
yes and especially those with PSRAM modules
oh ok
what is the strongest microcontroller that esprissif makes?
no idea
same here
note you can also code remotely small MCU that cannot run locally cpython, with telemetrix project
really cool with eg wemos d1 mini ( esp8266 )
i think the point of original "pi" is to be not bulk and quite unavailable to keep high prices, unlike "clones" pi ( cheap == where no one is getting paid to write accurate docs/samples/aftersale )
if you want bulk tbh go STM32
is it actually usable tho?
regular python requires lots of resources
also what version python does it support ?
yeah way too much to be useable, i was advising (micro)python + psram to be comfy
tbh python3.13 does not even fit on WII
ahh ok
micropython is a different story then
kinda important nuance to point out tho
since most beginners just want to copy paste their regular python code on a microcontroller which wont really work and then they will start asking questions "how do i download requests library in micropython" or whatever
requests uses aiohttp under the hood right ?
nope it is synchronous
hmm
what library was it then that was like requests but used aiohttp 
i thought it was requests itself lol
httpx can do sync/async iirc but never used it
Hey, I need help with Bluetooth on my pyboard lite 1.0 (MicroPython v1.23.0 on 2024-06-02; PYBLITEv1.0 with STM32F411RE) and HC-05 module.
I have this code:
from pyb import LED, UART
import time
uart = UART(2, 9600)
uart.init(9600, bits=8, parity=None, stop=1)
led = LED(2)
print("Starte HC-05 Kommunikation...")
while True:
data = uart.read()
print("Empfangen: {}".format(data))
uart.write("abc")
led.toggle()
time.sleep_ms(250)```
I don't get an error
Empfangen: None
Empfangen: None
Empfangen: None
Empfangen: None
Empfangen: None
Empfangen: None
Empfangen: None
Empfangen: None```
I connect RX from my module HC-05 to X3 and TX to X4. But if I try to send a string per terminal with a serial bluetooth app from android, it doesn't read anything. The app also don't get the "abc". But the connection works, if I am interpreting the led of HC-05 correctly
hello :D im completely new to microcontrollers and i have no idea where to begin, is there any specific one anyone recommends to start with?
Arduino uno for simplicity. Once u get that down jump into esp32 for more capabilities and faster processor but wait till u understand arduino uno first as most of the features transfer over to esp32. There are arduino clone knock offs that are good but I'm not sure what ones are good these days
okay tysm!
Any time
can acs712 current sensor work with esp32 without adding ressistors? i wasnt able to get any reading on pin 21, 22 or 27 https://github.com/RobTillaart/ACS712
- Yes the two resistors are required because the ESP32 ADC can measure between 0 - 3.3 V. But since the ACS module operates at 5V , its analog output will be upto 5V, we need to convert that down to 3.3V so that ESP32 can measure it without being damaged
- pins 21, 22 are rnot ADC input , and pin 27 is ADC2 input. ADC2 cannot be used if you are using wifi.
Hello, I try to use a rasspberry for simulate a mouse and recognize the color of a pixel on the computer's screen. The problem is, I have to use only library compatible with circuitpython. Do you have an idea for help me??
awesome feedback thank you, im not using wifi but for some reason pin 27 barely worked with volt meter module connected. maybe it had noise from the cyd display? on pin 27 it was like it was getting a voltage and barely reading more voltage
cant say anything without seeing the whole circuit diagram , code and error
also you need to be sure that GPIO 27 is not being used by some component on the CYD itself