Answers.Body: <p>The Pybricks <a href="https://docs.pybricks.com/en/work/iodevices/pupdevice.html" rel="nofollow noreferrer">PUPDevice</a> class works with any device that supports the <a href="https://github.com/pybricks/technical-info/blob/master/uart-protocol.md" rel="nofollow noreferrer">LEGO Powered UP (PUP) protocol</a>. If you manage to implement that protocol on some other device like a Pyboard, OpenMV or Arduino, the hub will recognize it as a sensor and receive its data.</p>
  <p>The picture you referenced shows a generic device, as well as the bottom half of the Ultrasonic Sensor. This device has two screws in the back that you can remove to reveal 6 breakout pins.</p>
  <p><a href="https://i.sstatic.net/lI4Pa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lI4Pa.png" alt="Generic Powered Up device" /></a></p>
  <p><a href="https://www.instructables.com/member/CEEOInnovations/instructables/" rel="nofollow noreferrer">Here</a> are several example projects that make use of it. Example code to implement that protocol is <a href="https://github.com/ceeoinnovations/SPIKEPrimeBackpacks" rel="nofollow noreferrer">here</a>. These projects show how to do it in Python, but ultimately the protocol referenced above is on top of UART, and could be implemented on Arduino systems too.</p>
  <p>All of this would be a bit easier if Pybricks supported plain UART (so you could skip the protocol). You can upvote that particular feature request <a href="https://github.com/pybricks/support/issues/220" rel="nofollow noreferrer">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-24T07:32:18.687Z
Answers.LastActivityDate: 2023-10-24T07:32:18.687Z
Answers.UserDisplayName: Laurens Valk
Body: <p>The Pybricks documentation has a page for &quot;custom devices&quot;, with a picture that shows circuit boards with Lego compatible cables attached. Additionally, the class that goes along with the picture seems to be used to handle generic devices. This implies its possible to make custom electronic devices for use with powered up stuff, but I can't find anything about it in the docs or on the net in general. Does anyone know anything about this? Apologies if I mess up any terminology, I'm very new to all of this.</p>
  <p>Edit: the page in question in the docs is <a href="https://docs.pybricks.com/en/stable/iodevices/pupdevice.html" rel="nofollow noreferrer">https://docs.pybricks.com/en/stable/iodevices/pupdevice.html</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-23T23:52:33.750Z
Comments.Text: This is very specific to pybricks, so I suggest you try https://github.com/pybricks/support first. Otherwise it's a bit unclear what you asking. Do you want to know if custom (e.g. arduino-based) devices *exist*, or do you want to know *how* to make them?
Comments.UserDisplayName: IvanSanchez
Tags: <powered-up><pybricks>
Title: Powered Up/Pybricks custom electronics?
UserDisplayName: Andrew
ThreadText: # Powered Up/Pybricks custom electronics?
  
  (Asked by: username_0 on 2023-10-23)
  
  The Pybricks documentation has a page for "custom devices", with a picture that shows circuit boards with Lego compatible cables attached. Additionally, the class that goes along with the picture seems to be used to handle generic devices. This implies its possible to make custom electronic devices for use with powered up stuff, but I can't find anything about it in the docs or on the net in general. Does anyone know anything about this? Apologies if I mess up any terminology, I'm very new to all of this.
  
  Edit: the page in question in the docs is <https://docs.pybricks.com/en/stable/iodevices/pupdevice.html>
  
  **Tags:** powered-up, pybricks
  > **Comments:**
  > **username_1**: This is very specific to pybricks, so I suggest you try https://github.com/pybricks/support first. Otherwise it's a bit unclear what you asking. Do you want to know if custom (e.g. arduino-based) devices *exist*, or do you want to know *how* to make them?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-10-24. Score: 4
  
  The Pybricks [PUPDevice](https://docs.pybricks.com/en/work/iodevices/pupdevice.html) class works with any device that supports the [LEGO Powered UP (PUP) protocol](https://github.com/pybricks/technical-info/blob/master/uart-protocol.md). If you manage to implement that protocol on some other device like a Pyboard, OpenMV or Arduino, the hub will recognize it as a sensor and receive its data.
  
  The picture you referenced shows a generic device, as well as the bottom half of the Ultrasonic Sensor. This device has two screws in the back that you can remove to reveal 6 breakout pins.
  
  [![Generic Powered Up device](https://i.sstatic.net/lI4Pa.png)](https://i.sstatic.net/lI4Pa.png)
  
  [Here](https://www.instructables.com/member/CEEOInnovations/instructables/) are several example projects that make use of it. Example code to implement that protocol is [here](https://github.com/ceeoinnovations/SPIKEPrimeBackpacks). These projects show how to do it in Python, but ultimately the protocol referenced above is on top of UART, and could be implemented on Arduino systems too.
  
  All of this would be a bit easier if Pybricks supported plain UART (so you could skip the protocol). You can upvote that particular feature request [here](https://github.com/pybricks/support/issues/220).
  
  
  ---
  
  