This paper presents a proposal for a non-isolated bidirectional converter (NIBC) controlled by a deep neural network (DNN) to enable vehicle-to-vehicle (V2V) and vehicle-to-grid (V2G) charging, which contributes to the development of more efficient and sustainable transportation and energy systems. The DNN controller manages power flow in both directions, making it possible to charge electric vehicles (EVs) and discharge power from EVs to the grid with improved efficiency and performance compared to traditional control methods. The non-isolated topology used in this proposal offers several benefits, including reduced cost, smaller size, and higher efficiency. To train the DNN controller, a large dataset of simulations was used, and the results were validated with a hardware setup. The real-time performance of the DNN controller was compared to a proportional-integral (PI) based controller through simulated results. The findings of the study show that the DNN controller outperforms traditional PI controllers.